diff --git a/docs/developer-docs/configuration.md b/docs/developer-docs/configuration.md index 8188396ae..03a32f313 100644 --- a/docs/developer-docs/configuration.md +++ b/docs/developer-docs/configuration.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/developer-docs/configuration.md](../packages/mermaid/src/docs/developer-docs/configuration.md). +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/developer-docs/configuration.md](../../packages/mermaid/src/docs/developer-docs/configuration.md). # Configuration diff --git a/docs/diagrams-and-syntax-and-examples/flowchart.md b/docs/diagrams-and-syntax-and-examples/flowchart.md index 3dd4069cd..6257c8afb 100644 --- a/docs/diagrams-and-syntax-and-examples/flowchart.md +++ b/docs/diagrams-and-syntax-and-examples/flowchart.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/diagrams-and-syntax-and-examples/flowchart.md](../packages/mermaid/src/docs/diagrams-and-syntax-and-examples/flowchart.md). +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/diagrams-and-syntax-and-examples/flowchart.md](../../packages/mermaid/src/docs/diagrams-and-syntax-and-examples/flowchart.md). --- diff --git a/docs/landing/index.html b/docs/landing/index.html index 044ee679c..e8d0c89c4 100644 --- a/docs/landing/index.html +++ b/docs/landing/index.html @@ -1,6 +1,6 @@ - + diff --git a/packages/mermaid/src/docs.mts b/packages/mermaid/src/docs.mts index f415cfb0a..8b6041cc5 100644 --- a/packages/mermaid/src/docs.mts +++ b/packages/mermaid/src/docs.mts @@ -35,7 +35,7 @@ import { exec } from 'child_process'; import { globby } from 'globby'; import { JSDOM } from 'jsdom'; import type { Code, Root } from 'mdast'; -import { posix, dirname } from 'path'; +import { posix, dirname, relative } from 'path'; import prettier from 'prettier'; import { remark } from 'remark'; // @ts-ignore No typescript declaration file @@ -72,8 +72,11 @@ let filesWereTransformed = false; const generateHeader = (file: string): string => { // path from file in docs/* to repo root, e.g ../ or ../../ */ - const rootDirectory = relative(file, "packages/mermaid/src/docs"); - return `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [${file}](${join(rootDirectory, file)}).`; + const rootDirectory = relative(file, SOURCE_DOCS_DIR); + return `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [${file}](${posix.join( + rootDirectory, + file + )}).`; }; /**