From 108c25f19f72fad9f3e20551435439b18aac9267 Mon Sep 17 00:00:00 2001 From: Nikolay Rozhkov Date: Wed, 23 Aug 2023 23:32:33 +0300 Subject: [PATCH 1/9] Removed all n00b file names and added redirects --- docker-compose.yml | 2 +- packages/mermaid/src/docs/.vitepress/config.ts | 6 +++--- .../src/docs/.vitepress/theme/redirect.spec.ts | 4 ++-- .../mermaid/src/docs/.vitepress/theme/redirect.ts | 15 +++++++++------ packages/mermaid/src/docs/config/Tutorials.md | 2 +- .../docs/config/{n00b-advanced.md => advanced.md} | 2 +- packages/mermaid/src/docs/config/usage.md | 2 +- ...{n00b-gettingStarted.md => getting-started.md} | 4 ++-- packages/mermaid/src/docs/intro/index.md | 8 ++++---- ...00b-syntaxReference.md => syntax-reference.md} | 6 +++--- pnpm-lock.yaml | 2 +- 11 files changed, 28 insertions(+), 25 deletions(-) rename packages/mermaid/src/docs/config/{n00b-advanced.md => advanced.md} (90%) rename packages/mermaid/src/docs/intro/{n00b-gettingStarted.md => getting-started.md} (96%) rename packages/mermaid/src/docs/intro/{n00b-syntaxReference.md => syntax-reference.md} (95%) diff --git a/docker-compose.yml b/docker-compose.yml index 2480311a21..5ee31964dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: working_dir: /mermaid mem_limit: '2G' environment: - - NODE_OPTIONS=--max_old_space_size=2048 + - NODE_OPTIONS=--max_old_space_size=4096 volumes: - ./:/mermaid - root_cache:/root/.cache diff --git a/packages/mermaid/src/docs/.vitepress/config.ts b/packages/mermaid/src/docs/.vitepress/config.ts index d787fe6ea1..ede064fa46 100644 --- a/packages/mermaid/src/docs/.vitepress/config.ts +++ b/packages/mermaid/src/docs/.vitepress/config.ts @@ -109,8 +109,8 @@ function sidebarAll() { collapsed: false, items: [ { text: 'About Mermaid', link: '/intro/' }, - { text: 'Getting Started', link: '/intro/n00b-gettingStarted' }, - { text: 'Syntax and Configuration', link: '/intro/n00b-syntaxReference' }, + { text: 'Getting Started', link: '/intro/getting-started' }, + { text: 'Syntax and Configuration', link: '/intro/syntax-reference' }, ], }, ...sidebarSyntax(), @@ -167,7 +167,7 @@ function sidebarConfig() { { text: 'Theming', link: '/config/theming' }, { text: 'Accessibility', link: '/config/accessibility' }, { text: 'Mermaid CLI', link: '/config/mermaidCLI' }, - { text: 'Advanced usage', link: '/config/n00b-advanced' }, + { text: 'Advanced usage', link: '/config/advanced' }, { text: 'FAQ', link: '/config/faq' }, ], }, diff --git a/packages/mermaid/src/docs/.vitepress/theme/redirect.spec.ts b/packages/mermaid/src/docs/.vitepress/theme/redirect.spec.ts index 3d88913d1e..b78f63990f 100644 --- a/packages/mermaid/src/docs/.vitepress/theme/redirect.spec.ts +++ b/packages/mermaid/src/docs/.vitepress/theme/redirect.spec.ts @@ -19,8 +19,8 @@ test.each([ 'https://mermaid-js.github.io/mermaid/#/flowchart?another=test&id=my-id&one=more', // with multiple params 'syntax/flowchart.html#my-id', ], - ['https://mermaid-js.github.io/mermaid/#/n00b-advanced', 'config/n00b-advanced.html'], // without .md - ['https://mermaid-js.github.io/mermaid/#/n00b-advanced.md', 'config/n00b-advanced.html'], // with .md + ['https://mermaid-js.github.io/mermaid/#/n00b-advanced', 'config/advanced.html'], // without .md + ['https://mermaid-js.github.io/mermaid/#/n00b-advanced.md', 'config/advanced.html'], // with .md [ 'https://mermaid-js.github.io/mermaid/#/flowchart?id=a-node-in-the-form-of-a-circle', // with id, without .md 'syntax/flowchart.html#a-node-in-the-form-of-a-circle', diff --git a/packages/mermaid/src/docs/.vitepress/theme/redirect.ts b/packages/mermaid/src/docs/.vitepress/theme/redirect.ts index 8d576fece9..98009ca6da 100644 --- a/packages/mermaid/src/docs/.vitepress/theme/redirect.ts +++ b/packages/mermaid/src/docs/.vitepress/theme/redirect.ts @@ -50,15 +50,18 @@ const idRedirectMap: Record = { mermaidcli: 'config/mermaidCLI', mindmap: 'syntax/mindmap', 'more-pages': '', - 'n00b-advanced': 'config/n00b-advanced', - 'n00b-gettingstarted': 'intro/n00b-gettingStarted', - 'n00b-overview': 'intro/n00b-gettingStarted', - 'community/n00b-overview': 'intro/n00b-gettingStarted', - 'n00b-syntaxreference': 'intro/n00b-syntaxReference', + 'n00b-advanced': 'config/advanced', + 'config/n00b-advanced': 'config/advanced', + 'n00b-gettingstarted': 'intro/getting-started', + 'intro/n00b-gettingStarted': 'intro/getting-started', + 'n00b-overview': 'intro/getting-started', + 'n00b-syntaxreference': 'intro/syntax-reference', + 'intro/n00b-syntaxReference': 'intro/syntax-reference', + 'community/n00b-overview': 'intro/getting-started', newdiagram: 'community/newDiagram', pie: 'syntax/pie', plugins: '', - quickstart: 'intro/n00b-gettingStarted', + quickstart: 'intro/getting-started', requirementdiagram: 'syntax/requirementDiagram', security: 'community/security', sequencediagram: 'syntax/sequenceDiagram', diff --git a/packages/mermaid/src/docs/config/Tutorials.md b/packages/mermaid/src/docs/config/Tutorials.md index c6db9dacf9..af7dbe672c 100644 --- a/packages/mermaid/src/docs/config/Tutorials.md +++ b/packages/mermaid/src/docs/config/Tutorials.md @@ -26,7 +26,7 @@ The definitions that can be generated the Live-Editor are also backwards-compati ## Mermaid with HTML -Examples are provided in [Getting Started](../intro/n00b-gettingStarted.md) +Examples are provided in [Getting Started](../intro/getting-started.md) **CodePen Examples:** diff --git a/packages/mermaid/src/docs/config/n00b-advanced.md b/packages/mermaid/src/docs/config/advanced.md similarity index 90% rename from packages/mermaid/src/docs/config/n00b-advanced.md rename to packages/mermaid/src/docs/config/advanced.md index 2932faa485..4ab4774285 100644 --- a/packages/mermaid/src/docs/config/n00b-advanced.md +++ b/packages/mermaid/src/docs/config/advanced.md @@ -1,4 +1,4 @@ -# Advanced n00b mermaid (Coming soon..) +# Advanced mermaid (Coming soon..) ## splitting mermaid code from html diff --git a/packages/mermaid/src/docs/config/usage.md b/packages/mermaid/src/docs/config/usage.md index 740b3509b5..7f3a04caa6 100644 --- a/packages/mermaid/src/docs/config/usage.md +++ b/packages/mermaid/src/docs/config/usage.md @@ -35,7 +35,7 @@ pnpm add mermaid **Hosting mermaid on a web page:** -> Note:This topic explored in greater depth in the [User Guide for Beginners](../intro/n00b-gettingStarted.md) +> Note:This topic explored in greater depth in the [User Guide for Beginners](../intro/getting-started.md) The easiest way to integrate mermaid on a web page requires two elements: diff --git a/packages/mermaid/src/docs/intro/n00b-gettingStarted.md b/packages/mermaid/src/docs/intro/getting-started.md similarity index 96% rename from packages/mermaid/src/docs/intro/n00b-gettingStarted.md rename to packages/mermaid/src/docs/intro/getting-started.md index fcb3f31ee1..47ffa72918 100644 --- a/packages/mermaid/src/docs/intro/n00b-gettingStarted.md +++ b/packages/mermaid/src/docs/intro/getting-started.md @@ -2,7 +2,7 @@ Mermaid is composed of three parts: Deployment, Syntax and Configuration. -This section talks about the different ways to deploy Mermaid. Learning the [Syntax](n00b-syntaxReference.md) would be of great help to the beginner. +This section talks about the different ways to deploy Mermaid. Learning the [Syntax](syntax-reference.md) would be of great help to the beginner. > Generally the live editor is enough for most general uses of mermaid, and is a good place to start learning. @@ -36,7 +36,7 @@ graph TD In the `Code` section one can write or edit raw mermaid code, and instantly `Preview` the rendered result on the panel beside it. -The `Configuration` Section is for changing the appearance and behavior of mermaid diagrams. An easy introduction to mermaid configuration is found in the [Advanced usage](../config/n00b-advanced.md) section. A complete configuration reference cataloging the default values can be found on the [mermaidAPI](../config/setup/README.md) page. +The `Configuration` Section is for changing the appearance and behavior of mermaid diagrams. An easy introduction to mermaid configuration is found in the [Advanced usage](../config/advanced.md) section. A complete configuration reference cataloging the default values can be found on the [mermaidAPI](../config/setup/README.md) page. ![Code,Config and Preview](./img/Code-Preview-Config.png) diff --git a/packages/mermaid/src/docs/intro/index.md b/packages/mermaid/src/docs/intro/index.md index 8410ef1cb6..554db5a123 100644 --- a/packages/mermaid/src/docs/intro/index.md +++ b/packages/mermaid/src/docs/intro/index.md @@ -4,7 +4,7 @@ It is a JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically. -> If you are familiar with Markdown you should have no problem learning [Mermaid's Syntax](n00b-syntaxReference.md). +> If you are familiar with Markdown you should have no problem learning [Mermaid's Syntax](syntax-reference.md). @@ -39,7 +39,7 @@ Mermaid allows even non-programmers to easily create detailed and diagrams throu [Tutorials](../config/Tutorials.md) has video tutorials. Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid](../ecosystem/integrations.md). -For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](../intro/n00b-gettingStarted.md) and [Usage](../config/usage.md). +For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](../intro/getting-started.md) and [Usage](../config/usage.md). 🌐 [CDN](https://www.jsdelivr.com/package/npm/mermaid) | 📖 [Documentation](https://mermaidjs.github.io) | 🙌 [Contribution](../community/development.md) | 🔌 [Plug-Ins](../ecosystem/integrations.md) @@ -59,9 +59,9 @@ In our release process we rely heavily on visual regression tests using [applito ## Installation -**In depth guides and examples can be found at [Getting Started](./n00b-gettingStarted.md) and [Usage](../config/usage.md).** +**In depth guides and examples can be found at [Getting Started](./getting-started.md) and [Usage](../config/usage.md).** -**It would also be helpful to learn more about mermaid's [Syntax](./n00b-syntaxReference.md).** +**It would also be helpful to learn more about mermaid's [Syntax](./syntax-reference.md).** ### CDN diff --git a/packages/mermaid/src/docs/intro/n00b-syntaxReference.md b/packages/mermaid/src/docs/intro/syntax-reference.md similarity index 95% rename from packages/mermaid/src/docs/intro/n00b-syntaxReference.md rename to packages/mermaid/src/docs/intro/syntax-reference.md index 398f832576..51f25be354 100644 --- a/packages/mermaid/src/docs/intro/n00b-syntaxReference.md +++ b/packages/mermaid/src/docs/intro/syntax-reference.md @@ -24,7 +24,7 @@ erDiagram PRODUCT ||--o{ ORDER-ITEM : "ordered in" ``` -The [Getting Started](./n00b-gettingStarted.md) section can also provide some practical examples of mermaid syntax. +The [Getting Started](./getting-started.md) section can also provide some practical examples of mermaid syntax. ## Diagram Breaking @@ -48,13 +48,13 @@ Configuration is the third part of Mermaid, after deployment and syntax. It deal If you are interested in altering and customizing your Mermaid Diagrams, you will find the methods and values available for [Configuration](../config/setup/README.md) here. It includes themes. This section will introduce the different methods of configuring the behaviors and appearances of Mermaid Diagrams. -The following are the most commonly used methods, and they are all tied to Mermaid [Deployment](./n00b-gettingStarted.md) methods. +The following are the most commonly used methods, and they are all tied to Mermaid [Deployment](./getting-started.md) methods. ### Configuration Section in the [Live Editor](https://mermaid.live). Here you can edit certain values to change the behavior and appearance of the diagram. -### [The initialize() call](https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted?id=_3-calling-the-javascript-api), +### [The initialize() call](https://mermaid-js.github.io/mermaid/#/getting-started?id=_3-calling-the-javascript-api), Used when Mermaid is called via an API, or through a `