Daniel Zlotin преди 6 години
родител
ревизия
9ae12e6e9c
променени са 2 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 7
    0
      scripts/gen-doc.js
  2. 3
    1
      scripts/gen-doc/MarkdownCreator.ts

+ 7
- 0
scripts/gen-doc.js Целия файл

@@ -0,0 +1,7 @@
1
+const exec = require('shell-utils').exec;
2
+
3
+run();
4
+
5
+function run() {
6
+  exec.execSync(`ts-node `);
7
+}

+ 3
- 1
scripts/gen-doc/MarkdownCreator.ts Целия файл

@@ -18,12 +18,14 @@ export class MarkdownCreator {
18 18
 
19 19
   private readMethods(reflection: Typedoc.DeclarationReflection) {
20 20
     const methodReflections = reflection.getChildrenByKind(Typedoc.ReflectionKind.Method);
21
+
21 22
     methodReflections.sort((a, b) => a.sources[0].line - b.sources[0].line);
23
+
22 24
     return methodReflections.map((methodReflection) => ({
23 25
       name: methodReflection.name,
24 26
       arguments: this.readArguments(methodReflection.signatures[0].parameters || []),
25 27
       returnType: methodReflection.signatures[0].type.toString(),
26
-      source: `${methodReflection.sources[0].fileName}#${methodReflection.sources[0].line}`,
28
+      source: `/docs/api/${methodReflection.sources[0].fileName}#${methodReflection.sources[0].line}`,
27 29
       comment: methodReflection.signatures[0].comment ? methodReflection.signatures[0].comment.shortText : ''
28 30
     }));
29 31
   }