Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Dec 15, 2024
1 parent c4910ae commit f9f2109
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ yarn-error.log*
lerna-debug.log

/data
/classes
/classes
/docs
1 change: 1 addition & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const config: Config = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
exclude: ['ref/**'],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
3 changes: 1 addition & 2 deletions plugins/cls-loader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ export default function clsLoaderPlugin(
const rootRoutes = await Promise.all(
content.loadedVersions.map(async (loadedVersion) => {
const version = loadedVersion.versionName;
// console.log(context.generatedFilesDir)
generateClassDocs(actions, path.join(context.generatedFilesDir, version), loadedVersion.classes);
generateClassDocs(actions, path.join(context.siteDir, "docs", 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.
Expand Down
6 changes: 3 additions & 3 deletions plugins/cls-loader/src/plugin/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ function reshapeHTML(text) {
text = text.join(" ");
}
text = text.replaceAll(/<[^>]*>/gi, "");
text = text.replaceAll(/\[/gi, "\[");
return text
text = text.replaceAll(/\[/gi, "[");
return text;
text = text.replaceAll(/\]/gi, "]");
text = text.replaceAll(/\<br\s*\/?\>/gi, "\n\n");
text = text.replaceAll(/\<\/?p\>/gi, "\n\n");
Expand Down Expand Up @@ -269,7 +269,6 @@ function membersToMarkdown(
}

export async function generateDoc(classFile, noCode: boolean = true) {
console.log("generateDoc", classFile);
const classContent = (await readFile(classFile)).toString();
const classDef: ClassDefinition = parseClassFile(classContent);

Expand All @@ -290,6 +289,7 @@ ${asCode(classDef.Class.code)}
${noCode ? "" : originalCode}
`;
return documentation;
documentation += membersToMarkdown(
classFile,
"Parameters",
Expand Down
10 changes: 5 additions & 5 deletions plugins/cls-loader/src/plugin/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export function extractSidebar(
items: subItems,
label: item.name,
type: "category",
link: {
type: 'link',
href: 'test',
},
// link: {
// type: 'link',
// href: 'test',
// },
} as const;
});

const sidebar = items.filter((item) => "items" in item && items.length > 0);
// const sidebar = items.filter((item) => "items" in item && items.length > 0);

// console.log("sidebar", JSON.stringify(sidebar, null, 2));

Expand Down
9 changes: 8 additions & 1 deletion static/img/intersystems-docs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9f2109

Please sign in to comment.