Skip to content

Commit

Permalink
added descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Dec 16, 2024
1 parent 88e4cdf commit bb4df2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
- main
pull_request:
jobs:
test:
name: Test
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: true
Expand All @@ -17,4 +17,3 @@ jobs:
node-version: 20
- run: yarn install --immutable
- run: yarn run build
- run: yarn run check
17 changes: 10 additions & 7 deletions plugins/cls-loader/src/plugin/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,8 @@ function reshapeHTML(text) {
text = text.join(" ");
}
text = text.replaceAll(/<[^>]*>/gi, "");
text = text.replaceAll(/\[/gi, "[");
return text;
text = text.replaceAll(/\]/gi, "]");
text = text.replaceAll(/({|}|\[|\])/g, "\\$1");

text = text.replaceAll(/\<br\s*\/?\>/gi, "\n\n");
text = text.replaceAll(/\<\/?p\>/gi, "\n\n");
text = text.replaceAll(/\<\/?pre\>/gi, "\n```\n");
Expand Down Expand Up @@ -259,10 +258,11 @@ function membersToMarkdown(
entries.forEach(([key, member]) => {
doc += `### ${member.name}\n\n`;
doc += `${asCode(member.code)}\n\n`;
let description = member.description.join(" ");
// description = reshapeHTML(member.description);
// doc += description;
// doc += "\n\n";
if (member.description.length) {
let description = member.description.join(" ");
description = reshapeHTML(member.description);
doc += `${description}\n\n`;
}
});

return doc;
Expand All @@ -288,6 +288,9 @@ ${asCode(classContent)}
${asCode(classDef.Class.code)}
${noCode ? "" : originalCode}
${reshapeHTML(classDef.Class.description.join(" "))}
`;
documentation += membersToMarkdown(
classFile,
Expand Down

0 comments on commit bb4df2c

Please sign in to comment.