@apify/docusaurus-plugin-typedoc-api 4.4.12 → 5.1.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/README.md +38 -296
- package/lib/components/AnchorLink.d.ts +5 -0
- package/lib/components/AnchorLink.d.ts.map +1 -0
- package/lib/components/AnchorLink.js +7 -26
- package/lib/components/AnchorLink.js.map +1 -1
- package/lib/components/ApiChangelog.d.ts +6 -0
- package/lib/components/ApiChangelog.d.ts.map +1 -0
- package/lib/components/ApiChangelog.js +7 -24
- package/lib/components/ApiChangelog.js.map +1 -1
- package/lib/components/ApiDataContext.d.ts +6 -0
- package/lib/components/ApiDataContext.d.ts.map +1 -0
- package/lib/components/ApiDataContext.js +12 -15
- package/lib/components/ApiDataContext.js.map +1 -1
- package/lib/components/ApiIndex.d.ts +14 -0
- package/lib/components/ApiIndex.d.ts.map +1 -0
- package/lib/components/ApiIndex.js +33 -93
- package/lib/components/ApiIndex.js.map +1 -1
- package/lib/components/ApiItem.d.ts +6 -0
- package/lib/components/ApiItem.d.ts.map +1 -0
- package/lib/components/ApiItem.js +131 -191
- package/lib/components/ApiItem.js.map +1 -1
- package/lib/components/ApiItemLayout.d.ts +14 -0
- package/lib/components/ApiItemLayout.d.ts.map +1 -0
- package/lib/components/ApiItemLayout.js +21 -97
- package/lib/components/ApiItemLayout.js.map +1 -1
- package/lib/components/ApiOptionsContext.d.ts +5 -0
- package/lib/components/ApiOptionsContext.d.ts.map +1 -0
- package/lib/components/ApiOptionsContext.js +5 -9
- package/lib/components/ApiOptionsContext.js.map +1 -1
- package/lib/components/ApiOptionsLayout.d.ts +4 -0
- package/lib/components/ApiOptionsLayout.d.ts.map +1 -0
- package/lib/components/ApiOptionsLayout.js +10 -34
- package/lib/components/ApiOptionsLayout.js.map +1 -1
- package/lib/components/ApiPage.d.ts +11 -0
- package/lib/components/ApiPage.d.ts.map +1 -0
- package/lib/components/ApiPage.js +50 -63
- package/lib/components/ApiPage.js.map +1 -1
- package/lib/components/Breadcrumb.d.ts +7 -0
- package/lib/components/Breadcrumb.d.ts.map +1 -0
- package/lib/components/Breadcrumb.js +17 -49
- package/lib/components/Breadcrumb.js.map +1 -1
- package/lib/components/Comment.d.ts +10 -0
- package/lib/components/Comment.d.ts.map +1 -0
- package/lib/components/Comment.js +33 -60
- package/lib/components/Comment.js.map +1 -1
- package/lib/components/CommentBadges.d.ts +9 -0
- package/lib/components/CommentBadges.d.ts.map +1 -0
- package/lib/components/CommentBadges.js +16 -28
- package/lib/components/CommentBadges.js.map +1 -1
- package/lib/components/DefaultValue.d.ts +10 -0
- package/lib/components/DefaultValue.d.ts.map +1 -0
- package/lib/components/DefaultValue.js +25 -55
- package/lib/components/DefaultValue.js.map +1 -1
- package/lib/components/Flags.d.ts +6 -0
- package/lib/components/Flags.d.ts.map +1 -0
- package/lib/components/Flags.js +11 -22
- package/lib/components/Flags.js.map +1 -1
- package/lib/components/Footer.d.ts +2 -0
- package/lib/components/Footer.d.ts.map +1 -0
- package/lib/components/Footer.js +4 -16
- package/lib/components/Footer.js.map +1 -1
- package/lib/components/Hierarchy.d.ts +6 -0
- package/lib/components/Hierarchy.d.ts.map +1 -0
- package/lib/components/Hierarchy.js +5 -25
- package/lib/components/Hierarchy.js.map +1 -1
- package/lib/components/Icon.d.ts +6 -0
- package/lib/components/Icon.d.ts.map +1 -0
- package/lib/components/Icon.js +10 -21
- package/lib/components/Icon.js.map +1 -1
- package/lib/components/Index.d.ts +9 -0
- package/lib/components/Index.d.ts.map +1 -0
- package/lib/components/Index.js +30 -113
- package/lib/components/Index.js.map +1 -1
- package/lib/components/Markdown.d.ts +5 -0
- package/lib/components/Markdown.d.ts.map +1 -0
- package/lib/components/Markdown.js +138 -202
- package/lib/components/Markdown.js.map +1 -1
- package/lib/components/Member.d.ts +5 -0
- package/lib/components/Member.d.ts.map +1 -0
- package/lib/components/Member.js +40 -69
- package/lib/components/Member.js.map +1 -1
- package/lib/components/MemberDeclaration.d.ts +5 -0
- package/lib/components/MemberDeclaration.d.ts.map +1 -0
- package/lib/components/MemberDeclaration.js +20 -71
- package/lib/components/MemberDeclaration.js.map +1 -1
- package/lib/components/MemberGetterSetter.d.ts +8 -0
- package/lib/components/MemberGetterSetter.d.ts.map +1 -0
- package/lib/components/MemberGetterSetter.js +13 -68
- package/lib/components/MemberGetterSetter.js.map +1 -1
- package/lib/components/MemberReference.d.ts +6 -0
- package/lib/components/MemberReference.d.ts.map +1 -0
- package/lib/components/MemberReference.js +18 -48
- package/lib/components/MemberReference.js.map +1 -1
- package/lib/components/MemberSignatureBody.d.ts +9 -0
- package/lib/components/MemberSignatureBody.d.ts.map +1 -0
- package/lib/components/MemberSignatureBody.js +85 -182
- package/lib/components/MemberSignatureBody.js.map +1 -1
- package/lib/components/MemberSignatureTitle.d.ts +11 -0
- package/lib/components/MemberSignatureTitle.d.ts.map +1 -0
- package/lib/components/MemberSignatureTitle.js +27 -81
- package/lib/components/MemberSignatureTitle.js.map +1 -1
- package/lib/components/MemberSignatures.d.ts +7 -0
- package/lib/components/MemberSignatures.d.ts.map +1 -0
- package/lib/components/MemberSignatures.js +18 -66
- package/lib/components/MemberSignatures.js.map +1 -1
- package/lib/components/MemberSources.d.ts +7 -0
- package/lib/components/MemberSources.d.ts.map +1 -0
- package/lib/components/MemberSources.js +10 -34
- package/lib/components/MemberSources.js.map +1 -1
- package/lib/components/Members.d.ts +6 -0
- package/lib/components/Members.d.ts.map +1 -0
- package/lib/components/Members.js +29 -49
- package/lib/components/Members.js.map +1 -1
- package/lib/components/MembersGroup.d.ts +6 -0
- package/lib/components/MembersGroup.d.ts.map +1 -0
- package/lib/components/MembersGroup.js +16 -40
- package/lib/components/MembersGroup.js.map +1 -1
- package/lib/components/Parameter.d.ts +6 -0
- package/lib/components/Parameter.d.ts.map +1 -0
- package/lib/components/Parameter.js +35 -171
- package/lib/components/Parameter.js.map +1 -1
- package/lib/components/Reflection.d.ts +6 -0
- package/lib/components/Reflection.d.ts.map +1 -0
- package/lib/components/Reflection.js +29 -132
- package/lib/components/Reflection.js.map +1 -1
- package/lib/components/SourceLink.d.ts +10 -0
- package/lib/components/SourceLink.d.ts.map +1 -0
- package/lib/components/SourceLink.js +16 -36
- package/lib/components/SourceLink.js.map +1 -1
- package/lib/components/Type.d.ts +12 -0
- package/lib/components/Type.d.ts.map +1 -0
- package/lib/components/Type.js +142 -464
- package/lib/components/Type.js.map +1 -1
- package/lib/components/TypeAndParent.d.ts +6 -0
- package/lib/components/TypeAndParent.d.ts.map +1 -0
- package/lib/components/TypeAndParent.js +11 -27
- package/lib/components/TypeAndParent.js.map +1 -1
- package/lib/components/TypeParameters.d.ts +6 -0
- package/lib/components/TypeParameters.d.ts.map +1 -0
- package/lib/components/TypeParameters.js +10 -38
- package/lib/components/TypeParameters.js.map +1 -1
- package/lib/components/TypeParametersGeneric.d.ts +6 -0
- package/lib/components/TypeParametersGeneric.d.ts.map +1 -0
- package/lib/components/TypeParametersGeneric.js +8 -27
- package/lib/components/TypeParametersGeneric.js.map +1 -1
- package/lib/components/VersionBanner.d.ts +2 -0
- package/lib/components/VersionBanner.d.ts.map +1 -0
- package/lib/components/VersionBanner.js +18 -49
- package/lib/components/VersionBanner.js.map +1 -1
- package/lib/hooks/useBreadcrumbs.d.ts +2 -0
- package/lib/hooks/useBreadcrumbs.d.ts.map +1 -0
- package/lib/hooks/useBreadcrumbs.js +5 -8
- package/lib/hooks/useBreadcrumbs.js.map +1 -1
- package/lib/hooks/useGitRefName.d.ts +2 -0
- package/lib/hooks/useGitRefName.d.ts.map +1 -0
- package/lib/hooks/useGitRefName.js +5 -8
- package/lib/hooks/useGitRefName.js.map +1 -1
- package/lib/hooks/useMinimalLayout.d.ts +2 -0
- package/lib/hooks/useMinimalLayout.d.ts.map +1 -0
- package/lib/hooks/useMinimalLayout.js +5 -8
- package/lib/hooks/useMinimalLayout.js.map +1 -1
- package/lib/hooks/useReflection.d.ts +4 -0
- package/lib/hooks/useReflection.d.ts.map +1 -0
- package/lib/hooks/useReflection.js +15 -21
- package/lib/hooks/useReflection.js.map +1 -1
- package/lib/hooks/useReflectionMap.d.ts +3 -0
- package/lib/hooks/useReflectionMap.d.ts.map +1 -0
- package/lib/hooks/useReflectionMap.js +5 -8
- package/lib/hooks/useReflectionMap.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +349 -361
- package/lib/index.js.map +1 -1
- package/lib/markdownLoader.d.ts +6 -0
- package/lib/markdownLoader.d.ts.map +1 -0
- package/lib/markdownLoader.js +6 -10
- package/lib/markdownLoader.js.map +1 -1
- package/lib/plugin/data.d.ts +21 -0
- package/lib/plugin/data.d.ts.map +1 -0
- package/lib/plugin/data.js +391 -429
- package/lib/plugin/data.js.map +1 -1
- package/lib/plugin/python/consts.d.ts +35 -0
- package/lib/plugin/python/consts.d.ts.map +1 -0
- package/lib/plugin/python/consts.js +44 -44
- package/lib/plugin/python/consts.js.map +1 -1
- package/lib/plugin/python/index.d.ts +12 -0
- package/lib/plugin/python/index.d.ts.map +1 -0
- package/lib/plugin/python/index.js +25 -36
- package/lib/plugin/python/index.js.map +1 -1
- package/lib/plugin/python/inheritance.d.ts +42 -0
- package/lib/plugin/python/inheritance.d.ts.map +1 -0
- package/lib/plugin/python/inheritance.js +148 -153
- package/lib/plugin/python/inheritance.js.map +1 -1
- package/lib/plugin/python/packageVersions.d.ts +7 -0
- package/lib/plugin/python/packageVersions.d.ts.map +1 -0
- package/lib/plugin/python/packageVersions.js +30 -38
- package/lib/plugin/python/packageVersions.js.map +1 -1
- package/lib/plugin/python/transformation.d.ts +90 -0
- package/lib/plugin/python/transformation.d.ts.map +1 -0
- package/lib/plugin/python/transformation.js +424 -391
- package/lib/plugin/python/transformation.js.map +1 -1
- package/lib/plugin/python/type-parsing/index.d.ts +34 -0
- package/lib/plugin/python/type-parsing/index.d.ts.map +1 -0
- package/lib/plugin/python/type-parsing/index.js +78 -85
- package/lib/plugin/python/type-parsing/index.js.map +1 -1
- package/lib/plugin/python/types.d.ts +107 -0
- package/lib/plugin/python/types.d.ts.map +1 -0
- package/lib/plugin/python/types.js +2 -2
- package/lib/plugin/python/types.js.map +1 -1
- package/lib/plugin/python/utils.d.ts +40 -0
- package/lib/plugin/python/utils.d.ts.map +1 -0
- package/lib/plugin/python/utils.js +74 -73
- package/lib/plugin/python/utils.js.map +1 -1
- package/lib/plugin/sidebar.d.ts +6 -0
- package/lib/plugin/sidebar.d.ts.map +1 -0
- package/lib/plugin/sidebar.js +94 -96
- package/lib/plugin/sidebar.js.map +1 -1
- package/lib/plugin/structure/0.23.d.ts +3 -0
- package/lib/plugin/structure/0.23.d.ts.map +1 -0
- package/lib/plugin/structure/0.23.js +33 -41
- package/lib/plugin/structure/0.23.js.map +1 -1
- package/lib/plugin/url.d.ts +6 -0
- package/lib/plugin/url.d.ts.map +1 -0
- package/lib/plugin/url.js +36 -46
- package/lib/plugin/url.js.map +1 -1
- package/lib/plugin/version.d.ts +5 -0
- package/lib/plugin/version.d.ts.map +1 -0
- package/lib/plugin/version.js +73 -78
- package/lib/plugin/version.js.map +1 -1
- package/lib/types.d.ts +142 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -2
- package/lib/types.js.map +1 -1
- package/lib/utils/helpers.d.ts +2 -0
- package/lib/utils/helpers.d.ts.map +1 -0
- package/lib/utils/helpers.js +5 -7
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/hierarchy.d.ts +8 -0
- package/lib/utils/hierarchy.d.ts.map +1 -0
- package/lib/utils/hierarchy.js +31 -33
- package/lib/utils/hierarchy.js.map +1 -1
- package/lib/utils/icons.d.ts +5 -0
- package/lib/utils/icons.d.ts.map +1 -0
- package/lib/utils/icons.js +82 -114
- package/lib/utils/icons.js.map +1 -1
- package/lib/utils/links.d.ts +2 -0
- package/lib/utils/links.d.ts.map +1 -0
- package/lib/utils/links.js +24 -41
- package/lib/utils/links.js.map +1 -1
- package/lib/utils/markdown.d.ts +4 -0
- package/lib/utils/markdown.d.ts.map +1 -0
- package/lib/utils/markdown.js +45 -54
- package/lib/utils/markdown.js.map +1 -1
- package/lib/utils/reexports.d.ts +5 -0
- package/lib/utils/reexports.d.ts.map +1 -0
- package/lib/utils/reexports.js +90 -90
- package/lib/utils/reexports.js.map +1 -1
- package/lib/utils/removeScopes.d.ts +2 -0
- package/lib/utils/removeScopes.d.ts.map +1 -0
- package/lib/utils/removeScopes.js +7 -0
- package/lib/utils/removeScopes.js.map +1 -0
- package/lib/utils/visibility.d.ts +6 -0
- package/lib/utils/visibility.d.ts.map +1 -0
- package/lib/utils/visibility.js +14 -19
- package/lib/utils/visibility.js.map +1 -1
- package/package.json +29 -17
- package/python-scripts/docspec-gen/google_docstring_processor.py +54 -20
- package/src/components/ApiIndex.tsx +1 -1
- package/src/index.ts +2 -2
- package/src/plugin/data.ts +3 -3
- package/src/plugin/python/index.ts +3 -3
- package/src/plugin/python/packageVersions.ts +3 -3
- package/src/plugin/python/transformation.ts +89 -15
- package/src/plugin/python/types.ts +3 -4
- package/src/plugin/sidebar.ts +1 -1
- package/src/plugin/url.ts +1 -1
- package/src/plugin/version.ts +1 -1
- package/src/utils/links.ts +1 -12
- package/src/utils/removeScopes.ts +10 -0
- /package/{assets/styles-8ad572ec.css → lib/components/styles.css} +0 -0
package/README.md
CHANGED
|
@@ -1,312 +1,54 @@
|
|
|
1
|
-
# docusaurus-plugin-typedoc-api
|
|
1
|
+
# Apify's fork of `docusaurus-plugin-typedoc-api`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[
|
|
5
|
-
[
|
|
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
|
|
17
|
-
- `@docusaurus/preset-classic` >= v2.0.0
|
|
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
|
-
- `rehypePlugins` (`MDXPlugin[]`) - List of rehype plugins to use for
|
|
99
|
-
[MDX compilation](https://mdxjs.com/docs/extending-mdx).
|
|
100
|
-
- `remarkPlugins` (`MDXPlugin[]`) - List of remark plugins to use for
|
|
101
|
-
[MDX compilation](https://mdxjs.com/docs/extending-mdx).
|
|
102
|
-
- `removeScopes` (`string[]`) - Package scopes and prefixes to remove when displaying the package
|
|
103
|
-
name in the sidebar and index. For example, `boost` will remove `@boost/` and `boost-`.
|
|
104
|
-
- `sortPackages` (`(a, d) => number`) - Function to sort the package list in the sidebar and on the
|
|
105
|
-
index page. Defaults to alphabetical.
|
|
106
|
-
- `sortSidebar` (`(a, d) => number`) - Function to sort the categories and items within each
|
|
107
|
-
sidebar, excluding "Overview" and "Changelog". Defaults to alphabetical.
|
|
108
|
-
- `tsconfigName` (`string`) - Name of the TypeScript config file in the project root. Defaults to
|
|
109
|
-
`tsconfig.json`.
|
|
110
|
-
- `typedocOptions` (`object`) - [TypeDoc options](https://typedoc.org/guides/options/#input-options)
|
|
111
|
-
to pass to the compiler. Only supports a small subset of options, primarily around visibility
|
|
112
|
-
exclusion.
|
|
113
|
-
|
|
114
|
-
### Packages
|
|
115
|
-
|
|
116
|
-
The `packages` option has been designed to support multiple packages, with multiple entry points per
|
|
117
|
-
package. By default the option accepts a list of strings, where each value is a relative path to a
|
|
118
|
-
package folder, and a default entry point of `src/index.ts`.
|
|
119
|
-
|
|
120
|
-
```js
|
|
121
|
-
module.exports = {
|
|
122
|
-
packages: ['packages/core', 'packages/react'],
|
|
123
|
-
};
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
However, an object can be provided to customize the entry point. All entry point file paths are
|
|
127
|
-
relative to the package folder, and support 2 formats:
|
|
128
|
-
|
|
129
|
-
- **Index imports** - Consumers can only import from the package index. This is typically an entry
|
|
130
|
-
point like `src/index.ts`.
|
|
131
|
-
- **Deep imports** - Consumers can import anything from the package using its file path. Glob the
|
|
132
|
-
entire package by only passing the folder name like `src/`. _(This is useful for component
|
|
133
|
-
libraries)_
|
|
134
|
-
|
|
135
|
-
```js
|
|
136
|
-
module.exports = {
|
|
137
|
-
packages: [
|
|
138
|
-
'packages/core',
|
|
139
|
-
{
|
|
140
|
-
path: 'packages/react',
|
|
141
|
-
// Index only imports allowed
|
|
142
|
-
// import {} from 'package'
|
|
143
|
-
entry: 'src/index.tsx',
|
|
144
|
-
// Deep imports allowed
|
|
145
|
-
// import {} from 'package/some/nested/file'
|
|
146
|
-
entry: 'src/',
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
};
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
When _not_ using deep imports, multiple entry points can be defined by passing a map of objects to
|
|
153
|
-
`entry`, where each key is a sub-path that can be imported from the package (excluding the `index`).
|
|
154
|
-
Each entry object requires a `path` and a `label`, which is used for categorizing and sidebars.
|
|
155
|
-
|
|
156
|
-
```js
|
|
157
|
-
module.exports = {
|
|
158
|
-
packages: [
|
|
159
|
-
'packages/core',
|
|
160
|
-
{
|
|
161
|
-
path: 'packages/react',
|
|
162
|
-
entry: {
|
|
163
|
-
// import {} from 'package'
|
|
164
|
-
index: 'src/index.tsx',
|
|
165
|
-
// import {} from 'package/client'
|
|
166
|
-
client: { path: 'src/client.tsx', label: 'Client' },
|
|
167
|
-
// import {} from 'package/server'
|
|
168
|
-
server: { path: 'src/server.tsx', label: 'Server' },
|
|
169
|
-
// import {} from 'package/server/test'
|
|
170
|
-
'server/test': { path: 'src/server/test-utils.tsx', label: 'Server test utils' },
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
};
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
> Index entry points don't require a label, so a file path can be passed directly.
|
|
178
|
-
|
|
179
|
-
## Linking
|
|
180
|
-
|
|
181
|
-
This plugin supports API and documentation linking within source code docblocks via the `@apilink`
|
|
182
|
-
and `@doclink` tokens respectively. This works in a similar fashion to
|
|
183
|
-
[TypeDoc's `@link` resolution](https://typedoc.org/guides/link-resolution/), but also supports
|
|
184
|
-
Docusaurus versioning and routing patterns.
|
|
185
|
-
|
|
186
|
-
### `@apilink`
|
|
187
|
-
|
|
188
|
-
When linking to other APIs, you must reference them by class name, function name, property, etc,
|
|
189
|
-
_instead of_ the actual `/api` route.
|
|
190
|
-
|
|
191
|
-
```sh
|
|
192
|
-
# Maps to /api/<package>/class/Registry#register
|
|
193
|
-
{@apilink Registry.register}
|
|
194
|
-
{@apilink Registry.register | Text to use as the label}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### `@doclink`
|
|
198
|
-
|
|
199
|
-
When linking to documentation pages, you must reference the article by its URL identifier without
|
|
200
|
-
the `/docs` prefix.
|
|
201
|
-
|
|
202
|
-
```sh
|
|
203
|
-
# Maps to /docs/commands/setup
|
|
204
|
-
{@doclink commands/setup}
|
|
205
|
-
{@doclink commands/setup | Text to use as the label}
|
|
206
|
-
```
|
|
3
|
+
This is a fork of
|
|
4
|
+
[docusaurus-plugin-typedoc-api](https://github.com/milesj/docusaurus-plugin-typedoc-api) adjusted
|
|
5
|
+
for our usecases with rendering library documentation in [Apify Docs](https://docs.apify.com).
|
|
207
6
|
|
|
208
|
-
##
|
|
7
|
+
## Publishing
|
|
209
8
|
|
|
210
|
-
|
|
211
|
-
[docs versioning implementation](https://docusaurus.io/docs/versioning), which is a _requirement_
|
|
212
|
-
for this to work correctly.
|
|
9
|
+
There is no CI yet, so you have to publish updated versions of the package manually.
|
|
213
10
|
|
|
214
|
-
|
|
11
|
+
1. bump version in `packages/plugin/package.json`
|
|
12
|
+
2. `yarn build` in root
|
|
13
|
+
3. `cd packages/plugin && npm publish`
|
|
215
14
|
|
|
216
|
-
|
|
217
|
-
yarn docusaurus docs:version 1.2.3
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
Once the markdown files are generated, run our versioning command _with the same version used
|
|
221
|
-
previously_:
|
|
222
|
-
|
|
223
|
-
```shell
|
|
224
|
-
yarn docusaurus api:version 1.2.3
|
|
225
|
-
```
|
|
15
|
+
# Original readme
|
|
226
16
|
|
|
227
|
-
This
|
|
228
|
-
commit these files to your repo.
|
|
17
|
+
> ## This project is no longer actively maintained! TypeScript and TypeDoc continually release breaking changes that make keeping this project in a workable state very difficult. It's not worth my time, so if you need this project, I suggest forking it.
|
|
229
18
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
> generated files to the latest branch.
|
|
233
|
-
|
|
234
|
-
### Navigation
|
|
235
|
-
|
|
236
|
-
Our API is unable to use the
|
|
237
|
-
[`docsVersionDropdown`](https://docusaurus.io/docs/api/themes/configuration#navbar-docs-version-dropdown)
|
|
238
|
-
navigation type, as it's hardcoded in Docusaurus core. However, you can create a custom version
|
|
239
|
-
dropdown like so:
|
|
240
|
-
|
|
241
|
-
```js
|
|
242
|
-
const versions = require('./versions.json');
|
|
19
|
+

|
|
20
|
+
[](https://www.npmjs.com/package/docusaurus-plugin-typedoc-api)
|
|
243
21
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
themeConfig: {
|
|
247
|
-
// ...
|
|
248
|
-
navbar: {
|
|
249
|
-
// ...
|
|
250
|
-
items: [
|
|
251
|
-
// ...
|
|
252
|
-
{
|
|
253
|
-
type: 'dropdown',
|
|
254
|
-
to: 'api',
|
|
255
|
-
label: 'API',
|
|
256
|
-
position: 'left',
|
|
257
|
-
items: [
|
|
258
|
-
{ label: 'Next', to: 'api/next' },
|
|
259
|
-
...versions.map((version, i) => ({
|
|
260
|
-
label: version,
|
|
261
|
-
to: i === 0 ? 'api' : `api/${version}`,
|
|
262
|
-
})),
|
|
263
|
-
],
|
|
264
|
-
},
|
|
265
|
-
],
|
|
266
|
-
},
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
```
|
|
22
|
+
A Docusaurus plugin for generating source code `/api/*` routes, powered by
|
|
23
|
+
[TypeDoc](https://typedoc.org/).
|
|
270
24
|
|
|
271
|
-
|
|
25
|
+
## Documentation
|
|
272
26
|
|
|
273
|
-
|
|
27
|
+
View the [official readme](./packages/plugin/README.md) for more information on installation and
|
|
28
|
+
usage.
|
|
274
29
|
|
|
275
|
-
|
|
276
|
-
This cannot be overridden, but can be customized with some basic options (like categories and
|
|
277
|
-
sorting).
|
|
30
|
+
## Contributing
|
|
278
31
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
32
|
+
Since this repository doesn't have a public API, nor is its source code organized in a way to
|
|
33
|
+
utilize TypeDoc, we rely on the types provided by [Boost](https://github.com/milesj/boost). To
|
|
34
|
+
contribute, you'll need to clone the Boost project relative to this project as a sibling.
|
|
282
35
|
|
|
283
|
-
```
|
|
284
|
-
|
|
36
|
+
```bash
|
|
37
|
+
# Setup plugin
|
|
38
|
+
git clone git@github.com:milesj/docusaurus-plugin-typedoc-api.git
|
|
39
|
+
cd docusaurus-plugin-typedoc-api
|
|
40
|
+
yarn install
|
|
41
|
+
yarn run pack
|
|
285
42
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
43
|
+
# Setup Boost
|
|
44
|
+
cd ..
|
|
45
|
+
git clone git@github.com:milesj/boost.git
|
|
46
|
+
cd boost
|
|
47
|
+
yarn install
|
|
48
|
+
yarn run pack
|
|
289
49
|
```
|
|
290
50
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
- The header/footer API links are _not_ version aware, as their values are static.
|
|
296
|
-
- We suggest only versioning major versions, as the size of these JSON files and the webpack build
|
|
297
|
-
will get very large very fast.
|
|
298
|
-
|
|
299
|
-
## Comparison
|
|
300
|
-
|
|
301
|
-
There's another plugin called
|
|
302
|
-
[docusaurus-plugin-typedoc](https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc),
|
|
303
|
-
that offers a similar solution. However, there are many differences between that package and this
|
|
304
|
-
one, with the biggest being that theirs generates markdown files and `/docs/api/...` styled routes,
|
|
305
|
-
while ours renders custom React pages with `/api/...` styled routes. Some other differences are:
|
|
306
|
-
|
|
307
|
-
- An index of all packages.
|
|
308
|
-
- Readme inclusion and rendering.
|
|
309
|
-
- Custom styles, sections, and headings.
|
|
310
|
-
- Multiple function and method signatures.
|
|
311
|
-
- [Versioning](#versioning)!
|
|
312
|
-
- And probably more....
|
|
51
|
+
After both projects are setup, you can make modifications to this project and then verify the
|
|
52
|
+
changes by starting the Docusaurus server with `yarn run docs`. _However_, hot reloading does not
|
|
53
|
+
work, so you'll unfortunately need to run this command over and over again... haven't spent the time
|
|
54
|
+
improving this yet.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorLink.d.ts","sourceRoot":"","sources":["../../src/components/AnchorLink.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,MAAM,CAAC;CACX;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,2CASjD"}
|
|
@@ -1,27 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
default: e
|
|
8
|
-
};
|
|
9
|
-
const Link__default = /*#__PURE__*/_interopDefault(Link);
|
|
10
|
-
const useBrokenLinks__default = /*#__PURE__*/_interopDefault(useBrokenLinks);
|
|
11
|
-
function AnchorLink({
|
|
12
|
-
id
|
|
13
|
-
}) {
|
|
14
|
-
useBrokenLinks__default.default().collectAnchor(id);
|
|
15
|
-
return /*#__PURE__*/jsxRuntime.jsxs(Link__default.default, {
|
|
16
|
-
className: "tsd-anchor",
|
|
17
|
-
href: `#${id}`,
|
|
18
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
19
|
-
className: "tsd-anchor-id",
|
|
20
|
-
id: id
|
|
21
|
-
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
22
|
-
className: "codicon codicon-symbol-numeric"
|
|
23
|
-
})]
|
|
24
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from '@docusaurus/Link';
|
|
3
|
+
import useBrokenLinks from '@docusaurus/useBrokenLinks';
|
|
4
|
+
export function AnchorLink({ id }) {
|
|
5
|
+
useBrokenLinks().collectAnchor(id);
|
|
6
|
+
return (_jsxs(Link, { className: "tsd-anchor", href: `#${id}`, children: [_jsx("span", { className: "tsd-anchor-id", id: id }), _jsx("i", { className: "codicon codicon-symbol-numeric" })] }));
|
|
25
7
|
}
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=AnchorLink.js.map
|
|
8
|
+
//# sourceMappingURL=AnchorLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorLink.js","sources":["../../src/components/AnchorLink.tsx"],"
|
|
1
|
+
{"version":3,"file":"AnchorLink.js","sourceRoot":"","sources":["../../src/components/AnchorLink.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAMxD,MAAM,UAAU,UAAU,CAAC,EAAE,EAAE,EAAmB;IACjD,cAAc,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAEnC,OAAO,CACN,MAAC,IAAI,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAE,IAAI,EAAE,EAAE,aAC1C,eAAM,SAAS,EAAC,eAAe,EAAC,EAAE,EAAE,EAAE,GAAI,EAC1C,YAAG,SAAS,EAAC,gCAAgC,GAAG,IAC1C,CACP,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Props as DocItemProps } from '@theme/DocItem';
|
|
2
|
+
export interface ApiChangelogProps extends Pick<DocItemProps, 'route'> {
|
|
3
|
+
changelog: DocItemProps['content'];
|
|
4
|
+
}
|
|
5
|
+
export default function ApiChangelog({ changelog: Changelog, route }: ApiChangelogProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=ApiChangelog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiChangelog.d.ts","sourceRoot":"","sources":["../../src/components/ApiChangelog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI5D,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;IACrE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACnC;AAID,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,iBAAiB,2CAatF"}
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ApiItemLayout = require('./ApiItemLayout.js');
|
|
5
|
-
const jsxRuntime = require('react/jsx-runtime');
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PageMetadata } from '@docusaurus/theme-common';
|
|
3
|
+
import ApiItemLayout from './ApiItemLayout';
|
|
6
4
|
const emptyToc = [];
|
|
7
|
-
function ApiChangelog({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}) {
|
|
11
|
-
return /*#__PURE__*/jsxRuntime.jsx(ApiItemLayout, {
|
|
12
|
-
heading: "Changelog",
|
|
13
|
-
pageMetadata: /*#__PURE__*/jsxRuntime.jsx(themeCommon.PageMetadata, {
|
|
14
|
-
description: Changelog.contentTitle,
|
|
15
|
-
title: "Changelog | API"
|
|
16
|
-
}),
|
|
17
|
-
route: route,
|
|
18
|
-
toc: Changelog.toc ?? emptyToc,
|
|
19
|
-
children: /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
20
|
-
className: "tsd-readme",
|
|
21
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Changelog, {})
|
|
22
|
-
})
|
|
23
|
-
});
|
|
5
|
+
export default function ApiChangelog({ changelog: Changelog, route }) {
|
|
6
|
+
var _a;
|
|
7
|
+
return (_jsx(ApiItemLayout, { heading: "Changelog", pageMetadata: _jsx(PageMetadata, { description: Changelog.contentTitle, title: "Changelog | API" }), route: route, toc: (_a = Changelog.toc) !== null && _a !== void 0 ? _a : emptyToc, children: _jsx("section", { className: "tsd-readme", children: _jsx(Changelog, {}) }) }));
|
|
24
8
|
}
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=ApiChangelog.js.map
|
|
9
|
+
//# sourceMappingURL=ApiChangelog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiChangelog.js","sources":["../../src/components/ApiChangelog.tsx"],"
|
|
1
|
+
{"version":3,"file":"ApiChangelog.js","sourceRoot":"","sources":["../../src/components/ApiChangelog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAM5C,MAAM,QAAQ,GAAc,EAAE,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAqB;;IACtF,OAAO,CACN,KAAC,aAAa,IACb,OAAO,EAAC,WAAW,EACnB,YAAY,EAAE,KAAC,YAAY,IAAC,WAAW,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,EAAC,iBAAiB,GAAG,EAC3F,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAA,SAAS,CAAC,GAAG,mCAAI,QAAQ,YAE9B,kBAAS,SAAS,EAAC,YAAY,YAC9B,KAAC,SAAS,KAAG,GACJ,GACK,CAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiDataContext.d.ts","sourceRoot":"","sources":["../../src/components/ApiDataContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAExE,eAAO,MAAM,cAAc;aACjB,UAAU;iBACN,2BAA2B;EAWvC,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
reflections: {}
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
export const ApiDataContext = createContext({
|
|
3
|
+
options: {
|
|
4
|
+
banner: '',
|
|
5
|
+
breadcrumbs: true,
|
|
6
|
+
gitRefName: 'master',
|
|
7
|
+
minimal: false,
|
|
8
|
+
pluginId: 'default',
|
|
9
|
+
scopes: [],
|
|
10
|
+
},
|
|
11
|
+
reflections: {},
|
|
14
12
|
});
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=ApiDataContext.js.map
|
|
13
|
+
//# sourceMappingURL=ApiDataContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiDataContext.js","sources":["../../src/components/ApiDataContext.ts"],"
|
|
1
|
+
{"version":3,"file":"ApiDataContext.js","sourceRoot":"","sources":["../../src/components/ApiDataContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAGxC;IACF,OAAO,EAAE;QACR,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,EAAE;KACV;IACD,WAAW,EAAE,EAAE;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Props as DocItemProps } from '@theme/DocItem';
|
|
2
|
+
import type { ApiOptions, PackageReflectionGroup } from '../types';
|
|
3
|
+
export interface ApiIndexProps extends Pick<DocItemProps, 'route'> {
|
|
4
|
+
history: {
|
|
5
|
+
location: {
|
|
6
|
+
pathname: string;
|
|
7
|
+
};
|
|
8
|
+
replace: (path: string) => void;
|
|
9
|
+
};
|
|
10
|
+
options: ApiOptions;
|
|
11
|
+
packages: PackageReflectionGroup[];
|
|
12
|
+
}
|
|
13
|
+
export default function ApiIndex({ options, packages, history }: ApiIndexProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=ApiIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiIndex.d.ts","sourceRoot":"","sources":["../../src/components/ApiIndex.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAOnE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;IACjE,OAAO,EAAE;QACR,QAAQ,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;KAChC,CAAC;IACF,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAyBD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,2CAgE7E"}
|