From 567c09850cedfa12839674b86874316d715f30ad Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Fri, 17 Jul 2020 16:54:23 -0700 Subject: [PATCH 01/32] Update n00b-overview.md - Added copy to make it more friendly to beginners. --- docs/n00b-overview.md | 49 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/docs/n00b-overview.md b/docs/n00b-overview.md index 83b5653b1..423bfcfd0 100644 --- a/docs/n00b-overview.md +++ b/docs/n00b-overview.md @@ -1,6 +1,11 @@ -# Overview for n00bs +# Overview for Beginners +**Edit this Page** [](./n00b-overview.md) -mermaid is a tool that aims to make diagrams and flowcharts for documentation, easier. +## Nothing explains a concept like a Good Diagram + +mermaid is a javascript based tool that utilizes a markdown inspired syntax to generate documentation, which is actually quicker, less complicated and more convenient than traditional diagramming software. This is a relatively straightforward solution to a major hurdle in software teams, Knowledge Transfer and Documentation + +# The primary objective of mermaid is to help in addressing the problem of Documentation Rot. with mermaid, diagrams can be created through comments like this in a script: @@ -15,15 +20,41 @@ And they are rendered into this and made part of the documentation:  -Most of the similar visuals that you might need to create can be scripted in a similar way, with a varitety of different symbols and chart types available. -Since the diagram source is text based, it can be part of production scripts (and other pieces of code). So less time needs be spent on documenting as a separate task. +## Advantages of Using Mermaid -Comparing with Visio and similar applications, mermaid is a really fast way to create good visualizations. This is especially apparent when editing a complex visualisations, a process that usually takes hours in a desktop application, but only takes minutes (or even less if generation has been scripted) with mermaid. +- The Advantages of mermaid include its ease of generation, modification and rendering. +- The number of integrations that it has. +- It is a package that can be deployed to create -mermaid can potentially cut down the amount of time and effort spent on the process of creating diagrams, to a fraction of what you usually put in. +## Creating and Maintaining Diagrams is an expensive and frustrating process. -However, a lot of the mermaid documentation is geared to professional frontend developers, presuming a skill set which I simply do not have. +Anyone who has used Visio, or (God Forbid) Excel to make a Gantt Chart, knows how hard it is to make, edit and maintain good visualizations. -If you need some basic instructions and introductions, here are a few good places to start: +In an environment of constantly changing information , diagrams/charts become obsolete/inaccurate very fast. This hobbles the information transfer and productivity in teams. -For information on how to use mermaid, click [here](https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted), or you can try out the mermaid [live editor](https://mermaid-js.github.io/mermaid-live-editor/), alternatively, you could also view the [integrations and uses](https://github.com/mermaid-js/mermaid/blob/develop/docs/integrations.md) for mermaid. +The fast setting Doc-Rot in diagrams makes it quite hard to rationalize taking hours in a desktop application, to produce a diagram that you would need to recreate again the following week in order to account for updates and changes in the app you are documenting. Yet that is often the reality for diagrams and charts. + +## This is a source of frustration for developers, engineers or any subject matter experts, not to mention it costing companies in missed productivity. + +mermaid can potentially cut down the amount of time, effort and the learning curve that is associated with creating diagrams and charts. Because, the text base for diagrams can be edited easily, to modify the product, it can also be part of production scripts (and other pieces of code). So less time needs be spent on documenting, as a separate task. + + +## The mobility that mermaid provides can help Documentation catch up with Development in quickly changing projects. + +Being based on markdown, mermaid can be used, not only by accomplished front-end developers, but by most computer savvy people to render simple diagrams, at much faster speeds. +In fact one can pick up the syntax for it quite easily from the examples given. + +## mermaid is a useful charting tool + +For information on how to use mermaid, click [here](https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted). +You can try out the mermaid [live editor](https://mermaid-js.github.io/mermaid-live-editor/). +Alternatively, you could also view the [integrations and uses](https://github.com/mermaid-js/mermaid/blob/develop/docs/integrations.md). + +# For anyone who may need video tutorials, here is a list of beginner friendly introductions: + +https://www.youtube.com/watch?v=SQ9QmuTHuSI&t=438s +https://www.youtube.com/watch?v=5RQqht3NNSE +https://www.youtube.com/watch?v=7_2IroEs6Is&t=207s +https://www.youtube.com/watch?v=9HZzKkAqrX8 +https://www.youtube.com/watch?v=7_2IroEs6Is&t=207s +https://www.youtube.com/watch?v=9HZzKkAqrX8 From 31f890d55ca9aa02567e7571971d91490192656a Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Fri, 17 Jul 2020 16:54:55 -0700 Subject: [PATCH 02/32] Update n00b-overview.md --- docs/n00b-overview.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/n00b-overview.md b/docs/n00b-overview.md index 423bfcfd0..2bfadcafd 100644 --- a/docs/n00b-overview.md +++ b/docs/n00b-overview.md @@ -53,8 +53,13 @@ Alternatively, you could also view the [integrations and uses](https://github.co # For anyone who may need video tutorials, here is a list of beginner friendly introductions: https://www.youtube.com/watch?v=SQ9QmuTHuSI&t=438s + https://www.youtube.com/watch?v=5RQqht3NNSE + https://www.youtube.com/watch?v=7_2IroEs6Is&t=207s + https://www.youtube.com/watch?v=9HZzKkAqrX8 + https://www.youtube.com/watch?v=7_2IroEs6Is&t=207s + https://www.youtube.com/watch?v=9HZzKkAqrX8 From 615c6cb3883a86af176b4e4e654683480cbd9f3b Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Fri, 17 Jul 2020 20:00:24 -0700 Subject: [PATCH 03/32] Update directives.md --- docs/directives.md | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/docs/directives.md b/docs/directives.md index e11f832be..985026d01 100644 --- a/docs/directives.md +++ b/docs/directives.md @@ -1,11 +1,26 @@ ## Directives **Edit this Page** [](./directives.md) -### Directives were added in [Version 8.6.0](/8.6.0_docs.md) -#### Init directives -With this version, directives are supported. Technically there are two flavors of directive: init/initialize and everything else. The init/initialize directive is parsed early in the flow enough to be able to re-initialize mermaid with a new configuration object. Example: +## Directives were added in [Version 8.6.0](/8.6.0_docs.md). Please Read it for more information. +## Directives +With this version, directives are supported. Directives are divided in two sets, by priority. the first set, containing 'init' or 'initialize' directives take priority. While the other set, containing all other kinds of directives are considered only after 'init' and the graph-type declared. + +#### Init + + +| Parameter | Description |Type | Required | Values| +| --- | --- | --- | --- | --- | +| init | modifies configurations| Directive| Optional | Any parameters not included in the secure array| + +**Notes:** + +init would be an argument-directive: %%{init: { **insert argument here**}}%% + +The json object that is passed as {**argument** } must be valid, quoted json or it will be ignored. + +The init/initialize directive is parsed early in the flow, enough to be able to re-initialize mermaid with a new configuration object. Example: ``` %%{init: { 'logLevel': 'debug', 'theme': 'dark' } }%% graph > @@ -14,7 +29,7 @@ A-->B will set the `logLevel` to `debug` and the `theme` to `dark` for a flowchart diagram. -Note: init or initialize are both acceptable as init directives. Also note that init directives are coalesced. This means: +Note: 'init' or 'initialize' are both acceptable as init directives. Also note that init directives are coalesced. This means: ``` %%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% @@ -33,10 +48,11 @@ will result an init object looking like this: ``` to be sent to `mermaid.initialize(...)` + #### Other directives -The other flavor of directive is everything else. In this category are any directives that follow the graph type declaration. Essentially, these directives will not be processed early in the flow like the init directive. Each individual graph type will handle these directives. As an example: +In this category are any directives that follow the graph type declaration. Essentially, these directives will not be processed early in the flow like the init directive. Each individual graph type will handle these directives. As an example: ``` %%{init: { 'logLevel': 'debug', 'theme': 'dark' } }%% @@ -45,15 +61,20 @@ sequenceDiagram Alice->>Bob: Hi Bob Bob->>Alice: Hi Alice ``` - +## Chronology This will set the `logLevel` to `debug` and `theme` to `dark` for a sequence diagram. Then, during processing, the config for the sequence diagram is set by the `config` directive. This directive is handled in the `sequenceDb.js`. In this example, the fontFamily, fontSize, and fontWeight are all set for this sequence diagram. #### Backwards Compatibility -Init directives and any other non-multiline directives should be backwards compatible because they will be treated as comments in prior versions of mermaid-js. +Init directives and any other non-multiline directives should be backwards compatible, because they will be treated as comments in prior versions of mermaid-js. Multiline directives, however, will pose an issue and will render an error. This is unavoidable. ### Wrapping The `%%{wrap}%%` directive and the inline `wrap:` text hint have also been added for sequence diagrams. This has been explained in my previous comments and has not materially changed. + +# Wrap +| Parameter | Description |Type | Required | Values| +| --- | --- | --- | --- | --- | +| wrap | a callable text-wrap function| Directive| Optional | %%{wrap}%%| From 1c6a64caf276cf6144f515b63e1c634d85cad4d1 Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sat, 18 Jul 2020 04:27:17 -0700 Subject: [PATCH 04/32] Update n00b-overview.md --- docs/n00b-overview.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/n00b-overview.md b/docs/n00b-overview.md index 2bfadcafd..3c5433304 100644 --- a/docs/n00b-overview.md +++ b/docs/n00b-overview.md @@ -34,17 +34,19 @@ In an environment of constantly changing information , diagrams/charts become ob The fast setting Doc-Rot in diagrams makes it quite hard to rationalize taking hours in a desktop application, to produce a diagram that you would need to recreate again the following week in order to account for updates and changes in the app you are documenting. Yet that is often the reality for diagrams and charts. -## This is a source of frustration for developers, engineers or any subject matter experts, not to mention it costing companies in missed productivity. +## Diagramming and charting is a gigantic waste of developer time, but not having diagrams ruins productivity. -mermaid can potentially cut down the amount of time, effort and the learning curve that is associated with creating diagrams and charts. Because, the text base for diagrams can be edited easily, to modify the product, it can also be part of production scripts (and other pieces of code). So less time needs be spent on documenting, as a separate task. +mermaid can cut down the amount of time, effort and the learning curve that is associated with creating diagrams and charts, by a wide margin. + +Because, the text base for diagrams allows for it to be updated easily, it can also be made part of production scripts (and other pieces of code). So less time needs be spent on documenting, as a separate task. -## The mobility that mermaid provides can help Documentation catch up with Development in quickly changing projects. +## mermaid helps Documentation catch up with Development, in quickly changing projects. Being based on markdown, mermaid can be used, not only by accomplished front-end developers, but by most computer savvy people to render simple diagrams, at much faster speeds. -In fact one can pick up the syntax for it quite easily from the examples given. +In fact one can pick up the syntax for it quite easily from the examples given and there are many tutorials in the internet. -## mermaid is a useful charting tool +## mermaid is for everyone. For information on how to use mermaid, click [here](https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted). You can try out the mermaid [live editor](https://mermaid-js.github.io/mermaid-live-editor/). From 26dba53d99c18f831593ee0020b36e2f578593be Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sat, 18 Jul 2020 04:39:33 -0700 Subject: [PATCH 05/32] Update config.js --- src/config.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/config.js b/src/config.js index fb74d8e01..167415ada 100644 --- a/src/config.js +++ b/src/config.js @@ -820,8 +820,6 @@ const siteConfig = assignWithDepth({}, defaultConfig); const currentConfig = assignWithDepth({}, defaultConfig); /** - *## setSiteConfig - *| Function | Description | Type | Values | *| --------- | ------------------- | ------- | ------------------ | *| setSiteConfig|Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array| @@ -842,7 +840,6 @@ export const setSiteConfig = conf => { return getSiteConfig(); }; /** - *## getSiteConfig *| Function | Description | Type | Values | *| --------- | ------------------- | ------- | ------------------ | *| setSiteConfig|Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig| @@ -855,7 +852,6 @@ export const getSiteConfig = () => { return assignWithDepth({}, siteConfig); }; /** - *## setConfig *| Function | Description | Type | Values | *| --------- | ------------------- | ------- | ------------------ | *| setSiteConfig|Sets the siteConfig to desired values | Put Request| Any Values, except ones in secure array| @@ -874,7 +870,6 @@ export const setConfig = conf => { return getConfig(); }; /** - * ## getConfig *| Function | Description | Type | Return Values | *| --------- | ------------------- | ------- | ------------------ | *| getConfig |Obtains the currentConfig | Get Request | Any Values from currentConfig| @@ -887,7 +882,6 @@ export const getConfig = () => { return assignWithDepth({}, currentConfig); }; /** - *## sanitize *| Function | Description | Type | Values | *| --------- | ------------------- | ------- | ------------------ | *| sanitize |Sets the siteConfig to desired values. | Put Request |None| @@ -910,8 +904,6 @@ export const sanitize = options => { }); }; /** - *## reset - *| Function | Description | Type | Required | Values | *| --------- | ------------------- | ------- | -------- | ------------------ | *| reset|Resets currentConfig to conf| Put Request | Required | None| From 212e0e624faa9d0b0664442a46da2bf0b8bdbf5c Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sat, 18 Jul 2020 04:59:52 -0700 Subject: [PATCH 06/32] Update n00b-overview.md --- docs/n00b-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/n00b-overview.md b/docs/n00b-overview.md index 3c5433304..cd7145113 100644 --- a/docs/n00b-overview.md +++ b/docs/n00b-overview.md @@ -50,7 +50,7 @@ In fact one can pick up the syntax for it quite easily from the examples given a For information on how to use mermaid, click [here](https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted). You can try out the mermaid [live editor](https://mermaid-js.github.io/mermaid-live-editor/). -Alternatively, you could also view the [integrations and uses](https://github.com/mermaid-js/mermaid/blob/develop/docs/integrations.md). +Alternatively, you could also view the [integrations and uses](https://mermaid-js.github.io/mermaid/#/./integrations). # For anyone who may need video tutorials, here is a list of beginner friendly introductions: From ed1c2cb596699dd4ba33691cc5f5a4c928a490d5 Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sat, 18 Jul 2020 05:18:18 -0700 Subject: [PATCH 07/32] Update README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 6c4ae2c4d..70f043b7a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,7 +24,7 @@ For a more detailed introduction to mermaid, look to the [Beginner's Guide](http You should also Check out the list of [Integrations and Usages of Mermaid](./integrations.md) -You can also watch some popular mermaid tutorials. +You can also watch some popular mermaid tutorials on the [mermaid Overview](./n00b-overview.md) ## [CDN](https://unpkg.com/mermaid/) From 07f6572816d7de1e3689e7081649e29f3058d366 Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sat, 18 Jul 2020 18:04:03 -0700 Subject: [PATCH 08/32] Update usage.md --- docs/usage.md | 56 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 1e50060da..8f2a0de0b 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -5,7 +5,15 @@ ### npm package ``` -yarn add mermaid +1.You will need to isntall node v10 or 12, which would have npm. + +2. download yarn using npm. + +2. enter the following command: + yarn add mermaid + +3. You can then add mermaid as a dev dependency using this command: + yarn add --dev mermaid ``` ### CDN @@ -35,7 +43,7 @@ Further down on your page mermaid will look for tags with `class="mermaid"`. Fro read the chart definiton and replace it with the svg chart. -### Define a chart like this: +### Define a chart like thi: ```html