diff --git a/packages/mermaid/src/docs.mts b/packages/mermaid/src/docs.mts index 384357fe4..f415cfb0a 100644 --- a/packages/mermaid/src/docs.mts +++ b/packages/mermaid/src/docs.mts @@ -71,7 +71,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)}).`; }; /**