docusaurus-plugin-typedoc 1.0.0-next.17 → 1.0.0-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/plugin.js +10 -7
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ Pretty format the sidebar JSON.
|
|
|
122
122
|
|
|
123
123
|
> Previous versions of this plugin recommended an `autogenerated` sidebar configuration. However we have decided it is more deterministic and configurable to use a manual sidebar configuration with a generated sidebar file.
|
|
124
124
|
|
|
125
|
-
A docusaurus sidebar file `typedoc-sidebar.
|
|
125
|
+
A docusaurus sidebar file `typedoc-sidebar.js` is published to the relevant output directory along with the generated markdown documentation.
|
|
126
126
|
|
|
127
127
|
This file should be referenced in `sidebars.js` using a sidebar slice and can be configured in following ways:
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ This file should be referenced in `sidebars.js` using a sidebar slice and can be
|
|
|
130
130
|
|
|
131
131
|
```js
|
|
132
132
|
module.exports = {
|
|
133
|
-
typedocSidebar: require('./docs/api/typedoc-sidebar.
|
|
133
|
+
typedocSidebar: require('./docs/api/typedoc-sidebar.js'),
|
|
134
134
|
};
|
|
135
135
|
```
|
|
136
136
|
|
|
@@ -139,7 +139,7 @@ module.exports = {
|
|
|
139
139
|
```js
|
|
140
140
|
module.exports = {
|
|
141
141
|
typedocSidebar: {
|
|
142
|
-
'Typedoc Docs': require('./docs/api/typedoc-sidebar.
|
|
142
|
+
'Typedoc Docs': require('./docs/api/typedoc-sidebar.js'),
|
|
143
143
|
},
|
|
144
144
|
};
|
|
145
145
|
```
|
|
@@ -158,7 +158,7 @@ module.exports = {
|
|
|
158
158
|
type: 'doc',
|
|
159
159
|
id: 'api/index',
|
|
160
160
|
},
|
|
161
|
-
items: require('./docs/api/typedoc-sidebar.
|
|
161
|
+
items: require('./docs/api/typedoc-sidebar.js'),
|
|
162
162
|
},
|
|
163
163
|
],
|
|
164
164
|
};
|
|
@@ -225,8 +225,8 @@ module.exports = {
|
|
|
225
225
|
```js
|
|
226
226
|
module.exports = {
|
|
227
227
|
typedocSidebar: {
|
|
228
|
-
'API 1': require('./docs/api-1/typedoc-sidebar.
|
|
229
|
-
'API 2': require('./docs/api-2/typedoc-sidebar.
|
|
228
|
+
'API 1': require('./docs/api-1/typedoc-sidebar.js'),
|
|
229
|
+
'API 2': require('./docs/api-2/typedoc-sidebar.js'),
|
|
230
230
|
},
|
|
231
231
|
};
|
|
232
232
|
```
|
package/dist/plugin.js
CHANGED
|
@@ -61,6 +61,7 @@ exports.default = pluginDocusaurus;
|
|
|
61
61
|
* Initiates a new typedoc Application bootstraped with plugin options
|
|
62
62
|
*/
|
|
63
63
|
async function generateTypedoc(context, opts) {
|
|
64
|
+
var _a, _b;
|
|
64
65
|
const { siteDir } = context;
|
|
65
66
|
const options = (0, options_1.getPluginOptions)(opts);
|
|
66
67
|
const { id, sidebar, ...optionsPassedToTypeDoc } = options;
|
|
@@ -69,18 +70,20 @@ async function generateTypedoc(context, opts) {
|
|
|
69
70
|
if (options.cleanOutputDir) {
|
|
70
71
|
removeDir(outputDir);
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
if (((_b = (_a = context.siteConfig) === null || _a === void 0 ? void 0 : _a.markdown) === null || _b === void 0 ? void 0 : _b.format) !== 'mdx') {
|
|
74
|
+
app.renderer.on(typedoc_1.PageEvent.END, (event) => {
|
|
75
|
+
var _a;
|
|
76
|
+
event.contents = (_a = event.contents) === null || _a === void 0 ? void 0 : _a.replace(/\\</g, '<');
|
|
77
|
+
});
|
|
78
|
+
}
|
|
76
79
|
if (sidebar === null || sidebar === void 0 ? void 0 : sidebar.autoConfiguration) {
|
|
77
80
|
app.renderer.postRenderAsyncJobs.push(async (output) => {
|
|
78
|
-
const sidebarPath = path.resolve(outputDir, 'typedoc-sidebar.
|
|
81
|
+
const sidebarPath = path.resolve(outputDir, 'typedoc-sidebar.js');
|
|
79
82
|
const baseDir = path
|
|
80
83
|
.relative(siteDir, outputDir)
|
|
81
|
-
.split(
|
|
84
|
+
.split(path.sep)
|
|
82
85
|
.slice(1)
|
|
83
|
-
.join(
|
|
86
|
+
.join(path.sep);
|
|
84
87
|
const sidebarJson = (0, sidebar_1.getSidebar)(output.navigation, baseDir, sidebar.filteredIds);
|
|
85
88
|
fs.writeFileSync(sidebarPath, `// @ts-check
|
|
86
89
|
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-typedoc",
|
|
3
|
-
"version": "1.0.0-next.
|
|
4
|
-
"description": "A Docusaurus
|
|
3
|
+
"version": "1.0.0-next.19",
|
|
4
|
+
"description": "A Docusaurus plugin to build API documentation with TypeDoc.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc",
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"typedoc-plugin-markdown": ">=4.0.0-next.
|
|
19
|
+
"typedoc-plugin-markdown": ">=4.0.0-next.24"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"lint": "eslint ./src --ext .ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"typescript",
|
|
35
35
|
"api"
|
|
36
36
|
],
|
|
37
|
-
"
|
|
38
|
-
"@docusaurus/types": "^
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@docusaurus/types": "^3.0.0"
|
|
39
39
|
}
|
|
40
40
|
}
|