Skip to content

Commit 14e9906

Browse files
committed
chore: update TypeDoc configuration and enhance documentation with new categories and modules
1 parent 9e40115 commit 14e9906

File tree

9 files changed

+524
-33
lines changed

9 files changed

+524
-33
lines changed

another-md.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: External Markdown
3+
group: Documents
4+
category: Guides
5+
children:
6+
- ./most-used-modules.md
7+
---
8+
9+
# HELLO!
10+
11+
I'm an md with some `info`

expand-nav.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// Expand all navigation folders on page load
2+
(function () {
3+
'use strict';
4+
5+
function expandAllNavigation() {
6+
// Find all details elements in various navigation contexts
7+
const selectors = [
8+
'.tsd-navigation details',
9+
'#tsd-nav-container details',
10+
'.site-menu details',
11+
'.tsd-accordion',
12+
'nav details',
13+
];
14+
15+
let foundAny = false;
16+
selectors.forEach((selector) => {
17+
const elements = document.querySelectorAll(selector);
18+
if (elements.length > 0) {
19+
foundAny = true;
20+
elements.forEach((el) => {
21+
if (el.tagName === 'DETAILS') {
22+
el.open = true;
23+
}
24+
});
25+
}
26+
});
27+
28+
return foundAny;
29+
}
30+
31+
// Strategy 1: Try immediately
32+
expandAllNavigation();
33+
34+
// Strategy 2: Hook into TypeDoc's app if available
35+
let checkCount = 0;
36+
const maxChecks = 50; // Check for up to 5 seconds
37+
38+
function checkAndExpand() {
39+
checkCount++;
40+
41+
if (expandAllNavigation()) {
42+
// Keep expanding even if found, in case more navigation loads
43+
if (checkCount < maxChecks) {
44+
setTimeout(checkAndExpand, 100);
45+
}
46+
} else if (checkCount < maxChecks) {
47+
setTimeout(checkAndExpand, 100);
48+
}
49+
}
50+
51+
// Strategy 3: MutationObserver for dynamic content
52+
// eslint-disable-next-line no-undef
53+
const observer = new MutationObserver(() => {
54+
expandAllNavigation();
55+
});
56+
57+
// Strategy 4: Multiple event listeners
58+
window.addEventListener('load', () => {
59+
expandAllNavigation();
60+
checkAndExpand();
61+
62+
// Start observing after page load
63+
const navContainer = document.querySelector(
64+
'#tsd-nav-container, .site-menu'
65+
);
66+
if (navContainer) {
67+
observer.observe(navContainer, {
68+
childList: true,
69+
subtree: true,
70+
});
71+
}
72+
});
73+
74+
// Strategy 5: Check for TypeDoc's app initialization
75+
if (window.app) {
76+
expandAllNavigation();
77+
} else {
78+
Object.defineProperty(window, 'app', {
79+
configurable: true,
80+
set: function (value) {
81+
delete window.app;
82+
window.app = value;
83+
setTimeout(expandAllNavigation, 100);
84+
setTimeout(expandAllNavigation, 500);
85+
},
86+
get: function () {
87+
return window._app;
88+
},
89+
});
90+
}
91+
})();

most-used-modules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# Most Used Modules
23

34
The modules you are most likely to use are as follows:

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"@docusaurus/preset-classic": "^3.9.2",
7878
"@docusaurus/tsconfig": "^3.9.2",
7979
"@docusaurus/types": "^3.9.2",
80+
"@droppedcode/typedoc-plugin-relative-includes": "^1.0.5",
8081
"@evilmartians/lefthook": "^1.5.0",
8182
"@mdx-js/react": "^3.1.1",
8283
"@react-native/babel-preset": "0.79.3",
@@ -85,6 +86,7 @@
8586
"@react-native/typescript-config": "0.79.3",
8687
"@react-navigation/native": "^7.1.14",
8788
"@release-it/conventional-changelog": "^9.0.4",
89+
"@reside-ic/typedoc-plugin-copy-doc": "^1.1.2",
8890
"@testing-library/jest-native": "^5.4.3",
8991
"@testing-library/react-native": "^13.3.3",
9092
"@types/jest": "^29.5.5",
@@ -115,9 +117,13 @@
115117
"release-it": "^17.10.0",
116118
"turbo": "^1.10.7",
117119
"typedoc": "^0.28.13",
120+
"typedoc-github-theme": "^0.3.1",
121+
"typedoc-material-theme": "^1.4.0",
118122
"typedoc-plugin-coverage": "^4.0.2",
119123
"typedoc-plugin-dt-links": "^2.0.24",
124+
"typedoc-plugin-emojify": "^1.0.1",
120125
"typedoc-plugin-inline-sources": "^1.3.0",
126+
"typedoc-plugin-localization": "^3.0.6",
121127
"typedoc-plugin-mermaid": "^1.12.0",
122128
"typescript": "^5.2.2"
123129
},

