Update packages/mermaid/src/docs.mts

Co-authored-by: Alois Klink <alois@aloisklink.com>
This commit is contained in:
Sidharth Vinod 2022-10-13 13:48:00 +05:30 committed by GitHub
parent d3de78ffce
commit d03fdfdbca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,9 @@ const prettierConfig: prettier.Config = {
let filesWereTransformed = false;
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)}).`;
};
/**