docusaurus-plugin-typedoc 0.17.2 → 0.17.3

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2016 Thomas Grey
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Thomas Grey
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,300 +1,300 @@
1
- # docusaurus-plugin-typedoc
2
-
3
- A [Docusaurus v2](https://v2.docusaurus.io/) plugin to build documentation with [TypeDoc](https://github.com/TypeStrong/typedoc).
4
-
5
- [![npm](https://img.shields.io/npm/v/docusaurus-plugin-typedoc.svg)](https://www.npmjs.com/package/docusaurus-plugin-typedoc)
6
- ![CI](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml/badge.svg?branch=master)
7
-
8
- ## What it does?
9
-
10
- Generates static TypeDoc pages in Markdown with frontmatter as part of the Docusaurus build.
11
-
12
- ## Installation
13
-
14
- > Install [Docusaurus](https://v2.docusaurus.io/docs/installation) in the root of your project and install the plugin dependencies in the same location as the Docusaurus website directory.
15
-
16
- ```shell
17
- npm install typedoc typedoc-plugin-markdown docusaurus-plugin-typedoc --save-dev
18
- ```
19
-
20
- ## Usage
21
-
22
- ### Config
23
-
24
- Add the plugin to `docusaurus.config.js` and specify the required options (see [options](#options)).
25
-
26
- ```js
27
- module.exports = {
28
- plugins: [
29
- [
30
- 'docusaurus-plugin-typedoc',
31
-
32
- // Plugin / TypeDoc options
33
- {
34
- entryPoints: ['../src/index.ts'],
35
- tsconfig: '../tsconfig.json',
36
- },
37
- ],
38
- ],
39
- };
40
- ```
41
-
42
- TypeDoc will be bootstraped with the Docusaurus `start` and `build` [cli commands](https://v2.docusaurus.io/docs/cli):
43
-
44
- ```javascript
45
- "start": "docusaurus start",
46
- "build": "docusaurus build",
47
- ```
48
-
49
- Once built the docs will be available at `/docs/api` (or equivalent out directory).
50
-
51
- ### Directory structure
52
-
53
- ```
54
- ├── docusauruss-website
55
- ├── build/ (static site dir)
56
- ├── docs/
57
- │ ├── api/ (compiled typedoc markdown)
58
- ├── docusaurus.config.js
59
- ├── package.json
60
- ├── sidebars.js
61
- ├──package.json
62
- ├──src (typescript source files)
63
- ├──tsconfig.json
64
- ```
65
-
66
- ## Options
67
-
68
- ### TypeDoc options
69
-
70
- To configure TypeDoc, pass any relevant [TypeDoc options](https://typedoc.org/guides/options/) to the config.
71
-
72
- At a minimum the `entryPoints` and `tsconfig` options will need to be set.
73
-
74
- ```js
75
- entryPoints: ['../src/index.ts'],
76
- tsconfig: '../tsconfig.json'
77
- ```
78
-
79
- Additional TypeDoc plugins will need to be explicitly set:
80
-
81
- ```js
82
- plugin: ['typedoc-plugin-xyz'];
83
- ```
84
-
85
- #### Other config options
86
-
87
- TypeDoc options can also be declared:
88
-
89
- - Using a `typedoc.json` file.
90
- - Under the `typedocOptions` key in `tsconfig.json`.
91
-
92
- > Note: Options declared in this manner will take priority and overwrite options declared in `docusaurus.config.js`.
93
-
94
- ### Plugin options
95
-
96
- Options specific to the plugin should also be declared in the same object.
97
-
98
- | Name | Default | Description |
99
- | :---------------------- | :------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
- | `out` | `"api"` | Output dir relative to docs dir (use `.` for no subdir). |
101
- | `includeExtension` | `true` | Determines whether to preserve the `.md` extension in relative links. `true` is recommended as per [Docusaurus documentation](https://docusaurus.io/docs/docs-markdown-features#referencing-other-documents) |
102
- | `frontmatter` | `null` | Additional frontmatter options object. See [Frontmatter](#frontmatter). |
103
- | `sidebar.categoryLabel` | `API` | The sidebar parent category label. |
104
- | `sidebar.fullNames` | `false` | Display full names with module path. |
105
- | `sidebar.position` | `auto` | The position of the sidebar in the tree. |
106
-
107
- ### An example configuration
108
-
109
- ```js
110
- module.exports = {
111
- plugins: [
112
- [
113
- 'docusaurus-plugin-typedoc',
114
- {
115
- // TypeDoc options
116
- entryPoints: ['../src/index.ts'],
117
- tsconfig: '../tsconfig.json',
118
- plugin: ['typedoc-plugin-xyz'],
119
-
120
- // Plugin options
121
- out: 'api-xyz',
122
- sidebar: {
123
- categoryLabel: 'API XYZ',
124
- position: 0,
125
- fullNames: true,
126
- },
127
- },
128
- ],
129
- ],
130
- };
131
- ```
132
-
133
- ## Recipes
134
-
135
- ### Sidebar and Navbar
136
-
137
- #### Sidebar
138
-
139
- `sidebars.js` can be configured in following ways:
140
-
141
- 1. Generate the entire sidebar from file structure of your docs folder (default behaviour):
142
-
143
- ```js
144
- module.exports = {
145
- sidebar: [
146
- {
147
- type: 'autogenerated',
148
- dirName: '.', // '.' means the docs folder
149
- },
150
- ],
151
- };
152
- ```
153
-
154
- 2. Alternatively, if you wish to manually control other parts of your sidebar you can use a slice for the TypeDoc sidebar.
155
-
156
- > note: `sidebar.categoryLabel` and `sidebar.position` options are ignored with this implementation)
157
-
158
- ```js
159
- module.exports = {
160
- sidebar: {
161
- 'Category 1': ['doc1', 'doc2', 'doc3'],
162
- API: [
163
- {
164
- type: 'autogenerated',
165
- dirName: 'api', // 'api' is the 'out' directory
166
- },
167
- ],
168
- },
169
- };
170
- ```
171
-
172
- Please see https://docusaurus.io/docs/sidebar for sidebar documentation.
173
-
174
- #### Navbar
175
-
176
- A navbar item can be configured in `themeConfig` options in `docusaurus.config.js`:
177
-
178
- ```js
179
- themeConfig: {
180
- navbar: {
181
- items: [
182
- {
183
- to: 'docs/api/', // 'api' is the 'out' directory
184
- activeBasePath: 'docs',
185
- label: 'API',
186
- position: 'left',
187
- },
188
- ],
189
- },
190
- },
191
- ```
192
-
193
- Please see https://docusaurus.io/docs/api/themes/configuration#navbar-items for navbar documentation.
194
-
195
- ### Frontmatter
196
-
197
- By default the plugin will configure minimal required [Frontmatter](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter) configuration.
198
- Additionally required global Frontmatter options can be passed in using the `frontmatter` options object
199
-
200
- `docusaurus.config.js`:
201
-
202
- ```js
203
- plugins: [
204
- [
205
- 'docusaurus-plugin-typedoc',
206
- {
207
- // .... other plugin option
208
- frontmatter: {
209
- pagination_prev: null,
210
- pagination_next: null
211
- }
212
- ]
213
- ]
214
- ```
215
-
216
- ### Multi instance
217
-
218
- It is possible to build multi TypeDoc instances by passing in multiple configs with unique ids:
219
-
220
- `docusaurus.config.js`
221
-
222
- ```js
223
- module.exports = {
224
- plugins: [
225
- [
226
- 'docusaurus-plugin-typedoc',
227
- {
228
- id: 'api-1',
229
- entryPoints: ['../api-1/src/index.ts'],
230
- tsconfig: '../api-1/tsconfig.json',
231
- out: 'api-1',
232
- },
233
- ],
234
- [
235
- 'docusaurus-plugin-typedoc',
236
- {
237
- id: 'api-2',
238
- entryPoints: ['../api-2/src/index.ts'],
239
- tsconfig: '../api-2/tsconfig.json',
240
- out: 'api-2',
241
- },
242
- ],
243
- ],
244
- };
245
- ```
246
-
247
- ### Watch mode
248
-
249
- Watching files is supported by passing in the `watch: true` option see [https://typedoc.org/guides/options/#watch](https://typedoc.org/guides/options/#watch).
250
-
251
- Targetting the option in development mode only can be achieved using Node.js Environment Variables:
252
-
253
- `package.json`
254
-
255
- ```json
256
- "start": "TYPEDOC_WATCH=true docusaurus start",
257
- "build": "TYPEDOC_WATCH=false docusaurus build",
258
- ```
259
-
260
- `docusaurus.config.js`
261
-
262
- ```js
263
- module.exports = {
264
- plugins: [
265
- [
266
- 'docusaurus-plugin-typedoc',
267
- {
268
- entryPoints: ['../src/index.ts'],
269
- tsconfig: '../tsconfig.json',
270
- watch: process.env.TYPEDOC_WATCH,
271
- },
272
- ],
273
- ],
274
- };
275
- ```
276
-
277
- ### Monorepo setup
278
-
279
- `docusaurus.config.js`
280
-
281
- ```js
282
- module.exports = {
283
- plugins: [
284
- [
285
- 'docusaurus-plugin-typedoc',
286
- {
287
- entryPoints: ['../packages/package-a', '../packages/package-b'],
288
- entryPointStrategy: 'packages',
289
- sidebar: {
290
- fullNames: true,
291
- },
292
- },
293
- ],
294
- ],
295
- };
296
- ```
297
-
298
- ## License
299
-
300
- [MIT](https://github.com/tgreyuk/typedoc-plugin-markdown/blob/master/packages/docusaurus-plugin-typedoc/LICENSE)
1
+ # docusaurus-plugin-typedoc
2
+
3
+ A [Docusaurus v2](https://v2.docusaurus.io/) plugin to build documentation with [TypeDoc](https://github.com/TypeStrong/typedoc).
4
+
5
+ [![npm](https://img.shields.io/npm/v/docusaurus-plugin-typedoc.svg)](https://www.npmjs.com/package/docusaurus-plugin-typedoc)
6
+ ![CI](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml/badge.svg?branch=master)
7
+
8
+ ## What it does?
9
+
10
+ Generates static TypeDoc pages in Markdown with frontmatter as part of the Docusaurus build.
11
+
12
+ ## Installation
13
+
14
+ > Install [Docusaurus](https://v2.docusaurus.io/docs/installation) in the root of your project and install the plugin dependencies in the same location as the Docusaurus website directory.
15
+
16
+ ```shell
17
+ npm install typedoc typedoc-plugin-markdown docusaurus-plugin-typedoc --save-dev
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ### Config
23
+
24
+ Add the plugin to `docusaurus.config.js` and specify the required options (see [options](#options)).
25
+
26
+ ```js
27
+ module.exports = {
28
+ plugins: [
29
+ [
30
+ 'docusaurus-plugin-typedoc',
31
+
32
+ // Plugin / TypeDoc options
33
+ {
34
+ entryPoints: ['../src/index.ts'],
35
+ tsconfig: '../tsconfig.json',
36
+ },
37
+ ],
38
+ ],
39
+ };
40
+ ```
41
+
42
+ TypeDoc will be bootstraped with the Docusaurus `start` and `build` [cli commands](https://v2.docusaurus.io/docs/cli):
43
+
44
+ ```javascript
45
+ "start": "docusaurus start",
46
+ "build": "docusaurus build",
47
+ ```
48
+
49
+ Once built the docs will be available at `/docs/api` (or equivalent out directory).
50
+
51
+ ### Directory structure
52
+
53
+ ```
54
+ ├── docusauruss-website
55
+ ├── build/ (static site dir)
56
+ ├── docs/
57
+ │ ├── api/ (compiled typedoc markdown)
58
+ ├── docusaurus.config.js
59
+ ├── package.json
60
+ ├── sidebars.js
61
+ ├──package.json
62
+ ├──src (typescript source files)
63
+ ├──tsconfig.json
64
+ ```
65
+
66
+ ## Options
67
+
68
+ ### TypeDoc options
69
+
70
+ To configure TypeDoc, pass any relevant [TypeDoc options](https://typedoc.org/guides/options/) to the config.
71
+
72
+ At a minimum the `entryPoints` and `tsconfig` options will need to be set.
73
+
74
+ ```js
75
+ entryPoints: ['../src/index.ts'],
76
+ tsconfig: '../tsconfig.json'
77
+ ```
78
+
79
+ Additional TypeDoc plugins will need to be explicitly set:
80
+
81
+ ```js
82
+ plugin: ['typedoc-plugin-xyz'];
83
+ ```
84
+
85
+ #### Other config options
86
+
87
+ TypeDoc options can also be declared:
88
+
89
+ - Using a `typedoc.json` file.
90
+ - Under the `typedocOptions` key in `tsconfig.json`.
91
+
92
+ > Note: Options declared in this manner will take priority and overwrite options declared in `docusaurus.config.js`.
93
+
94
+ ### Plugin options
95
+
96
+ Options specific to the plugin should also be declared in the same object.
97
+
98
+ | Name | Default | Description |
99
+ | :---------------------- | :------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
+ | `out` | `"api"` | Output dir relative to docs dir (use `.` for no subdir). |
101
+ | `includeExtension` | `true` | Determines whether to preserve the `.md` extension in relative links. `true` is recommended as per [Docusaurus documentation](https://docusaurus.io/docs/docs-markdown-features#referencing-other-documents) |
102
+ | `frontmatter` | `null` | Additional frontmatter options object. See [Frontmatter](#frontmatter). |
103
+ | `sidebar.categoryLabel` | `API` | The sidebar parent category label. |
104
+ | `sidebar.fullNames` | `false` | Display full names with module path. |
105
+ | `sidebar.position` | `auto` | The position of the sidebar in the tree. |
106
+
107
+ ### An example configuration
108
+
109
+ ```js
110
+ module.exports = {
111
+ plugins: [
112
+ [
113
+ 'docusaurus-plugin-typedoc',
114
+ {
115
+ // TypeDoc options
116
+ entryPoints: ['../src/index.ts'],
117
+ tsconfig: '../tsconfig.json',
118
+ plugin: ['typedoc-plugin-xyz'],
119
+
120
+ // Plugin options
121
+ out: 'api-xyz',
122
+ sidebar: {
123
+ categoryLabel: 'API XYZ',
124
+ position: 0,
125
+ fullNames: true,
126
+ },
127
+ },
128
+ ],
129
+ ],
130
+ };
131
+ ```
132
+
133
+ ## Recipes
134
+
135
+ ### Sidebar and Navbar
136
+
137
+ #### Sidebar
138
+
139
+ `sidebars.js` can be configured in following ways:
140
+
141
+ 1. Generate the entire sidebar from file structure of your docs folder (default behaviour):
142
+
143
+ ```js
144
+ module.exports = {
145
+ sidebar: [
146
+ {
147
+ type: 'autogenerated',
148
+ dirName: '.', // '.' means the docs folder
149
+ },
150
+ ],
151
+ };
152
+ ```
153
+
154
+ 2. Alternatively, if you wish to manually control other parts of your sidebar you can use a slice for the TypeDoc sidebar.
155
+
156
+ > note: `sidebar.categoryLabel` and `sidebar.position` options are ignored with this implementation)
157
+
158
+ ```js
159
+ module.exports = {
160
+ sidebar: {
161
+ 'Category 1': ['doc1', 'doc2', 'doc3'],
162
+ API: [
163
+ {
164
+ type: 'autogenerated',
165
+ dirName: 'api', // 'api' is the 'out' directory
166
+ },
167
+ ],
168
+ },
169
+ };
170
+ ```
171
+
172
+ Please see https://docusaurus.io/docs/sidebar for sidebar documentation.
173
+
174
+ #### Navbar
175
+
176
+ A navbar item can be configured in `themeConfig` options in `docusaurus.config.js`:
177
+
178
+ ```js
179
+ themeConfig: {
180
+ navbar: {
181
+ items: [
182
+ {
183
+ to: 'docs/api/', // 'api' is the 'out' directory
184
+ activeBasePath: 'docs',
185
+ label: 'API',
186
+ position: 'left',
187
+ },
188
+ ],
189
+ },
190
+ },
191
+ ```
192
+
193
+ Please see https://docusaurus.io/docs/api/themes/configuration#navbar-items for navbar documentation.
194
+
195
+ ### Frontmatter
196
+
197
+ By default the plugin will configure minimal required [Frontmatter](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter) configuration.
198
+ Additionally required global Frontmatter options can be passed in using the `frontmatter` options object
199
+
200
+ `docusaurus.config.js`:
201
+
202
+ ```js
203
+ plugins: [
204
+ [
205
+ 'docusaurus-plugin-typedoc',
206
+ {
207
+ // .... other plugin option
208
+ frontmatter: {
209
+ pagination_prev: null,
210
+ pagination_next: null
211
+ }
212
+ ]
213
+ ]
214
+ ```
215
+
216
+ ### Multi instance
217
+
218
+ It is possible to build multi TypeDoc instances by passing in multiple configs with unique ids:
219
+
220
+ `docusaurus.config.js`
221
+
222
+ ```js
223
+ module.exports = {
224
+ plugins: [
225
+ [
226
+ 'docusaurus-plugin-typedoc',
227
+ {
228
+ id: 'api-1',
229
+ entryPoints: ['../api-1/src/index.ts'],
230
+ tsconfig: '../api-1/tsconfig.json',
231
+ out: 'api-1',
232
+ },
233
+ ],
234
+ [
235
+ 'docusaurus-plugin-typedoc',
236
+ {
237
+ id: 'api-2',
238
+ entryPoints: ['../api-2/src/index.ts'],
239
+ tsconfig: '../api-2/tsconfig.json',
240
+ out: 'api-2',
241
+ },
242
+ ],
243
+ ],
244
+ };
245
+ ```
246
+
247
+ ### Watch mode
248
+
249
+ Watching files is supported by passing in the `watch: true` option see [https://typedoc.org/guides/options/#watch](https://typedoc.org/guides/options/#watch).
250
+
251
+ Targetting the option in development mode only can be achieved using Node.js Environment Variables:
252
+
253
+ `package.json`
254
+
255
+ ```json
256
+ "start": "TYPEDOC_WATCH=true docusaurus start",
257
+ "build": "TYPEDOC_WATCH=false docusaurus build",
258
+ ```
259
+
260
+ `docusaurus.config.js`
261
+
262
+ ```js
263
+ module.exports = {
264
+ plugins: [
265
+ [
266
+ 'docusaurus-plugin-typedoc',
267
+ {
268
+ entryPoints: ['../src/index.ts'],
269
+ tsconfig: '../tsconfig.json',
270
+ watch: process.env.TYPEDOC_WATCH,
271
+ },
272
+ ],
273
+ ],
274
+ };
275
+ ```
276
+
277
+ ### Monorepo setup
278
+
279
+ `docusaurus.config.js`
280
+
281
+ ```js
282
+ module.exports = {
283
+ plugins: [
284
+ [
285
+ 'docusaurus-plugin-typedoc',
286
+ {
287
+ entryPoints: ['../packages/package-a', '../packages/package-b'],
288
+ entryPointStrategy: 'packages',
289
+ sidebar: {
290
+ fullNames: true,
291
+ },
292
+ },
293
+ ],
294
+ ],
295
+ };
296
+ ```
297
+
298
+ ## License
299
+
300
+ [MIT](https://github.com/tgreyuk/typedoc-plugin-markdown/blob/master/packages/docusaurus-plugin-typedoc/LICENSE)
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default } from './plugin';
1
+ export { default } from './plugin';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = void 0;
7
- var plugin_1 = require("./plugin");
8
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(plugin_1).default; } });
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var plugin_1 = require("./plugin");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(plugin_1).default; } });
package/dist/options.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { PluginOptions } from './types';
2
- export declare const getPluginOptions: (opts: Partial<PluginOptions>) => PluginOptions;
1
+ import { PluginOptions } from './types';
2
+ export declare const getPluginOptions: (opts: Partial<PluginOptions>) => PluginOptions;