mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 06:20:07 +02:00
Wit
This commit is contained in:
@@ -3,7 +3,7 @@ order: 9
|
||||
---
|
||||
# Development
|
||||
|
||||
##Updating the documentation
|
||||
## Updating the documentation
|
||||
|
||||
## Getting the development environment up
|
||||
1. Fork the gh-pages branch in the the mermaid repository
|
||||
|
@@ -2,7 +2,7 @@
|
||||
order: 3
|
||||
---
|
||||
|
||||
#Flowcharts - Basic Syntax
|
||||
# Flowcharts - Basic Syntax
|
||||
## Graph
|
||||
This statement declares a new graph and the direction of the graph layout.
|
||||
|
||||
@@ -198,6 +198,19 @@ graph LR;
|
||||
A == text ==> B
|
||||
```
|
||||
|
||||
## Special characters that break syntax
|
||||
|
||||
It is possible to put text within quotes in order to render more troublesome characters. As in the example below:
|
||||
|
||||
```
|
||||
graph LR
|
||||
d1["This is the (text) in the box"]
|
||||
```
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
id1["This is the (text) in the box"]
|
||||
```
|
||||
## Subgraphs
|
||||
|
||||
```
|
||||
@@ -279,7 +292,7 @@ graph LR
|
||||
```
|
||||
|
||||
#### Classes
|
||||
More convenient then defining the style everytime is to define a class of styles and attach this class to the nodes that
|
||||
More convenient then defining the style every time is to define a class of styles and attach this class to the nodes that
|
||||
should have a different look.
|
||||
|
||||
a class definition looks like the example below:
|
||||
@@ -299,9 +312,33 @@ It is also possible to attach a class to a list of nodes in one statement:
|
||||
```
|
||||
class nodeId1,nodeId2 className;
|
||||
```
|
||||
### Css classes
|
||||
|
||||
It is also possible to pre dine classes in css styles that can be applied from the graph definition as in the example
|
||||
below:
|
||||
**Example style**
|
||||
```
|
||||
<style>
|
||||
.cssClass > rect{
|
||||
fill:#FF0000;
|
||||
stroke:#FFFF00;
|
||||
stroke-width:4px;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
**Example definition**
|
||||
```
|
||||
graph LR;
|
||||
A-->B[AAA<span>BBB</span>];
|
||||
B-->D;
|
||||
class A cssClass;
|
||||
```
|
||||
|
||||
<aside class="warning">Class definitions in the graph defnition is broken in version 0.5.1 but has been fixed in the master branch of mermaid. This fix will be included in 0.5.2</aside>
|
||||
|
||||
|
||||
#### Default class
|
||||
|
||||
### Default class
|
||||
|
||||
If a class is named default it will be assigned to all classes without specific class definitions.
|
||||
|
||||
|
@@ -16,7 +16,7 @@ This is why mermaid was born, a simple markdown-like script language for generat
|
||||
|
||||
Code examples below:
|
||||
|
||||
###An example of a flowchart
|
||||
### An example of a flowchart
|
||||
```
|
||||
graph TD;
|
||||
A-->B;
|
||||
@@ -25,7 +25,7 @@ graph TD;
|
||||
C-->D;
|
||||
```
|
||||
|
||||
###An example of a sequence diagram
|
||||
### An example of a sequence diagram
|
||||
```
|
||||
sequenceDiagram
|
||||
participant Alice
|
||||
@@ -40,7 +40,7 @@ sequenceDiagram
|
||||
Bob-->John: Jolly good!
|
||||
```
|
||||
|
||||
###Example code for a gantt diagram
|
||||
### Example code for a gantt diagram
|
||||
```
|
||||
gantt
|
||||
dateFormat YYYY-MM-DD
|
||||
|
@@ -2,11 +2,11 @@
|
||||
order: 10
|
||||
---
|
||||
|
||||
#Upgrading to from version -0.4.0
|
||||
# Upgrading to from version -0.4.0
|
||||
|
||||
Some of the interfaces has been upgraded.
|
||||
|
||||
##Initialization
|
||||
## Initialization
|
||||
|
||||
mermaid_config is no longer used. Instead a call to mermaid initialize is done as in the example below:
|
||||
|
||||
|
@@ -2,8 +2,8 @@
|
||||
title: Usage
|
||||
order: 1
|
||||
---
|
||||
#Usage
|
||||
##Installation
|
||||
# Usage
|
||||
## Installation
|
||||
|
||||
Either use the npm or bower package managers as per below:
|
||||
|
||||
@@ -36,7 +36,7 @@ There are some bundles to choose from:
|
||||
|
||||
Read more about that at [https://rawgit.com/](https://rawgit.com/)
|
||||
|
||||
##Simple usage on a web page
|
||||
## Simple usage on a web page
|
||||
|
||||
The easiest way to integrate mermaid on a web page requires two elements:
|
||||
1. Inclusion of the mermaid framework in the html page using a script tag
|
||||
@@ -45,7 +45,7 @@ The easiest way to integrate mermaid on a web page requires two elements:
|
||||
If these things are in place mermaid listens to the page load event and when fires, when the page has loaded, it will
|
||||
locate the graphs n the page and transform them to svg files.
|
||||
|
||||
###Include mermaid on your web page:
|
||||
### Include mermaid on your web page:
|
||||
|
||||
```
|
||||
<script src="mermaid.min.js"></script>
|
||||
@@ -57,7 +57,7 @@ Further down on your page mermaid will look for tags with ```class="mermaid"```.
|
||||
read the chart definiton which will be replaced with the svg chart.
|
||||
|
||||
|
||||
###Define a chart like this:
|
||||
### Define a chart like this:
|
||||
|
||||
```
|
||||
<div class="mermaid">
|
||||
@@ -98,7 +98,7 @@ mermaid.init(undefined, $("#someId .yetAnotherClass"));
|
||||
|
||||
<aside class="warning">This type of integration is deprecated instead the preferred way of handling more complex integration is to us the mermaidAPI instead.</aside>
|
||||
|
||||
##Usage with browserify
|
||||
## Usage with browserify
|
||||
The reader is assumed to know about CommonJS style of module handling and how to use browserify. If not a good place
|
||||
to start would be http://browserify.org/ website.
|
||||
|
||||
@@ -130,7 +130,7 @@ Us the created bundle on a web page as per example below:
|
||||
</html>
|
||||
```
|
||||
|
||||
##API usage
|
||||
## API usage
|
||||
The main idea with the API is to be able to call a render function with graph defintion as a string. The render function
|
||||
will render the graph and call a callback with the resulting svg code. With this approach it is up to the site creator to
|
||||
fetch the graph definition from the site, perhaps from a textarea, render it and place the graph somewhere in the site.
|
||||
@@ -239,7 +239,7 @@ var textFieldUpdated = function(){
|
||||
bindEventHandler('change', 'code', textFieldUpdated);
|
||||
```
|
||||
|
||||
#Configuration
|
||||
# Configuration
|
||||
Mermaid takes a number of options which lets you tweak the rendering of the diagrams. Currently there are three ways of
|
||||
setting the options in mermaid.
|
||||
|
||||
@@ -251,7 +251,7 @@ setting the options in mermaid.
|
||||
The list above has two ways to many of doing this. Three are deprecated and will eventually be removed. The list of
|
||||
configuration objects are described [in the mermaidAPI documentation](http://knsv.github.io/mermaid/index.html#configuration28).
|
||||
|
||||
##Using the mermaidAPI.initialize/mermaid.initialize call
|
||||
## 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
|
||||
on what kind of integration you use.
|
||||
@@ -273,7 +273,7 @@ on what kind of integration you use.
|
||||
<aside class="success">This is the preferred way of configuring mermaid.</aside>
|
||||
|
||||
|
||||
##Using the mermaid object
|
||||
## Using the mermaid object
|
||||
|
||||
Is it possible to set some configuration via the mermaid object. The two parameters that are supported using this
|
||||
approach are:
|
||||
@@ -287,7 +287,7 @@ mermaid.startOnLoad = true;
|
||||
|
||||
<aside class="info">This way of setting the configuration is deprecated instead the preferred way of is to use the initialize method. This functionality is only kept for not breaking existing integrations</aside>
|
||||
|
||||
##Using the mermaid_config
|
||||
## Using the mermaid_config
|
||||
|
||||
Is it possible to set some configuration via the mermaid object. The two parameters that are supported using this
|
||||
approach are:
|
||||
@@ -301,7 +301,7 @@ mermaid_config.startOnLoad = true;
|
||||
|
||||
<aside class="info">This way of setting the configuration is deprecated instead the preferred way of is to use the initialize method. This functionality is only kept for not breaking existing integrations</aside>
|
||||
|
||||
##Using the mermaid.init call
|
||||
## Using the mermaid.init call
|
||||
|
||||
Is it possible to set some configuration via the mermaid object. The two parameters that are supported using this
|
||||
approach are:
|
||||
|
Reference in New Issue
Block a user