Kaynağa Gözat

fix(docs): Fix links between docs across modules

Relates to #89
Michael Bromley 6 yıl önce
ebeveyn
işleme
5a5f4df699
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      scripts/docs/generate-typescript-docs.ts

+ 4 - 2
scripts/docs/generate-typescript-docs.ts

@@ -70,9 +70,11 @@ function generateTypescriptDocs(config: DocsSectionConfig[], isWatchMode: boolea
         const sourceFilePaths = getSourceFilePaths(sourceDirs);
         const parsedDeclarations = new TypescriptDocsParser().parse(sourceFilePaths);
         for (const info of parsedDeclarations) {
-            globalTypeMap.set(info.title, info.category + '/' + info.fileName);
+            const { category, fileName } = info;
+            const pathToTypeDoc = `${outputPath}/${category ? category + '/' : ''}${fileName === '_index' ? '' : fileName}`;
+            globalTypeMap.set(info.title, pathToTypeDoc);
         }
-        const docsUrl = `/docs/${outputPath}`;
+        const docsUrl = `/docs`;
         const generatedCount = new TypescriptDocsRenderer().render(
             parsedDeclarations,
             docsUrl,