diff --git a/docs/README.md b/docs/README.md
index 4fb6558a7..705c08c4f 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -9,8 +9,6 @@ It is a JavaScript based diagramming and charting tool that renders Markdown-ins
-
-
[](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
@@ -19,7 +17,7 @@ It is a JavaScript based diagramming and charting tool that renders Markdown-ins
-Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
+Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
> Doc-Rot is a Catch-22 that Mermaid helps to solve.
@@ -204,7 +202,8 @@ To Deploy Mermaid:
```html
-
```
@@ -293,7 +292,7 @@ Detailed information about how to contribute can be found in the [contribution g
For public sites, it can be precarious to retrieve text from users on the internet, storing that content for presentation in a browser at a later stage. The reason is that the user content can contain embedded malicious scripts that will run when the data is presented. For Mermaid this is a risk, specially as mermaid diagrams contain many characters that are used in html which makes the standard sanitation unusable as it also breaks the diagrams. We still make an effort to sanitise the incoming code and keep refining the process but it is hard to guarantee that there are no loop holes.
-As an extra level of security for sites with external users we are happy to introduce a new security level in which the diagram is rendered in a sandboxed iframe preventing JavaScript in the code from being executed. This is a great step forward for better security.
+As an extra level of security for sites with external users we are happy to introduce a new security level in which the diagram is rendered in a sandboxed iframe preventing JavaScript in the code from being executed. This is a great step forward for better security.
*Unfortunately you can not have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code.*
@@ -305,9 +304,7 @@ To report a vulnerability, please e-mail security@mermaid.live with a descriptio
A quick note from Knut Sveidqvist:
-> *Many thanks to the [d3](https://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!*
-> *Thanks also to the [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering.*
-> *Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017.*
+> *Many thanks to the [d3](https://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!* >*Thanks also to the [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering.* >*Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017.*
>
> *Thank you to the ever-growing list of [contributors](https://github.com/knsv/mermaid/graphs/contributors) that brought the project this far!*
diff --git a/docs/accessibility.md b/docs/accessibility.md
index 9eed2e5c3..6b5ccdf04 100644
--- a/docs/accessibility.md
+++ b/docs/accessibility.md
@@ -1,8 +1,6 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.
# Accessibility Options
-**Edit this Page** [](https://github.com/mermaid-js/mermaid/blob/develop/docs/accessibility.md)
-
## Accessibility
Now with Mermaid library in much wider use, we have started to work towards more accessible features, based on the feedback from the community.
@@ -20,7 +18,7 @@ The diagram authors can now add the accessibility options in the diagram definit
* `accTitle: "Your Accessibility Title"` or
* `accDescr: "Your Accessibility Description"`
-**When these two options are defined, they will add a coressponding `
'+code+'
';
+ if (code.match(/^sequenceDiagram/) || code.match(/^graph/)) {
+ return '' + code + '
';
}
};
```
@@ -292,15 +288,15 @@ function in order to handle the error in an application-specific way.
The code-example below in meta code illustrates how this could work:
```javascript
-mermaid.parseError = function(err,hash){
+mermaid.parseError = function (err, hash) {
displayErrorInGui(err);
};
-var textFieldUpdated = function(){
+var textFieldUpdated = function () {
var textStr = getTextFromFormField('code');
- if(mermaid.parse(textStr)){
- reRender(textStr)
+ if (mermaid.parse(textStr)) {
+ reRender(textStr);
}
};
@@ -331,7 +327,7 @@ on what kind of integration you use.
```html
```
diff --git a/src/docs/README.md b/src/docs/README.md
index 0ad50e013..6405803c2 100644
--- a/src/docs/README.md
+++ b/src/docs/README.md
@@ -4,33 +4,30 @@
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](./n00b-syntaxReference.md).
'+code+'
';
+ if (code.match(/^sequenceDiagram/) || code.match(/^graph/)) {
+ return '' + code + '
';
}
};
```
@@ -283,7 +274,6 @@ module.exports = (options) ->
renderer
```
-
## Advanced usage
**Syntax validation without rendering (Work in Progress)**
@@ -299,23 +289,23 @@ function in order to handle the error in an application-specific way.
The code-example below in meta code illustrates how this could work:
```javascript
-mermaid.parseError = function(err,hash){
+mermaid.parseError = function (err, hash) {
displayErrorInGui(err);
};
-var textFieldUpdated = function(){
+var textFieldUpdated = function () {
var textStr = getTextFromFormField('code');
- if(mermaid.parse(textStr)){
- reRender(textStr)
+ if (mermaid.parse(textStr)) {
+ reRender(textStr);
}
};
bindEventHandler('change', 'code', textFieldUpdated);
```
-**Alternative to mermaid.parse():**
-One effective and more future-proof method of validating your graph definitions, is to paste and render them via the [Mermaid Live Editor](https://mermaid.live/). This will ensure that your code is compliant with the syntax of Mermaid's most recent version.
+**Alternative to mermaid.parse():**
+One effective and more future-proof method of validating your graph definitions, is to paste and render them via the [Mermaid Live Editor](https://mermaid.live/). This will ensure that your code is compliant with the syntax of Mermaid's most recent version.
## Configuration
@@ -323,14 +313,13 @@ Mermaid takes a number of options which lets you tweak the rendering of the diag
setting the options in mermaid.
1. Instantiation of the configuration using the initialize call
-2. *Using the global mermaid object* - **Deprecated**
-3. *using the global mermaid_config object* - **Deprecated**
+2. _Using the global mermaid object_ - **Deprecated**
+3. _using the global mermaid_config object_ - **Deprecated**
4. Instantiation of the configuration using the **mermaid.init** call- **Deprecated**
The list above has two ways too many of doing this. Three are deprecated and will eventually be removed. The list of
configuration objects are described [in the mermaidAPI documentation](Setup.md).
-
## Using the `mermaidAPI.initialize`/`mermaid.initialize` call
The future proof way of setting the configuration is by using the initialization call to mermaid or mermaidAPI depending
@@ -339,7 +328,7 @@ on what kind of integration you use.
```html
```
@@ -355,8 +344,8 @@ This is the preferred way of configuring mermaid.
Is it possible to set some configuration via the mermaid object. The two parameters that are supported using this
approach are:
-* mermaid.startOnLoad
-* mermaid.htmlLabels
+- mermaid.startOnLoad
+- mermaid.htmlLabels
```javascript
mermaid.startOnLoad = true;
@@ -371,8 +360,8 @@ This way of setting the configuration is deprecated. Instead the preferred way i
It is possible to set some configuration via the mermaid object. The two parameters that are supported using this
approach are:
-* mermaid_config.startOnLoad
-* mermaid_config.htmlLabels
+- mermaid_config.startOnLoad
+- mermaid_config.htmlLabels
```javascript
mermaid_config.startOnLoad = true;
@@ -386,8 +375,8 @@ This way of setting the configuration is deprecated. Instead the preferred way i
To set some configuration via the mermaid object. The two parameters that are supported using this approach are:
-* mermaid_config.startOnLoad
-* mermaid_config.htmlLabels
+- mermaid_config.startOnLoad
+- mermaid_config.htmlLabels
```javascript
mermaid_config.startOnLoad = true;