diff --git a/.gitignore b/.gitignore
index 4adf9290..5fa1af00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,5 @@ lerna-debug.log
/data
/classes
/docs
+/versioned_docs
+/tmp
\ No newline at end of file
diff --git a/docusaurus.config.ts b/docusaurus.config.ts
index f3050fae..521a9504 100644
--- a/docusaurus.config.ts
+++ b/docusaurus.config.ts
@@ -43,7 +43,6 @@ const config: Config = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
- exclude: ['ref/**'],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
diff --git a/plugins/cls-loader/src/components/RefIndex.tsx b/plugins/cls-loader/src/components/RefIndex.tsx
index f6c350f2..810ef6e5 100644
--- a/plugins/cls-loader/src/components/RefIndex.tsx
+++ b/plugins/cls-loader/src/components/RefIndex.tsx
@@ -82,7 +82,7 @@ export default function RefIndex({ options, classes, history }: RefIndexProps) {
Welcome to the Class Reference
-
+ {/*
Packages
@@ -98,7 +98,7 @@ export default function RefIndex({ options, classes, history }: RefIndexProps) {
))}
-
+ */}
diff --git a/plugins/cls-loader/src/index.ts b/plugins/cls-loader/src/index.ts
index 47b640e0..f4c908d1 100644
--- a/plugins/cls-loader/src/index.ts
+++ b/plugins/cls-loader/src/index.ts
@@ -7,7 +7,12 @@ import type {
PropVersionMetadata,
} from "@docusaurus/plugin-content-docs";
import { CURRENT_VERSION_NAME } from "@docusaurus/plugin-content-docs/server";
-import type { LoadContext, Plugin, PluginContentLoadedActions, RouteConfig } from "@docusaurus/types";
+import type {
+ LoadContext,
+ Plugin,
+ PluginContentLoadedActions,
+ RouteConfig,
+} from "@docusaurus/types";
import { DEFAULT_PLUGIN_ID, normalizeUrl } from "@docusaurus/utils";
import { generateJson } from "./plugin/data";
import { extractSidebar } from "./plugin/sidebar";
@@ -80,14 +85,11 @@ export default function clsLoaderPlugin(
const classes = await getClassesFromFolder(
path.join(options.projectRoot, metadata.versionLabel),
metadata.versionPath + "/",
- context.generatedFilesDir,
+ context.generatedFilesDir
);
// Generate sidebars (this runs before the main sidebar is loaded)
- const sidebars = extractSidebar(
- classes,
- options.sortSidebar
- );
+ const sidebars = extractSidebar(classes, options.sortSidebar);
// await fs.promises.writeFile(
// path.join(
@@ -104,6 +106,10 @@ export default function clsLoaderPlugin(
// ),
// `import type { SidebarConfig } from '@docusaurus/plugin-content-docs';\nexport = Array;`
// );
+ generateClassDocs(
+ path.join(context.generatedFilesDir, "cls-loader-docs", metadata.versionLabel),
+ classes
+ );
return {
...metadata,
@@ -137,7 +143,8 @@ export default function clsLoaderPlugin(
const rootRoutes = await Promise.all(
content.loadedVersions.map(async (loadedVersion) => {
const version = loadedVersion.versionName;
- generateClassDocs(actions, path.join(context.siteDir, "docs", version), loadedVersion.classes);
+ // generateClassDocs(actions, path.join(context.siteDir, "versioned_docs", `version-${loadedVersion.versionLabel}`), loadedVersion.classes);
+ // generateClassDocs(actions, path.join(context.generatedFilesDir, "cls-loader", version), loadedVersion.classes);
// Define version metadata for all pages. We need to use the same structure as
// "docs" so that we can utilize the same React components.
@@ -203,21 +210,17 @@ export default function clsLoaderPlugin(
const indexPermalink = normalizeUrl([loadedVersion.versionPath]);
- if (loadedVersion.classes.length > 1) {
- // Only write out the ApiIndex only when we have multiple packages
- // otherwise we will have 2 top-level entries in the route entries
- routes.push({
- path: indexPermalink,
- exact: true,
- component: path.join(__dirname, "./components/RefIndex.js"),
- modules: {
- options: optionsData,
- classes: classesData,
- versionMetadata,
- },
- sidebar: "ref",
- });
- }
+ routes.push({
+ path: indexPermalink,
+ exact: true,
+ component: path.join(__dirname, "./components/RefIndex.js"),
+ modules: {
+ options: optionsData,
+ classes: classesData,
+ versionMetadata,
+ },
+ sidebar: "ref",
+ });
// console.log("indexPermalink", indexPermalink);
// Wrap in the `DocVersionRoot` component:
@@ -254,4 +257,4 @@ export default function clsLoaderPlugin(
});
},
};
-}
\ No newline at end of file
+}
diff --git a/plugins/cls-loader/src/plugin/classes.ts b/plugins/cls-loader/src/plugin/classes.ts
index 2905d169..37159877 100644
--- a/plugins/cls-loader/src/plugin/classes.ts
+++ b/plugins/cls-loader/src/plugin/classes.ts
@@ -289,7 +289,6 @@ ${asCode(classDef.Class.code)}
${noCode ? "" : originalCode}
`;
- return documentation;
documentation += membersToMarkdown(
classFile,
"Parameters",
@@ -314,10 +313,10 @@ export async function generateDocFile(classFile, folder, mdFile) {
return mdFileFull;
}
-export async function generateClassDocs(actions, folder, classes) {
+export async function generateClassDocs(folder, classes) {
classes.forEach(async (item) => {
if (item.isPackage) {
- generateClassDocs(actions, `${folder}/${item.name}`, item.items);
+ generateClassDocs(`${folder}/${item.name}`, item.items);
} else {
item.fileContent = await generateDocFile(
item.fullPath,