@apify/docusaurus-plugin-typedoc-api 3.0.0
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 +21 -0
- package/README.md +290 -0
- package/assets/styles-8ad572ec.css +303 -0
- package/lib/components/AnchorLink.js +22 -0
- package/lib/components/AnchorLink.js.map +1 -0
- package/lib/components/ApiChangelog.js +28 -0
- package/lib/components/ApiChangelog.js.map +1 -0
- package/lib/components/ApiDataContext.js +16 -0
- package/lib/components/ApiDataContext.js.map +1 -0
- package/lib/components/ApiIndex.js +80 -0
- package/lib/components/ApiIndex.js.map +1 -0
- package/lib/components/ApiItem.js +86 -0
- package/lib/components/ApiItem.js.map +1 -0
- package/lib/components/ApiItemLayout.js +69 -0
- package/lib/components/ApiItemLayout.js.map +1 -0
- package/lib/components/ApiPage.js +69 -0
- package/lib/components/ApiPage.js.map +1 -0
- package/lib/components/Breadcrumb.js +38 -0
- package/lib/components/Breadcrumb.js.map +1 -0
- package/lib/components/Comment.js +56 -0
- package/lib/components/Comment.js.map +1 -0
- package/lib/components/CommentBadges.js +35 -0
- package/lib/components/CommentBadges.js.map +1 -0
- package/lib/components/DefaultValue.js +49 -0
- package/lib/components/DefaultValue.js.map +1 -0
- package/lib/components/Flags.js +27 -0
- package/lib/components/Flags.js.map +1 -0
- package/lib/components/Footer.js +18 -0
- package/lib/components/Footer.js.map +1 -0
- package/lib/components/Hierarchy.js +27 -0
- package/lib/components/Hierarchy.js.map +1 -0
- package/lib/components/Icon.js +27 -0
- package/lib/components/Icon.js.map +1 -0
- package/lib/components/Index.js +87 -0
- package/lib/components/Index.js.map +1 -0
- package/lib/components/Markdown.js +204 -0
- package/lib/components/Markdown.js.map +1 -0
- package/lib/components/Member.js +68 -0
- package/lib/components/Member.js.map +1 -0
- package/lib/components/MemberDeclaration.js +64 -0
- package/lib/components/MemberDeclaration.js.map +1 -0
- package/lib/components/MemberGetterSetter.js +61 -0
- package/lib/components/MemberGetterSetter.js.map +1 -0
- package/lib/components/MemberReference.js +38 -0
- package/lib/components/MemberReference.js.map +1 -0
- package/lib/components/MemberSignatureBody.js +91 -0
- package/lib/components/MemberSignatureBody.js.map +1 -0
- package/lib/components/MemberSignatureTitle.js +52 -0
- package/lib/components/MemberSignatureTitle.js.map +1 -0
- package/lib/components/MemberSignatures.js +61 -0
- package/lib/components/MemberSignatures.js.map +1 -0
- package/lib/components/MemberSources.js +33 -0
- package/lib/components/MemberSources.js.map +1 -0
- package/lib/components/Members.js +51 -0
- package/lib/components/Members.js.map +1 -0
- package/lib/components/MembersGroup.js +39 -0
- package/lib/components/MembersGroup.js.map +1 -0
- package/lib/components/Parameter.js +145 -0
- package/lib/components/Parameter.js.map +1 -0
- package/lib/components/Reflection.js +112 -0
- package/lib/components/Reflection.js.map +1 -0
- package/lib/components/SourceLink.js +37 -0
- package/lib/components/SourceLink.js.map +1 -0
- package/lib/components/Type.js +341 -0
- package/lib/components/Type.js.map +1 -0
- package/lib/components/TypeAndParent.js +27 -0
- package/lib/components/TypeAndParent.js.map +1 -0
- package/lib/components/TypeParameters.js +36 -0
- package/lib/components/TypeParameters.js.map +1 -0
- package/lib/components/TypeParametersGeneric.js +27 -0
- package/lib/components/TypeParametersGeneric.js.map +1 -0
- package/lib/components/VersionBanner.js +39 -0
- package/lib/components/VersionBanner.js.map +1 -0
- package/lib/hooks/useBreadcrumbs.js +9 -0
- package/lib/hooks/useBreadcrumbs.js.map +1 -0
- package/lib/hooks/useGitRefName.js +9 -0
- package/lib/hooks/useGitRefName.js.map +1 -0
- package/lib/hooks/useMinimalLayout.js +9 -0
- package/lib/hooks/useMinimalLayout.js.map +1 -0
- package/lib/hooks/useReflection.js +19 -0
- package/lib/hooks/useReflection.js.map +1 -0
- package/lib/hooks/useReflectionMap.js +9 -0
- package/lib/hooks/useReflectionMap.js.map +1 -0
- package/lib/index.js +320 -0
- package/lib/index.js.map +1 -0
- package/lib/markdownLoader.js +11 -0
- package/lib/markdownLoader.js.map +1 -0
- package/lib/plugin/data.js +332 -0
- package/lib/plugin/data.js.map +1 -0
- package/lib/plugin/sidebar.js +105 -0
- package/lib/plugin/sidebar.js.map +1 -0
- package/lib/plugin/structure/0.23.js +48 -0
- package/lib/plugin/structure/0.23.js.map +1 -0
- package/lib/plugin/url.js +49 -0
- package/lib/plugin/url.js.map +1 -0
- package/lib/plugin/version.js +83 -0
- package/lib/plugin/version.js.map +1 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/hierarchy.js +35 -0
- package/lib/utils/hierarchy.js.map +1 -0
- package/lib/utils/icons.js +124 -0
- package/lib/utils/icons.js.map +1 -0
- package/lib/utils/links.js +10 -0
- package/lib/utils/links.js.map +1 -0
- package/lib/utils/markdown.js +69 -0
- package/lib/utils/markdown.js.map +1 -0
- package/lib/utils/visibility.js +25 -0
- package/lib/utils/visibility.js.map +1 -0
- package/package.json +57 -0
- package/src/components/AnchorLink.tsx +14 -0
- package/src/components/ApiChangelog.tsx +26 -0
- package/src/components/ApiDataContext.ts +17 -0
- package/src/components/ApiIndex.tsx +109 -0
- package/src/components/ApiItem.tsx +110 -0
- package/src/components/ApiItemLayout.tsx +96 -0
- package/src/components/ApiPage.tsx +78 -0
- package/src/components/Breadcrumb.tsx +41 -0
- package/src/components/Comment.tsx +74 -0
- package/src/components/CommentBadges.tsx +40 -0
- package/src/components/DefaultValue.tsx +48 -0
- package/src/components/Flags.tsx +29 -0
- package/src/components/Footer.tsx +13 -0
- package/src/components/Hierarchy.tsx +27 -0
- package/src/components/Icon.tsx +20 -0
- package/src/components/Index.tsx +109 -0
- package/src/components/Markdown.tsx +241 -0
- package/src/components/Member.tsx +64 -0
- package/src/components/MemberDeclaration.tsx +67 -0
- package/src/components/MemberGetterSetter.tsx +69 -0
- package/src/components/MemberReference.tsx +43 -0
- package/src/components/MemberSignatureBody.tsx +121 -0
- package/src/components/MemberSignatureTitle.tsx +65 -0
- package/src/components/MemberSignatures.tsx +64 -0
- package/src/components/MemberSources.tsx +42 -0
- package/src/components/Members.tsx +62 -0
- package/src/components/MembersGroup.tsx +47 -0
- package/src/components/Parameter.tsx +165 -0
- package/src/components/README.md +9 -0
- package/src/components/Reflection.tsx +136 -0
- package/src/components/SourceLink.tsx +46 -0
- package/src/components/Type.tsx +377 -0
- package/src/components/TypeAndParent.tsx +26 -0
- package/src/components/TypeParameters.tsx +37 -0
- package/src/components/TypeParametersGeneric.tsx +25 -0
- package/src/components/VersionBanner.tsx +44 -0
- package/src/components/styles.css +303 -0
- package/src/hooks/useBreadcrumbs.ts +6 -0
- package/src/hooks/useGitRefName.ts +6 -0
- package/src/hooks/useMinimalLayout.ts +6 -0
- package/src/hooks/useReflection.ts +18 -0
- package/src/hooks/useReflectionMap.ts +7 -0
- package/src/index.ts +420 -0
- package/src/markdownLoader.ts +10 -0
- package/src/plugin/data.ts +389 -0
- package/src/plugin/sidebar.ts +139 -0
- package/src/plugin/structure/0.23.ts +58 -0
- package/src/plugin/url.ts +49 -0
- package/src/plugin/version.ts +118 -0
- package/src/types.ts +165 -0
- package/src/utils/hierarchy.ts +46 -0
- package/src/utils/icons.ts +103 -0
- package/src/utils/links.ts +10 -0
- package/src/utils/markdown.ts +82 -0
- package/src/utils/visibility.ts +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Miles Johnson
|
|
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
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# docusaurus-plugin-typedoc-api
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/milesj/docusaurus-plugin-typedoc-api)
|
|
4
|
+
[](https://www.npmjs.com/package/docusaurus-plugin-typedoc-api)
|
|
5
|
+
[](https://www.npmjs.com/package/docusaurus-plugin-typedoc-api)
|
|
6
|
+
|
|
7
|
+
A Docusaurus plugin for generating source code `/api/*` routes, powered by
|
|
8
|
+
[TypeDoc](https://typedoc.org/).
|
|
9
|
+
|
|
10
|
+
The plugin has been designed to document your public API by default (anything exported from a
|
|
11
|
+
package's entry point), so any private, protected, or internal code will not be generated.
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- `typescript` >= v4
|
|
16
|
+
- `@docusaurus/core` >= v2.0.0-beta.18
|
|
17
|
+
- `@docusaurus/preset-classic` >= v2.0.0-beta.18
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
- [Boost](https://github.com/milesj/boost) - https://boostlib.dev/api
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
yarn add --dev docusaurus-plugin-typedoc-api
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Open your `docusaurus.config.js` and make the following changes:
|
|
30
|
+
|
|
31
|
+
- Add a link to the API route under `themeConfig.navbar.items` and `themeConfig.footer.links` (if
|
|
32
|
+
desired).
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
module.exports = {
|
|
36
|
+
// ...
|
|
37
|
+
themeConfig: {
|
|
38
|
+
// ...
|
|
39
|
+
navbar: {
|
|
40
|
+
// ...
|
|
41
|
+
items: [
|
|
42
|
+
// ...
|
|
43
|
+
{
|
|
44
|
+
to: 'api',
|
|
45
|
+
label: 'API',
|
|
46
|
+
position: 'left',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Configure the plugin in your `plugins` list. The `projectRoot` and `packages` options are
|
|
55
|
+
required.
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
module.exports = {
|
|
59
|
+
// ...
|
|
60
|
+
plugins: [
|
|
61
|
+
[
|
|
62
|
+
'docusaurus-plugin-typedoc-api',
|
|
63
|
+
{
|
|
64
|
+
projectRoot: path.join(__dirname, '..'),
|
|
65
|
+
// Monorepo
|
|
66
|
+
packages: ['packages/example', 'packages/other'],
|
|
67
|
+
// Polyrepo
|
|
68
|
+
packages: ['.'],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Configuration
|
|
76
|
+
|
|
77
|
+
The following options are available to the plugin:
|
|
78
|
+
|
|
79
|
+
- `projectRoot` (`string`) - Absolute path to the project root where `tsconfig.json` is located.
|
|
80
|
+
_(Required)_
|
|
81
|
+
- `packages` (`(string | PackageConfig)[]`) - List of packages relative to the project root.
|
|
82
|
+
_(Required)_
|
|
83
|
+
- `banner` (`string`) - Banner message to display at the top of the index page. Supports HTML.
|
|
84
|
+
- `changelogName` (`string`) - Name of the changelog file within a package. Defaults to
|
|
85
|
+
`CHANGELOG.md`.
|
|
86
|
+
- `changelogs` (`boolean`) - Include and render the changelog file from every package. Defaults to
|
|
87
|
+
`false`.
|
|
88
|
+
- `exclude` (`string[]`) - List of glob patterns to exclude unwanted packages. This is necessary
|
|
89
|
+
when using TypeScript project references.
|
|
90
|
+
- `gitRefName` (`string`) - GitHub repository ref name to point the API links to. Defaults to
|
|
91
|
+
`master`.
|
|
92
|
+
- `minimal` (`boolean`) - Render a minimal layout and reduce the amount of information displayed.
|
|
93
|
+
Defaults to `false`.
|
|
94
|
+
- `packageJsonName` (`string`) - Name of the `package.json file`. Defaults to `package.json`.
|
|
95
|
+
- `readmeName` (`string`) - Name of the readme file within a package. Defaults to `README.md`.
|
|
96
|
+
- `readmes` (`boolean`) - Include and render the readme file from every package. Defaults to
|
|
97
|
+
`false`.
|
|
98
|
+
- `removeScopes` (`string[]`) - Package scopes and prefixes to remove when displaying the package
|
|
99
|
+
name in the sidebar and index. For example, `boost` will remove `@boost/` and `boost-`.
|
|
100
|
+
- `sortPackages` (`(a, d) => number`) - Function to sort the package list in the sidebar and on the
|
|
101
|
+
index page. Defaults to alphabetical.
|
|
102
|
+
- `sortSidebar` (`(a, d) => number`) - Function to sort the categories and items within each
|
|
103
|
+
sidebar, excluding "Overview" and "Changelog". Defaults to alphabetical.
|
|
104
|
+
- `tsconfigName` (`string`) - Name of the TypeScript config file in the project root. Defaults to
|
|
105
|
+
`tsconfig.json`.
|
|
106
|
+
- `typedocOptions` (`object`) - [TypeDoc options](https://typedoc.org/guides/options/#input-options)
|
|
107
|
+
to pass to the compiler. Only supports a small subset of options, primarily around visibility
|
|
108
|
+
exclusion.
|
|
109
|
+
|
|
110
|
+
### Packages
|
|
111
|
+
|
|
112
|
+
The `packages` option has been designed to support multiple packages, with multiple entry points per
|
|
113
|
+
package. By default the option accepts a list of strings, where each value is a relative path to a
|
|
114
|
+
package folder, and a default entry point of `src/index.ts`.
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
module.exports = {
|
|
118
|
+
packages: ['packages/core', 'packages/react'],
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
However, an object can be provided to customize the entry point. All entry point file paths are
|
|
123
|
+
relative to the package folder, and support 2 formats:
|
|
124
|
+
|
|
125
|
+
- **Index imports** - Consumers can only import from the package index. This is typically an entry
|
|
126
|
+
point like `src/index.ts`.
|
|
127
|
+
- **Deep imports** - Consumers can import anything from the package using its file path. Glob the
|
|
128
|
+
entire package by only passing the folder name like `src/`. _(This is useful for component
|
|
129
|
+
libraries)_
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
module.exports = {
|
|
133
|
+
packages: [
|
|
134
|
+
'packages/core',
|
|
135
|
+
{
|
|
136
|
+
path: 'packages/react',
|
|
137
|
+
// Index only imports allowed
|
|
138
|
+
// import {} from 'package'
|
|
139
|
+
entry: 'src/index.tsx',
|
|
140
|
+
// Deep imports allowed
|
|
141
|
+
// import {} from 'package/some/nested/file'
|
|
142
|
+
entry: 'src/',
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
When _not_ using deep imports, multiple entry points can be defined by passing a map of objects to
|
|
149
|
+
`entry`, where each key is a sub-path that can be imported from the package (excluding the `index`).
|
|
150
|
+
Each entry object requires a `path` and a `label`, which is used for categorizing and sidebars.
|
|
151
|
+
|
|
152
|
+
```js
|
|
153
|
+
module.exports = {
|
|
154
|
+
packages: [
|
|
155
|
+
'packages/core',
|
|
156
|
+
{
|
|
157
|
+
path: 'packages/react',
|
|
158
|
+
entry: {
|
|
159
|
+
// import {} from 'package'
|
|
160
|
+
index: 'src/index.tsx',
|
|
161
|
+
// import {} from 'package/client'
|
|
162
|
+
client: { file: 'src/client.tsx', label: 'Client' },
|
|
163
|
+
// import {} from 'package/server'
|
|
164
|
+
server: { file: 'src/server.tsx', label: 'Server' },
|
|
165
|
+
// import {} from 'package/server/test'
|
|
166
|
+
'server/test': { file: 'src/server/test-utils.tsx', label: 'Server test utils' },
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
> Index entry points don't require a label, so a file path can be passed directly.
|
|
174
|
+
|
|
175
|
+
## Linking
|
|
176
|
+
|
|
177
|
+
This plugin supports API and documentation linking within source code docblocks via the `@apilink`
|
|
178
|
+
and `@doclink` tokens respectively. This works in a similar fashion to
|
|
179
|
+
[TypeDoc's `@link` resolution](https://typedoc.org/guides/link-resolution/), but also supports
|
|
180
|
+
Docusaurus versioning and routing patterns.
|
|
181
|
+
|
|
182
|
+
### `@apilink`
|
|
183
|
+
|
|
184
|
+
When linking to other APIs, you must reference them by class name, function name, property, etc,
|
|
185
|
+
_instead of_ the actual `/api` route.
|
|
186
|
+
|
|
187
|
+
```sh
|
|
188
|
+
# Maps to /api/<package>/class/Registry#register
|
|
189
|
+
{@apilink Registry.register}
|
|
190
|
+
{@apilink Registry.register | Text to use as the label}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### `@doclink`
|
|
194
|
+
|
|
195
|
+
When linking to documentation pages, you must reference the article by its URL identifier without
|
|
196
|
+
the `/docs` prefix.
|
|
197
|
+
|
|
198
|
+
```sh
|
|
199
|
+
# Maps to /docs/commands/setup
|
|
200
|
+
{@doclink commands/setup}
|
|
201
|
+
{@doclink commands/setup | Text to use as the label}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Versioning
|
|
205
|
+
|
|
206
|
+
This plugin supports API versioning by piggy-backing off the built-in
|
|
207
|
+
[docs versioning implementation](https://docusaurus.io/docs/versioning), which is a _requirement_
|
|
208
|
+
for this to work correctly.
|
|
209
|
+
|
|
210
|
+
To begin, version your docs with the built-in command:
|
|
211
|
+
|
|
212
|
+
```shell
|
|
213
|
+
yarn docusaurus docs:version 1.2.3
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Once the markdown files are generated, run our versioning command _with the same version used
|
|
217
|
+
previously_:
|
|
218
|
+
|
|
219
|
+
```shell
|
|
220
|
+
yarn docusaurus api:version 1.2.3
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
This will create multiple JSON files in the `versioned_docs/version-1.2.3` directory. Be sure to
|
|
224
|
+
commit these files to your repo.
|
|
225
|
+
|
|
226
|
+
> When versioning, the current state of your branch will be used as that version's API. To
|
|
227
|
+
> update/regenerate old versions, you'll need to checkout an old commit, re-version, and copy the
|
|
228
|
+
> generated files to the latest branch.
|
|
229
|
+
|
|
230
|
+
### Navigation
|
|
231
|
+
|
|
232
|
+
Our API is unable to use the
|
|
233
|
+
[`docsVersionDropdown`](https://docusaurus.io/docs/api/themes/configuration#navbar-docs-version-dropdown)
|
|
234
|
+
navigation type, as it's hardcoded in Docusaurus core. However, you can create a custom version
|
|
235
|
+
dropdown like so:
|
|
236
|
+
|
|
237
|
+
```js
|
|
238
|
+
const versions = require('./versions.json');
|
|
239
|
+
|
|
240
|
+
module.exports = {
|
|
241
|
+
// ...
|
|
242
|
+
themeConfig: {
|
|
243
|
+
// ...
|
|
244
|
+
navbar: {
|
|
245
|
+
// ...
|
|
246
|
+
items: [
|
|
247
|
+
// ...
|
|
248
|
+
{
|
|
249
|
+
type: 'dropdown',
|
|
250
|
+
to: 'api',
|
|
251
|
+
label: 'API',
|
|
252
|
+
position: 'left',
|
|
253
|
+
items: [
|
|
254
|
+
{ label: 'Next', to: 'api/next' },
|
|
255
|
+
...versions.map((version, i) => ({
|
|
256
|
+
label: version,
|
|
257
|
+
to: i === 0 ? 'api' : `api/${version}`,
|
|
258
|
+
})),
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
> This workaround isn't perfect and may be buggy. Use at your own risk!
|
|
268
|
+
|
|
269
|
+
### Caveats
|
|
270
|
+
|
|
271
|
+
- Each version in `versioned_docs` (or `versions.json`) _must_ contain the generated API JSON files,
|
|
272
|
+
otherwise the build will fail.
|
|
273
|
+
- The header/footer API links are _not_ version aware, as their values are static.
|
|
274
|
+
- We suggest only versioning major versions, as the size of these JSON files and the webpack build
|
|
275
|
+
will get very large very fast.
|
|
276
|
+
|
|
277
|
+
## Comparison
|
|
278
|
+
|
|
279
|
+
There's another plugin called
|
|
280
|
+
[docusaurus-plugin-typedoc](https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc),
|
|
281
|
+
that offers a similar solution. However, there are many differences between that package and this
|
|
282
|
+
one, with the biggest being that theirs generates markdown files and `/docs/api/...` styled routes,
|
|
283
|
+
while ours renders custom React pages with `/api/...` styled routes. Some other differences are:
|
|
284
|
+
|
|
285
|
+
- An index of all packages.
|
|
286
|
+
- Readme inclusion and rendering.
|
|
287
|
+
- Custom styles, sections, and headings.
|
|
288
|
+
- Multiple function and method signatures.
|
|
289
|
+
- [Versioning](#versioning)!
|
|
290
|
+
- And probably more....
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--tsd-muted-text: var(--ifm-color-secondary-darkest);
|
|
3
|
+
--tsd-font-small: var(--ifm-h6-font-size);
|
|
4
|
+
--tsd-spacing-vertical: 0.75rem;
|
|
5
|
+
--tsd-spacing-vertical-full: 2rem;
|
|
6
|
+
--tsd-spacing-horizontal: 1rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tsd-panel {
|
|
10
|
+
border: 1px solid var(--ifm-card-background-color);
|
|
11
|
+
border-radius: var(--ifm-global-radius);
|
|
12
|
+
margin-bottom: var(--ifm-spacing-vertical);
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.tsd-panel > .tsd-panel {
|
|
17
|
+
margin: var(--tsd-spacing-horizontal);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tsd-panel-header {
|
|
21
|
+
background-color: var(--ifm-card-background-color);
|
|
22
|
+
padding: var(--tsd-spacing-vertical) var(--tsd-spacing-horizontal);
|
|
23
|
+
margin: 0;
|
|
24
|
+
position: relative;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tsd-panel-content {
|
|
28
|
+
margin: 0;
|
|
29
|
+
padding: var(--tsd-spacing-vertical) var(--tsd-spacing-horizontal);
|
|
30
|
+
border-bottom: 1px solid var(--ifm-card-background-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tsd-panel-content:empty {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.tsd-panel-content:last-child {
|
|
38
|
+
border-bottom: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.tsd-panel-content > *:first-child {
|
|
42
|
+
margin-top: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tsd-panel-group,
|
|
46
|
+
.tsd-footer {
|
|
47
|
+
margin-top: var(--tsd-spacing-vertical-full);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tsd-panel-header .tsd-anchor {
|
|
51
|
+
margin-left: 0.5rem;
|
|
52
|
+
float: right;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tsd-panel-header .tsd-anchor-id {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: -4.5rem;
|
|
58
|
+
right: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.tsd-divider {
|
|
62
|
+
margin: var(--tsd-spacing-vertical) -1rem;
|
|
63
|
+
border: 1px solid var(--ifm-card-background-color);
|
|
64
|
+
border-bottom: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.tsd-header-flags {
|
|
68
|
+
float: right;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.tsd-header-member-fullname {
|
|
72
|
+
display: inline-block;
|
|
73
|
+
margin-top: -1rem;
|
|
74
|
+
margin-bottom: 1.5rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.tsd-footer {
|
|
78
|
+
text-align: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
html[data-theme='light'] .tsd-panel-header {
|
|
82
|
+
background-color: var(--ifm-hover-overlay);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
html[data-theme='light'] .tsd-panel,
|
|
86
|
+
html[data-theme='light'] .tsd-panel-content {
|
|
87
|
+
border-color: var(--ifm-hover-overlay);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* LISTS */
|
|
91
|
+
|
|
92
|
+
.tsd-hierarchy,
|
|
93
|
+
.tsd-type-parameters {
|
|
94
|
+
list-style: square;
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.tsd-index-list,
|
|
99
|
+
.tsd-signatures,
|
|
100
|
+
.tsd-descriptions,
|
|
101
|
+
.tsd-sources ul,
|
|
102
|
+
.tsd-sources p {
|
|
103
|
+
margin: 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
list-style: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.tsd-index-list {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-wrap: wrap;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.tsd-index-list li {
|
|
114
|
+
width: 100%;
|
|
115
|
+
padding-right: 1rem;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media screen and (min-width: 576px) {
|
|
119
|
+
.tsd-index-list li {
|
|
120
|
+
width: 50%;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media screen and (min-width: 997px) {
|
|
125
|
+
.tsd-index-list li {
|
|
126
|
+
width: 33%;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* SPACING */
|
|
131
|
+
|
|
132
|
+
.tsd-parameters h5,
|
|
133
|
+
.tsd-type-parameters-title,
|
|
134
|
+
.tsd-parameters-title,
|
|
135
|
+
.tsd-returns-title {
|
|
136
|
+
margin: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.tsd-comment,
|
|
140
|
+
.tsd-comment > .markdown,
|
|
141
|
+
.tsd-sources,
|
|
142
|
+
.tsd-descriptions,
|
|
143
|
+
.tsd-type-declaration,
|
|
144
|
+
.tsd-type-parameters,
|
|
145
|
+
.tsd-parameters {
|
|
146
|
+
margin-top: var(--tsd-spacing-vertical);
|
|
147
|
+
margin-bottom: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.tsd-comment-root {
|
|
151
|
+
margin-top: 0;
|
|
152
|
+
margin-bottom: var(--tsd-spacing-vertical-full);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* SOURCES */
|
|
156
|
+
|
|
157
|
+
.tsd-sources,
|
|
158
|
+
.tsd-footer {
|
|
159
|
+
color: var(--tsd-muted-text);
|
|
160
|
+
font-size: var(--tsd-font-small);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.tsd-sources ul,
|
|
164
|
+
.tsd-sources p {
|
|
165
|
+
margin: 0;
|
|
166
|
+
padding: 0;
|
|
167
|
+
list-style: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.tsd-footer a,
|
|
171
|
+
.tsd-sources a {
|
|
172
|
+
color: var(--tsd-muted-text);
|
|
173
|
+
text-decoration: underline;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.tsd-footer a:hover,
|
|
177
|
+
.tsd-sources a:hover {
|
|
178
|
+
color: var(--ifm-link-color);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* SIGNATURES */
|
|
182
|
+
|
|
183
|
+
.tsd-description > *,
|
|
184
|
+
.tsd-parameters {
|
|
185
|
+
margin-top: var(--tsd-spacing-vertical);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.tsd-description > *:first-child {
|
|
189
|
+
margin-top: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.tsd-signature-inactive {
|
|
193
|
+
opacity: 0.35;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.tsd-signature-default-value {
|
|
197
|
+
margin-left: 0.2rem;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* FLAGS */
|
|
201
|
+
|
|
202
|
+
.tsd-flag-group:first-child {
|
|
203
|
+
margin-right: 0.5rem;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.tsd-flag-group:last-child {
|
|
207
|
+
margin-left: 0.5rem;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.tsd-flag {
|
|
211
|
+
display: inline-block;
|
|
212
|
+
padding: 3px 6px;
|
|
213
|
+
border-radius: var(--ifm-global-radius);
|
|
214
|
+
color: var(--ifm-footer-title-color);
|
|
215
|
+
background-color: var(--ifm-footer-background-color);
|
|
216
|
+
text-indent: 0;
|
|
217
|
+
font-size: var(--tsd-font-small);
|
|
218
|
+
font-weight: normal;
|
|
219
|
+
margin-top: -1px;
|
|
220
|
+
opacity: 0.65;
|
|
221
|
+
vertical-align: middle;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.tsd-flag:not(:first-child) {
|
|
225
|
+
margin-left: 0.25rem;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* MODIFIERS */
|
|
229
|
+
|
|
230
|
+
.badge-group {
|
|
231
|
+
font-size: var(--tsd-font-small);
|
|
232
|
+
vertical-align: middle;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.tsd-panel-header .badge-group {
|
|
236
|
+
display: inline-block;
|
|
237
|
+
margin-left: 0.25em;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.badge-group > span {
|
|
241
|
+
margin-right: 0.25rem;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* SYNTAX */
|
|
245
|
+
|
|
246
|
+
.tsd-generics {
|
|
247
|
+
font-weight: normal;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.tsd-signature-symbol,
|
|
251
|
+
.tsd-signature-type-generic {
|
|
252
|
+
color: var(--tsd-muted-text);
|
|
253
|
+
font-weight: normal;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.tsd-signature-type {
|
|
257
|
+
font-style: italic;
|
|
258
|
+
font-weight: normal;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.tsd-pressable {
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.tsd-kind-icon .codicon {
|
|
266
|
+
margin-right: 0.5rem;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.codicon[class*='codicon-'] {
|
|
270
|
+
vertical-align: middle;
|
|
271
|
+
display: inline-block;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/*
|
|
275
|
+
This is copied from Docusaurus:
|
|
276
|
+
https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-theme-classic/src/theme/DocItem/styles.module.css#L19
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
@media only screen and (min-width: 997px) {
|
|
280
|
+
.apiItemCol {
|
|
281
|
+
max-width: 75% !important;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Prevent hydration FOUC, as the mobile TOC needs to be server-rendered */
|
|
285
|
+
.apiTocMobile {
|
|
286
|
+
display: none;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* DOCUSAURUS */
|
|
291
|
+
|
|
292
|
+
.tsd-kind-icon {
|
|
293
|
+
word-break: break-all;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.apiPage .menu__link:not(.menu__link--sublist),
|
|
297
|
+
.apiPage .table-of-contents__link,
|
|
298
|
+
.tsd-truncate {
|
|
299
|
+
display: block;
|
|
300
|
+
white-space: nowrap;
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
text-overflow: ellipsis;
|
|
303
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const React = require('react');
|
|
4
|
+
const _interopDefault = e => e && e.__esModule ? e : {
|
|
5
|
+
default: e
|
|
6
|
+
};
|
|
7
|
+
const React__default = /*#__PURE__*/_interopDefault(React);
|
|
8
|
+
function AnchorLink({
|
|
9
|
+
id
|
|
10
|
+
}) {
|
|
11
|
+
return /*#__PURE__*/React__default.default.createElement("a", {
|
|
12
|
+
className: "tsd-anchor",
|
|
13
|
+
href: `#${id}`
|
|
14
|
+
}, /*#__PURE__*/React__default.default.createElement("span", {
|
|
15
|
+
className: "tsd-anchor-id",
|
|
16
|
+
id: id
|
|
17
|
+
}), /*#__PURE__*/React__default.default.createElement("i", {
|
|
18
|
+
className: "codicon codicon-symbol-numeric"
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
exports.AnchorLink = AnchorLink;
|
|
22
|
+
//# sourceMappingURL=AnchorLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorLink.js","sources":["../../src/components/AnchorLink.tsx"],"sourcesContent":null,"names":["React"],"mappings":";;;;;;;;AACO,SAAS,UAAU,CAAC;AAC3B,EAAE,EAAE;AACJ,CAAC,EAAE;AACH,EAAE,oBAAoBA,sBAAK,CAAC,aAAa,CAAC,GAAG,EAAE;AAC/C,IAAI,SAAS,EAAE,YAAY;AAC3B,IAAI,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,GAAG,eAAeA,sBAAK,CAAC,aAAa,CAAC,MAAM,EAAE;AAC9C,IAAI,SAAS,EAAE,eAAe;AAC9B,IAAI,EAAE,EAAE,EAAE;AACV,GAAG,CAAC,eAAeA,sBAAK,CAAC,aAAa,CAAC,GAAG,EAAE;AAC5C,IAAI,SAAS,EAAE,gCAAgC;AAC/C,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const React = require('react');
|
|
4
|
+
const themeCommon = require('@docusaurus/theme-common');
|
|
5
|
+
const ApiItemLayout = require('./ApiItemLayout.js');
|
|
6
|
+
const _interopDefault = e => e && e.__esModule ? e : {
|
|
7
|
+
default: e
|
|
8
|
+
};
|
|
9
|
+
const React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
|
+
const emptyToc = [];
|
|
11
|
+
function ApiChangelog({
|
|
12
|
+
changelog: Changelog,
|
|
13
|
+
route
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/React__default.default.createElement(ApiItemLayout, {
|
|
16
|
+
heading: "Changelog",
|
|
17
|
+
pageMetadata: /*#__PURE__*/React__default.default.createElement(themeCommon.PageMetadata, {
|
|
18
|
+
description: Changelog.contentTitle,
|
|
19
|
+
title: "Changelog | API"
|
|
20
|
+
}),
|
|
21
|
+
route: route,
|
|
22
|
+
toc: Changelog.toc ?? emptyToc
|
|
23
|
+
}, /*#__PURE__*/React__default.default.createElement("section", {
|
|
24
|
+
className: "tsd-readme"
|
|
25
|
+
}, /*#__PURE__*/React__default.default.createElement(Changelog, null)));
|
|
26
|
+
}
|
|
27
|
+
module.exports = ApiChangelog;
|
|
28
|
+
//# sourceMappingURL=ApiChangelog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiChangelog.js","sources":["../../src/components/ApiChangelog.tsx"],"sourcesContent":null,"names":["React","PageMetadata"],"mappings":";;;;;;;;;;AAGA,MAAM,QAAQ,GAAG,EAAE,CAAC;AACL,SAAS,YAAY,CAAC;AACrC,EAAE,SAAS,EAAE,SAAS;AACtB,EAAE,KAAK;AACP,CAAC,EAAE;AACH,EAAE,oBAAoBA,sBAAK,CAAC,aAAa,CAAC,aAAa,EAAE;AACzD,IAAI,OAAO,EAAE,WAAW;AACxB,IAAI,YAAY,eAAeA,sBAAK,CAAC,aAAa,CAACC,wBAAY,EAAE;AACjE,MAAM,WAAW,EAAE,SAAS,CAAC,YAAY;AACzC,MAAM,KAAK,EAAE,iBAAiB;AAC9B,KAAK,CAAC;AACN,IAAI,KAAK,EAAE,KAAK;AAChB,IAAI,GAAG,EAAE,SAAS,CAAC,GAAG,IAAI,QAAQ;AAClC,GAAG,eAAeD,sBAAK,CAAC,aAAa,CAAC,SAAS,EAAE;AACjD,IAAI,SAAS,EAAE,YAAY;AAC3B,GAAG,eAAeA,sBAAK,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACzD;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const React = require('react');
|
|
4
|
+
const ApiDataContext = /*#__PURE__*/React.createContext({
|
|
5
|
+
options: {
|
|
6
|
+
banner: '',
|
|
7
|
+
breadcrumbs: true,
|
|
8
|
+
gitRefName: 'master',
|
|
9
|
+
minimal: false,
|
|
10
|
+
pluginId: 'default',
|
|
11
|
+
scopes: []
|
|
12
|
+
},
|
|
13
|
+
reflections: {}
|
|
14
|
+
});
|
|
15
|
+
exports.ApiDataContext = ApiDataContext;
|
|
16
|
+
//# sourceMappingURL=ApiDataContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiDataContext.js","sources":["../../src/components/ApiDataContext.ts"],"sourcesContent":null,"names":["createContext"],"mappings":";;;;AACY,MAAC,cAAc,gBAAgBA,mBAAa,CAAC;AACzD,EAAE,OAAO,EAAE;AACX,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,WAAW,EAAE,IAAI;AACrB,IAAI,UAAU,EAAE,QAAQ;AACxB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,QAAQ,EAAE,SAAS;AACvB,IAAI,MAAM,EAAE,EAAE;AACd,GAAG;AACH,EAAE,WAAW,EAAE,EAAE;AACjB,CAAC;;;;"}
|