src/core/classes/Iterable.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ const RNEventEmitter = new NativeEventEmitter(RNIterableAPI);
3333
* static methods of this class. EG: initializing the SDK, logging in a user,
3434
* tracking purchases, etc.
3535
*
36+
* @document ../../../most-used-modules.md
37+
*
38+
* @category Testing
39+
*
3640
* @example
3741
* // Initialize the SDK
3842
* Iterable.initialize(YOUR_API_KEY, new IterableConfig());
@@ -47,6 +51,8 @@ export class Iterable {
4751
/**
4852
* Current configuration of the Iterable SDK
4953
*
54+
* @categoryDescription Advanced Use
55+
*
5056
* @readonly
5157
*/
5258
static savedConfig: Readonly<IterableConfig> = new IterableConfig();

src/inbox/components/IterableInbox.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ export interface IterableInboxProps
165165
* It handles fetching messages, displaying them in a list, and showing individual message details.
166166
* It also manages the state of the inbox, including loading state, selected message, and visible message impressions.
167167
*
168+
* @category React Components
169+
* @group React Components
170+
*
168171
* @example
169172
* ```tsx
170173
* const [visible, setVisible] = useState<boolean>(false);

tsdoc.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3+
"extends": ["typedoc/tsdoc.json"],
4+
"noStandardTags": false,
35
"tagDefinitions": [
46
{
57
"tagName": "@os",
68
"syntaxKind": "block"
79
},
8-
{
9-
"tagName": "@includeCode",
10-
"syntaxKind": "inline"
11-
},
1210
{
1311
"tagName": "@mermaid",
1412
"syntaxKind": "block"
15-
},
16-
{
17-
"tagName": "@license",
18-
"syntaxKind": "block"
19-
},
20-
{
21-
"tagName": "@since",
22-
"syntaxKind": "block"
2313
}
2414
]
2515
}

typedoc.config.mjs

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,65 @@
22
/** @type { import('typedoc').TypeDocOptionMap & import('typedoc-umlclass').Config } */
33
const config = {
44
entryPoints: ['./src/index.tsx'],
5-
projectDocuments: ['README.md', 'most-used-modules.md'],
5+
projectDocuments: ['README.md', 'most-used-modules.md', 'another-md.md'],
66
out: './docs-gen',
77
tsconfig: './tsconfig.json',
88
excludeInternal: true,
99
excludePrivate: true,
10-
excludeExternals: true,
10+
excludeExternals: false,
1111
excludePrivateClassFields: true,
1212
categorizeByGroup: true,
13+
excludeProtected: true,
1314
validation: {
15+
notExported: true,
1416
invalidLink: true,
17+
rewrittenLink: true,
1518
notDocumented: true,
16-
notExported: true,
1719
unusedMergeModuleWith: true,
1820
},
21+
entryPointStrategy: 'expand',
1922
includeVersion: true,
2023
searchInComments: true,
2124
searchInDocuments: true,
22-
favicon: './assets/favicon.ico',
2325
treatValidationWarningsAsErrors: true,
2426
useFirstParagraphOfCommentAsSummary: true,
27+
disableSources: false,
2528
cascadedModifierTags: ['@beta'],
26-
jsDocCompatibility: {
27-
inheritDocTag: true,
29+
theme: 'typedoc-github-theme',
30+
router: 'structure',
31+
customFooterHtml: '<p>Copyright <strong>Iterable</strong> 2025</p>',
32+
customFooterHtmlDisableWrapper: true,
33+
markdownLinkExternal: true,
34+
hideGenerator: true,
35+
// groupReferencesByType: true,
36+
sortEntryPoints: true,
37+
sidebarLinks: {
38+
Iterable: 'https://app.iterable.com/',
39+
Support:
40+
'https://support.iterable.com/hc/en-us/articles/360045714072-Overview-of-Iterable-s-React-Native-SDK',
41+
Installation:
42+
'https://support.iterable.com/hc/en-us/articles/360045714132-Installing-Iterable-s-React-Native-SDK',
2843
},
44+
headings: {
45+
readme: true,
46+
document: false,
47+
},
48+
groupOrder: [
49+
'Documents',
50+
'React Components',
51+
'Classes',
52+
'Enums',
53+
'Interfaces',
54+
'Types',
55+
'Functions',
56+
'Variables',
57+
'Constants',
58+
'*',
59+
],
60+
categoryOrder: ['Documents', 'React Components', '*'],
61+
// jsDocCompatibility: {
62+
// inheritDocTag: true,
63+
// },
2964
preservedTypeAnnotationTags: ['@fires', '@license'],
3065
// transformTags: true,
3166
requiredToBeDocumented: [
@@ -64,14 +99,26 @@ const config = {
6499
],
65100
navigation: {
66101
includeCategories: false,
67-
includeGroups: false,
102+
includeGroups: true,
68103
compactFolders: false,
69104
excludeReferences: false,
70-
includeFolders: false,
105+
includeFolders: true,
106+
},
107+
alwaysCreateEntryPointModule: false,
108+
navigationLinks: {
109+
Github: 'https://github.com/Iterable/react-native-sdk',
110+
Changelog:
111+
'https://github.com/Iterable/react-native-sdk/blob/master/CHANGELOG.md',
112+
},
113+
searchCategoryBoosts: {
114+
'React Components': 1.5,
115+
},
116+
searchGroupBoosts: {
117+
'React Components': 1.5,
71118
},
72119
visibilityFilters: {
73-
'protected': true,
74-
'private': true,
120+
'protected': false,
121+
'private': false,
75122
'inherited': true,
76123
'external': true,
77124
'@alpha': true,
@@ -111,14 +158,23 @@ const config = {
111158
// used by {@link react!Component}
112159
'react': {
113160
Component: 'https://react.dev/reference/react/Component',
161+
FunctionComponent:
162+
'https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/mdx/types.d.ts',
114163
},
115164
},
116165
readme: './README.md',
166+
customJs: './expand-nav.js',
117167
plugin: [
118168
'typedoc-plugin-coverage',
119169
'typedoc-plugin-mermaid',
120170
'typedoc-plugin-inline-sources',
121171
'typedoc-plugin-dt-links',
172+
// 'typedoc-plugin-localization',
173+
'typedoc-plugin-emojify',
174+
'@reside-ic/typedoc-plugin-copy-doc',
175+
'typedoc-github-theme',
176+
// 'typedoc-material-theme',
177+
// '@droppedcode/typedoc-plugin-relative-includes',
122178
],
123179
};
124180

0 commit comments

Comments
 (0)