Skip to content

Commit

Permalink
升级typedoc生成插件到最新版本
Browse files Browse the repository at this point in the history
Harry for the whole new features!!!!!
  • Loading branch information
Qianshanyao committed May 7, 2024
1 parent e4270fe commit df4b7d6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 80 deletions.
15 changes: 8 additions & 7 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ const config = {
...minecraftTypeNames.map((typeName) => {
return [
'docusaurus-plugin-typedoc',
/** @type {import("docusaurus-plugin-typedoc/dist/types").PluginOptions} */
/**
* @type {import("docusaurus-plugin-typedoc/dist/models").PluginOptions}
**/
{
id: `preview-${typeName}`,
entryPoints: [`./static/typedoc/preview/${typeName}.d.ts`],
tsconfig: './static/typedoc/preview/tsconfig.json',
// exclude:['/node_modules/'],
out: `sapi/preview/${typeName}`,
out: `./docs/sapi/preview/${typeName}`,
skipErrorChecking: true,
parametersFormat: 'table',
sidebar: {
categoryLabel: 'sapiPreviewSidebar',
collapsed: false,
position: 0,
fullNames: true,
pretty: true,
}
}
];
Expand All @@ -82,8 +82,9 @@ const config = {
entryPoints: [`./static/typedoc/stable/${typeName}.d.ts`],
tsconfig: './static/typedoc/stable/tsconfig.json',
// exclude:['/node_modules/'],
out: `sapi/stable/${typeName}`,
out: `./docs/sapi/stable/${typeName}`,
skipErrorChecking: true,
parametersFormat: 'table',
sidebar: {
categoryLabel: 'sapiStableSidebar',
collapsed: false,
Expand Down
73 changes: 10 additions & 63 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"@minecraft/server-net": "^1.0.0-beta.1.21.0-preview.24",
"@minecraft/server-ui": "^1.2.0-beta.1.21.0-preview.24",
"@tsconfig/docusaurus": "^2.0.3",
"docusaurus-plugin-typedoc": "^0.22.0",
"typedoc-plugin-markdown": "^3.17.1",
"docusaurus-plugin-typedoc": "^1.0.1",
"typedoc-plugin-markdown": "^4.0.1",
"typescript": "^5.4.5"
},
"browserslist": {
Expand Down
16 changes: 8 additions & 8 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ const genSapiModuleSidebar = function (path, moduleName, moduleParseResultItemNa
return ret;
}

// const importSapiModuleSidebar = (path, moduleName) => {
// return {
// type: 'category',
// label: '@minecraft/' + moduleName,
// items: require(`./docs/sapi/en/${path}/${moduleName}/typedoc-sidebar.cjs`)
// }
// };
const importSapiModuleSidebar = (path, moduleName) => {
return {
type: 'category',
label: '@minecraft/' + moduleName,
items: require(`./docs/sapi/${path}/${moduleName}/typedoc-sidebar.cjs`)
}
};
const sapiModuleSidebarGenerator = function (isStable) {
const path = isStable ? 'stable' : 'preview';
const ret = [];
for (const moduleNamesKey in moduleNames) {
ret.push(genSapiModuleSidebar(path, moduleNamesKey, moduleNames[moduleNamesKey]));
ret.push(importSapiModuleSidebar(path, moduleNamesKey));
}
return ret;
};
Expand Down

0 comments on commit df4b7d6

Please sign in to comment.