New release

This commit is contained in:
knsv 2015-02-15 18:11:46 +01:00
parent c211434c38
commit 074a819ca8
11 changed files with 530 additions and 1356 deletions

View File

@ -1,6 +1,6 @@
{
"name": "mermaid",
"version": "0.3.3",
"version": "0.3.4",
"authors": [
"knsv <knut@sveido.com>"
],

766
dist/mermaid.full.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

756
dist/mermaid.slim.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "mermaid",
"version": "0.3.3",
"version": "0.3.4",
"description": "Markdownish syntax for generating flowcharts",
"main": "src/main.js",
"bin": {
@ -32,7 +32,7 @@
"clone": "^0.2.0",
"codeclimate-test-reporter": "0.0.4",
"d3": "~3.4.13",
"dagre-d3": "~0.3.2",
"dagre-d3": "~0.3.3",
"event-stream": "^3.2.0",
"foundation": "^4.2.1-1",
"front-matter": "^0.2.0",

View File

@ -32,25 +32,25 @@
">" return 'TAGEND';
"^" return 'UP';
"v" return 'DOWN';
\-\-[x] return 'ARROW_CROSS';
\-\-\> return 'ARROW_POINT';
\-\-[o] return 'ARROW_CIRCLE';
\-\-\- return 'ARROW_OPEN';
\-\.\-[x] return 'DOTTED_ARROW_CROSS';
\-\.\-\> return 'DOTTED_ARROW_POINT';
\-\.\-[o] return 'DOTTED_ARROW_CIRCLE';
\-\.\- return 'DOTTED_ARROW_OPEN';
.\-[x] return 'DOTTED_ARROW_CROSS';
\.\-\> return 'DOTTED_ARROW_POINT';
\.\-[o] return 'DOTTED_ARROW_CIRCLE';
\.\- return 'DOTTED_ARROW_OPEN';
\=\=[x] return 'THICK_ARROW_CROSS';
\=\=\> return 'THICK_ARROW_POINT';
\=\=[o] return 'THICK_ARROW_CIRCLE';
\=\=[\=] return 'THICK_ARROW_OPEN';
\-\- return '--';
\-\. return '-.';
\=\= return '==';
\s*\-\-[x]\s* return 'ARROW_CROSS';
\s*\-\-\>\s* return 'ARROW_POINT';
\s*\-\-[o]\s* return 'ARROW_CIRCLE';
\s*\-\-\-\s* return 'ARROW_OPEN';
\s*\-\.\-[x]\s* return 'DOTTED_ARROW_CROSS';
\s*\-\.\-\>\s* return 'DOTTED_ARROW_POINT';
\s*\-\.\-[o]\s* return 'DOTTED_ARROW_CIRCLE';
\s*\-\.\-\s* return 'DOTTED_ARROW_OPEN';
\s*.\-[x]\s* return 'DOTTED_ARROW_CROSS';
\s*\.\-\>\s* return 'DOTTED_ARROW_POINT';
\s*\.\-[o]\s* return 'DOTTED_ARROW_CIRCLE';
\s*\.\-\s* return 'DOTTED_ARROW_OPEN';
\s*\=\=[x]\s* return 'THICK_ARROW_CROSS';
\s*\=\=\>\s* return 'THICK_ARROW_POINT';
\s*\=\=[o]\s* return 'THICK_ARROW_CIRCLE';
\s*\=\=[\=]\s* return 'THICK_ARROW_OPEN';
\s*\-\-\s* return '--';
\s*\-\.\s* return '-.';
\s*\=\=\s* return '==';
\- return 'MINUS';
"." return 'DOT';
\+ return 'PLUS';
@ -121,11 +121,11 @@
return 'ALPHA';
"|" return 'PIPE';
"(" return 'PS';
")" return 'PE';
")"\s* return 'PE';
"[" return 'SQS';
"]" return 'SQE';
"]"\s* return 'SQE';
"{" return 'DIAMOND_START'
"}" return 'DIAMOND_STOP'
"}"\s* return 'DIAMOND_STOP'
"\"" return 'QUOTE';
\n return 'NEWLINE';
\s return 'SPACE';
@ -273,8 +273,7 @@ alphaNumStatement
{$$=$1+'-'+$3;}
;
link: linkStatement arrowText
linkOld: linkStatement arrowText
{$1.text = $2;$$ = $1;}
| linkStatement arrowText SPACE
{$1.text = $2;$$ = $1;}
@ -282,7 +281,7 @@ link: linkStatement arrowText
{$$ = $1;}
| linkStatement SPACE
{$$ = $1;}
| '--' SPACE text SPACE linkStatement
| '--' text linkStatement
{$5.text = $3;$$ = $5;}
| '--' SPACE text SPACE linkStatement SPACE
{$5.text = $3;$$ = $5;}
@ -296,6 +295,38 @@ link: linkStatement arrowText
{$5.text = $3;$$ = $5;}
;
link: linkStatement arrowText
{$1.text = $2;$$ = $1;}
| linkStatement arrowText SPACE
{$1.text = $2;$$ = $1;}
| linkStatement
{$$ = $1;}
| '--' text ARROW_POINT
{$$ = {"type":"arrow","stroke":"normal","text":$2};}
| '--' text ARROW_CIRCLE
{$$ = {"type":"arrow_circle","stroke":"normal","text":$2};}
| '--' text ARROW_CROSS
{$$ = {"type":"arrow_cross","stroke":"normal","text":$2};}
| '--' text ARROW_OPEN
{$$ = {"type":"arrow_open","stroke":"normal","text":$2};}
| '-.' text DOTTED_ARROW_POINT
{$$ = {"type":"arrow","stroke":"dotted","text":$2};}
| '-.' text DOTTED_ARROW_CIRCLE
{$$ = {"type":"arrow_circle","stroke":"dotted","text":$2};}
| '-.' text DOTTED_ARROW_CROSS
{$$ = {"type":"arrow_cross","stroke":"dotted","text":$2};}
| '-.' text DOTTED_ARROW_OPEN
{$$ = {"type":"arrow_open","stroke":"dotted","text":$2};}
| '==' text THICK_ARROW_POINT
{$$ = {"type":"arrow","stroke":"thick","text":$2};}
| '==' text THICK_ARROW_CIRCLE
{$$ = {"type":"arrow_circle","stroke":"thick","text":$2};}
| '==' text THICK_ARROW_CROSS
{$$ = {"type":"arrow_cross","stroke":"thick","text":$2};}
| '==' text THICK_ARROW_OPEN
{$$ = {"type":"arrow_open","stroke":"thick","text":$2};}
;
linkStatement: ARROW_POINT
{$$ = {"type":"arrow","stroke":"normal"};}
| ARROW_CIRCLE

File diff suppressed because one or more lines are too long

View File

@ -393,6 +393,29 @@ describe('when parsing ',function(){
});
it('should handle space and send',function(){
var res = flow.parser.parse('graph TD;A--text including URL space and send-->B;');
var vert = flow.parser.yy.getVertices();
var edges = flow.parser.yy.getEdges();
expect(edges[0].type).toBe('arrow');
expect(edges[0].text).toBe('text including URL space and send');
});
it('should handle space and send',function(){
var res = flow.parser.parse('graph TD;A-- text including URL space and send -->B;');
var vert = flow.parser.yy.getVertices();
var edges = flow.parser.yy.getEdges();
expect(edges[0].type).toBe('arrow');
expect(edges[0].text).toBe('text including URL space and send');
});
it('should handle space and dir (TD)',function(){
var res = flow.parser.parse('graph TD;A--x|text including R TD space|B;');

View File

@ -23,7 +23,7 @@
<body>
<h1>No line breaks</h1>
<div class="mermaid">
sequenceDiagram;Alice->>Bob: Hello Bob, how are you?;Bob-->Bob: Hmmm?;Bob-->Alice: Ok;
sequenceDiagram;Alice->>Bob: Hello Bob, how are you?;Bob-->Bob: Hmmm?;Bob-->Alice: Ok will send l8r;
</div>
<div class="mermaid">
sequenceDiagram;loop Daily query;Alice->>Bob: Hello Bob, how are you?;alt is sick;Bob->>Alice: Not so good :(;else is well;Bob->>Alice: Feeling fresh like a daisy;end;opt Extra response;Bob->>Alice: Thanks for asking;end;end;

View File

@ -30,10 +30,11 @@
<h1>Issue 2</h1>
<div class="mermaid">
graph LR
A[Square Rect] -- Link text --> B((Circle))
A[Square Rect] -- Link text --> B((Circle))
A[Square Rect]--Link text2-->D((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
B == testing ==> D{Rhombus}
C -.-> D
</div>
<h1>Issue </h1>
<div class="mermaid">