Merge branch 'sidv/linkDocsSource' of https://github.com/mermaid-js/mermaid into sidv/linkDocsSource

* 'sidv/linkDocsSource' of https://github.com/mermaid-js/mermaid:
  Update packages/mermaid/src/docs.mts
This commit is contained in:
Sidharth Vinod 2022-10-13 13:49:27 +05:30
commit 30a3a9ee53
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD

View File

@ -71,7 +71,9 @@ const prettierConfig: prettier.Config = {
let filesWereTransformed = false; let filesWereTransformed = false;
const generateHeader = (file: string): string => { const generateHeader = (file: string): string => {
return `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [${file}](../${file}).`; // 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)}).`;
}; };
/** /**