Skip to content

Commit 7844eb9

Browse files
committed
feat(core): exposed new option "navigationJson"
1 parent 1cf3854 commit 7844eb9

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

.changeset/beige-deer-sleep.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'typedoc-plugin-markdown': patch
3+
---
4+
5+
- Exposed new option `navigationJson` that can be used to write navigation structure as JSON to disk.

docs/content/docs/options/utility.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ Use the `pretty` option flag to pretty-format the JSON output.
206206

207207
You can further configure the structure itself using the <OptionLink type="output" name="navigation" /> output option.
208208

209+
Note the path is resolved according to the config directory.
210+
209211
```json filename="typedoc.json"
210212
{
211213
"navigationJson": "./path/to/navigation.json"

packages/typedoc-plugin-markdown/src/options/declarations.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ export const navigationModel: Partial<DeclarationOption> = {
840840
*
841841
* You can further configure the structure itself using the <OptionLink type="output" name="navigation" /> output option.
842842
*
843+
* Note the path is resolved according to the config directory.
844+
*
843845
* @example "./path/to/navigation.json"
844846
*
845847
* @category Utility

packages/typedoc-plugin-markdown/test/fixtures/configs/navigation.cjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const commonOptions = {
88
'../src/navigation/module-2/index.ts',
99
'../src/navigation/module-3/index.ts',
1010
],
11-
plugin: ['../../../dist/index.js', '../custom-plugins/navigation-plugin.mjs'],
11+
plugin: ['../../../dist/index.js'],
1212
hidePageHeader: true,
1313
readme: 'none',
1414
};
@@ -40,13 +40,17 @@ module.exports = {
4040
name: 'markdown',
4141
path: '../out/md/navigation/members/opts-1',
4242
options: {
43+
navigationJson:
44+
'./test/fixtures/out/md/navigation/members/opts-1/sidebar.json',
4345
...opts1,
4446
},
4547
},
4648
{
4749
name: 'markdown',
4850
path: '../out/md/navigation/members/opts-2',
4951
options: {
52+
navigationJson:
53+
'./test/fixtures/out/md/navigation/members/opts-2/sidebar.json',
5054
...opts2,
5155
},
5256
},
@@ -55,6 +59,9 @@ module.exports = {
5559
path: '../out/md/navigation/modules/opts-1',
5660
options: {
5761
router: 'module',
62+
navigationJson:
63+
'./test/fixtures/out/md/navigation/modules/opts-1/sidebar.json',
64+
5865
...opts1,
5966
},
6067
},
@@ -63,6 +70,8 @@ module.exports = {
6370
path: '../out/md/navigation/modules/opts-2',
6471
options: {
6572
router: 'module',
73+
navigationJson:
74+
'./test/fixtures/out/md/navigation/modules/opts-2/sidebar.json',
6675
...opts2,
6776
},
6877
},

packages/typedoc-plugin-markdown/test/scripts/build-fixtures.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function main() {
2525
path.join(__dirname, '..', 'fixtures', 'configs'),
2626
);
2727

28-
const devConfigs = ['customize.cjs'];
28+
const devConfigs = ['reflections.cjs'];
2929

3030
const typedocConfigs = isDev ? devConfigs : allConfigs;
3131

0 commit comments

Comments
 (0)