diff --git a/docs/8.6.0_docs.md b/docs/8.6.0_docs.md
index cc812901e..11940c622 100644
--- a/docs/8.6.0_docs.md
+++ b/docs/8.6.0_docs.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/8.6.0_docs.md](../packages/mermaid/src/docs/8.6.0_docs.md).
# Version 8.6.0 Changes
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 7dbfecee4..95c5c14c9 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/CHANGELOG.md](../packages/mermaid/src/docs/CHANGELOG.md).
# Change Log
diff --git a/docs/Configuration.md b/docs/Configuration.md
index 4902dabdb..672925383 100644
--- a/docs/Configuration.md
+++ b/docs/Configuration.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/Configuration.md](../packages/mermaid/src/docs/Configuration.md).
# Configuration
diff --git a/docs/README.md b/docs/README.md
index 69acccb49..5eecf9796 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/README.md](../packages/mermaid/src/docs/README.md).
# About Mermaid
diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md
index 41156fee5..21c0032b0 100644
--- a/docs/SUMMARY.md
+++ b/docs/SUMMARY.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/SUMMARY.md](../packages/mermaid/src/docs/SUMMARY.md).
# Summary
diff --git a/docs/Setup.md b/docs/Setup.md
index 82e4e2fe8..fd978e928 100644
--- a/docs/Setup.md
+++ b/docs/Setup.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/Setup.md](../packages/mermaid/src/docs/Setup.md).
diff --git a/docs/Tutorials.md b/docs/Tutorials.md
index 0f9465a35..14f6dabac 100644
--- a/docs/Tutorials.md
+++ b/docs/Tutorials.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/Tutorials.md](../packages/mermaid/src/docs/Tutorials.md).
# Tutorials
diff --git a/docs/_navbar.md b/docs/_navbar.md
index 7f9f495a7..3721b2f4e 100644
--- a/docs/_navbar.md
+++ b/docs/_navbar.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/\_navbar.md](../packages/mermaid/src/docs/_navbar.md).
- Getting started
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
index 17cde68c9..a7872f609 100644
--- a/docs/_sidebar.md
+++ b/docs/_sidebar.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/\_sidebar.md](../packages/mermaid/src/docs/_sidebar.md).
- 📔 Introduction
diff --git a/docs/accessibility.md b/docs/accessibility.md
index 09d80df65..dfcb139e7 100644
--- a/docs/accessibility.md
+++ b/docs/accessibility.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/accessibility.md](../packages/mermaid/src/docs/accessibility.md).
# Accessibility Options
diff --git a/docs/breakingChanges.md b/docs/breakingChanges.md
index 964d89e4f..27229e525 100644
--- a/docs/breakingChanges.md
+++ b/docs/breakingChanges.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/breakingChanges.md](../packages/mermaid/src/docs/breakingChanges.md).
# Breaking changes
diff --git a/docs/c4c.md b/docs/c4c.md
index 4f9e09ab5..c763765b1 100644
--- a/docs/c4c.md
+++ b/docs/c4c.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/c4c.md](../packages/mermaid/src/docs/c4c.md).
# C4 Diagrams
diff --git a/docs/classDiagram.md b/docs/classDiagram.md
index f89b4b002..68ff399a6 100644
--- a/docs/classDiagram.md
+++ b/docs/classDiagram.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/classDiagram.md](../packages/mermaid/src/docs/classDiagram.md).
# Class diagrams
diff --git a/docs/developer-docs/configuration.md b/docs/developer-docs/configuration.md
index ba3422f6d..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 corresponding file in packages/mermaid/src/docs.
+# 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/development.md b/docs/development.md
index 3f2033d61..ac261e44c 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/development.md](../packages/mermaid/src/docs/development.md).
# Development and Contribution 🙌
diff --git a/docs/diagrams-and-syntax-and-examples/flowchart.md b/docs/diagrams-and-syntax-and-examples/flowchart.md
index fee683551..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 corresponding file in packages/mermaid/src/docs.
+# 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/directives.md b/docs/directives.md
index f814782f0..5d8407d9b 100644
--- a/docs/directives.md
+++ b/docs/directives.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/directives.md](../packages/mermaid/src/docs/directives.md).
# Directives
diff --git a/docs/entityRelationshipDiagram.md b/docs/entityRelationshipDiagram.md
index 97a0a1da3..b98b2feb0 100644
--- a/docs/entityRelationshipDiagram.md
+++ b/docs/entityRelationshipDiagram.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/entityRelationshipDiagram.md](../packages/mermaid/src/docs/entityRelationshipDiagram.md).
# Entity Relationship Diagrams
diff --git a/docs/examples.md b/docs/examples.md
index b3175edac..62f2c6088 100644
--- a/docs/examples.md
+++ b/docs/examples.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/examples.md](../packages/mermaid/src/docs/examples.md).
# Examples
diff --git a/docs/faq.md b/docs/faq.md
index a24b436b6..0d8920178 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/faq.md](../packages/mermaid/src/docs/faq.md).
# Frequently Asked Questions
diff --git a/docs/flowchart.md b/docs/flowchart.md
index 9e85a18e5..dc22a46ab 100644
--- a/docs/flowchart.md
+++ b/docs/flowchart.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/flowchart.md](../packages/mermaid/src/docs/flowchart.md).
# Flowcharts - Basic Syntax
diff --git a/docs/gantt.md b/docs/gantt.md
index 9d4fe8a09..1492ae085 100644
--- a/docs/gantt.md
+++ b/docs/gantt.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/gantt.md](../packages/mermaid/src/docs/gantt.md).
# Gantt diagrams
diff --git a/docs/gitgraph.md b/docs/gitgraph.md
index baa75126e..03acf20e1 100644
--- a/docs/gitgraph.md
+++ b/docs/gitgraph.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/gitgraph.md](../packages/mermaid/src/docs/gitgraph.md).
# Gitgraph Diagrams
diff --git a/docs/index.html b/docs/index.html
index 3bfd9b969..436bd2cba 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,6 +1,6 @@
-
+
mermaid - Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams,
diff --git a/docs/integrations.md b/docs/integrations.md
index 09df7cf9f..df973f702 100644
--- a/docs/integrations.md
+++ b/docs/integrations.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/integrations.md](../packages/mermaid/src/docs/integrations.md).
# Integrations
diff --git a/docs/introduction.md b/docs/introduction.md
index 72235794a..c092b76ee 100644
--- a/docs/introduction.md
+++ b/docs/introduction.md
@@ -1 +1 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/introduction.md](../packages/mermaid/src/docs/introduction.md).
diff --git a/docs/landing/index.html b/docs/landing/index.html
index 2504d0580..e8d0c89c4 100644
--- a/docs/landing/index.html
+++ b/docs/landing/index.html
@@ -1,6 +1,6 @@
-
+
diff --git a/docs/mermaidCLI.md b/docs/mermaidCLI.md
index 01860cab2..239b3f235 100644
--- a/docs/mermaidCLI.md
+++ b/docs/mermaidCLI.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/mermaidCLI.md](../packages/mermaid/src/docs/mermaidCLI.md).
# mermaid CLI
diff --git a/docs/mindmap.md b/docs/mindmap.md
index 94baf43e0..513abc5fe 100644
--- a/docs/mindmap.md
+++ b/docs/mindmap.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/mindmap.md](../packages/mermaid/src/docs/mindmap.md).
# Mindmap
diff --git a/docs/n00b-advanced.md b/docs/n00b-advanced.md
index e6a6adcc3..e24b079da 100644
--- a/docs/n00b-advanced.md
+++ b/docs/n00b-advanced.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/n00b-advanced.md](../packages/mermaid/src/docs/n00b-advanced.md).
# Advanced n00b mermaid (Coming soon..)
diff --git a/docs/n00b-gettingStarted.md b/docs/n00b-gettingStarted.md
index 15ef23faf..76e9526b4 100644
--- a/docs/n00b-gettingStarted.md
+++ b/docs/n00b-gettingStarted.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/n00b-gettingStarted.md](../packages/mermaid/src/docs/n00b-gettingStarted.md).
# A Mermaid User-Guide for Beginners
diff --git a/docs/n00b-overview.md b/docs/n00b-overview.md
index df400e4bb..58078723b 100644
--- a/docs/n00b-overview.md
+++ b/docs/n00b-overview.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/n00b-overview.md](../packages/mermaid/src/docs/n00b-overview.md).
# Overview for Beginners
diff --git a/docs/n00b-syntaxReference.md b/docs/n00b-syntaxReference.md
index 2c9ef7207..85a7e688c 100644
--- a/docs/n00b-syntaxReference.md
+++ b/docs/n00b-syntaxReference.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/n00b-syntaxReference.md](../packages/mermaid/src/docs/n00b-syntaxReference.md).
# Diagram Syntax
diff --git a/docs/newDiagram.md b/docs/newDiagram.md
index 070865702..f03749982 100644
--- a/docs/newDiagram.md
+++ b/docs/newDiagram.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/newDiagram.md](../packages/mermaid/src/docs/newDiagram.md).
# Adding a New Diagram/Chart 📊
diff --git a/docs/pie.md b/docs/pie.md
index 1b70fdb86..ae69d05fd 100644
--- a/docs/pie.md
+++ b/docs/pie.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/pie.md](../packages/mermaid/src/docs/pie.md).
# Pie chart diagrams
diff --git a/docs/requirementDiagram.md b/docs/requirementDiagram.md
index cf4c4bdc6..c48e61f82 100644
--- a/docs/requirementDiagram.md
+++ b/docs/requirementDiagram.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/requirementDiagram.md](../packages/mermaid/src/docs/requirementDiagram.md).
# Requirement Diagram
diff --git a/docs/security.md b/docs/security.md
index cac6d8da2..8b9d9bc58 100644
--- a/docs/security.md
+++ b/docs/security.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/security.md](../packages/mermaid/src/docs/security.md).
# Security
diff --git a/docs/sequenceDiagram.md b/docs/sequenceDiagram.md
index a570f660a..80d41fc1a 100644
--- a/docs/sequenceDiagram.md
+++ b/docs/sequenceDiagram.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/sequenceDiagram.md](../packages/mermaid/src/docs/sequenceDiagram.md).
# Sequence diagrams
diff --git a/docs/stateDiagram.md b/docs/stateDiagram.md
index ecea7cf5d..e7ade930b 100644
--- a/docs/stateDiagram.md
+++ b/docs/stateDiagram.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/stateDiagram.md](../packages/mermaid/src/docs/stateDiagram.md).
# State diagrams
diff --git a/docs/theming.md b/docs/theming.md
index c2dd3f2ae..1a09eb868 100644
--- a/docs/theming.md
+++ b/docs/theming.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/theming.md](../packages/mermaid/src/docs/theming.md).
# Theme Configuration
diff --git a/docs/upgrading.md b/docs/upgrading.md
index 884326fb7..cd0fa93af 100644
--- a/docs/upgrading.md
+++ b/docs/upgrading.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/upgrading.md](../packages/mermaid/src/docs/upgrading.md).
# Upgrading
diff --git a/docs/usage.md b/docs/usage.md
index 0c8d103a8..a64e36f4c 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/usage.md](../packages/mermaid/src/docs/usage.md).
# Usage
diff --git a/docs/user-journey.md b/docs/user-journey.md
index e40efc5a9..423f13c58 100644
--- a/docs/user-journey.md
+++ b/docs/user-journey.md
@@ -1,4 +1,4 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in packages/mermaid/src/docs.
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the source file in [packages/mermaid/src/docs/user-journey.md](../packages/mermaid/src/docs/user-journey.md).
# User Journey Diagram
diff --git a/packages/mermaid/src/docs.mts b/packages/mermaid/src/docs.mts
index d7d5f23cd..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
@@ -50,8 +50,6 @@ const MERMAID_MAJOR_VERSION = (
const SOURCE_DOCS_DIR = 'packages/mermaid/src/docs';
const FINAL_DOCS_DIR = 'docs';
-const AUTOGENERATED_TEXT = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in ${SOURCE_DOCS_DIR}.`;
-
const LOGMSG_TRANSFORMED = 'transformed';
const LOGMSG_TO_BE_TRANSFORMED = 'to be transformed';
const LOGMSG_COPIED = `, and copied to ${FINAL_DOCS_DIR}`;
@@ -72,6 +70,15 @@ const prettierConfig: prettier.Config = {
let filesWereTransformed = false;
+const generateHeader = (file: string): string => {
+ // path from file in docs/* to repo root, e.g ../ or ../../ */
+ 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
+ )}).`;
+};
+
/**
* Given a source file name and path, return the documentation destination full path and file name
* Create the destination path if it does not already exist.
@@ -164,7 +171,7 @@ const transformMarkdown = (file: string) => {
});
// Add the AUTOGENERATED_TEXT to the start of the file
- const transformed = `${AUTOGENERATED_TEXT}\n${remark.stringify(out)}`;
+ const transformed = `${generateHeader(file)}\n${remark.stringify(out)}`;
const formatted = prettier.format(transformed, {
parser: 'markdown',
...prettierConfig,
@@ -195,7 +202,7 @@ const transformHtml = (filename: string) => {
);
const jsdom = new JSDOM(fileContents);
const htmlDoc = jsdom.window.document;
- const autoGeneratedComment = jsdom.window.document.createComment(AUTOGENERATED_TEXT);
+ const autoGeneratedComment = jsdom.window.document.createComment(generateHeader(fileName));
const rootElement = htmlDoc.documentElement;
rootElement.prepend(autoGeneratedComment);