瀏覽代碼

doc menu files

Daniel Zlotin 6 年之前
父節點
當前提交
f21e554d73
共有 2 個文件被更改,包括 3 次插入4 次删除
  1. 2
    3
      scripts/gen-docs/MarkdownWriter.ts
  2. 1
    1
      scripts/gen-docs/templates/menu.hbs

+ 2
- 3
scripts/gen-docs/MarkdownWriter.ts 查看文件

@@ -18,9 +18,8 @@ export class MarkdownWriter {
18 18
   }
19 19
 
20 20
   public writeMenu(classContexts: ClassContext[]) {
21
-    const menuMarkdown = this.menuFn({
22
-      classes: classContexts.map((c) => ({ name: c.name, path: `/api/${c.name}` }))
23
-    });
21
+    const files = classContexts.map((c) => ({ name: c.name, path: `/api/${c.name}` }));
22
+    const menuMarkdown = this.menuFn({ files });
24 23
     fs.writeFileSync(`${this.outputDir}/_sidebar.md`, menuMarkdown, { encoding: 'utf8' });
25 24
     fs.writeFileSync(`${this.outputDir}/README.md`, menuMarkdown, { encoding: 'utf8' });
26 25
   }

+ 1
- 1
scripts/gen-docs/templates/menu.hbs 查看文件

@@ -1,4 +1,4 @@
1 1
 - [Home](/)
2
-{{#each classes}}
2
+{{#each files}}
3 3
 - [{{name}}]({{path}})
4 4
 {{/each}}