Cleanup whitespaces

This commit is contained in:
Sidharth Vinod
2023-02-19 17:41:44 +05:30
parent e0951150b4
commit ac91b9db7a
11 changed files with 48 additions and 48 deletions

View File

@@ -17,7 +17,7 @@
<h1>Journey diagram demo</h1> <h1>Journey diagram demo</h1>
<pre class="mermaid"> <pre class="mermaid">
--- ---
title: My working day title: My working day
--- ---
journey journey
accTitle: Very simple journey demo accTitle: Very simple journey demo

View File

@@ -150,22 +150,22 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multiline");}
"Node_R" { this.begin("node_r"); return 'NODE_R';} "Node_R" { this.begin("node_r"); return 'NODE_R';}
"Rel" { this.begin("rel"); return 'REL';} "Rel" { this.begin("rel"); return 'REL';}
"BiRel" { this.begin("birel"); return 'BIREL';} "BiRel" { this.begin("birel"); return 'BIREL';}
"Rel_Up" { this.begin("rel_u"); return 'REL_U';} "Rel_Up" { this.begin("rel_u"); return 'REL_U';}
"Rel_U" { this.begin("rel_u"); return 'REL_U';} "Rel_U" { this.begin("rel_u"); return 'REL_U';}
"Rel_Down" { this.begin("rel_d"); return 'REL_D';} "Rel_Down" { this.begin("rel_d"); return 'REL_D';}
"Rel_D" { this.begin("rel_d"); return 'REL_D';} "Rel_D" { this.begin("rel_d"); return 'REL_D';}
"Rel_Left" { this.begin("rel_l"); return 'REL_L';} "Rel_Left" { this.begin("rel_l"); return 'REL_L';}
"Rel_L" { this.begin("rel_l"); return 'REL_L';} "Rel_L" { this.begin("rel_l"); return 'REL_L';}
"Rel_Right" { this.begin("rel_r"); return 'REL_R';} "Rel_Right" { this.begin("rel_r"); return 'REL_R';}
"Rel_R" { this.begin("rel_r"); return 'REL_R';} "Rel_R" { this.begin("rel_r"); return 'REL_R';}
"Rel_Back" { this.begin("rel_b"); return 'REL_B';} "Rel_Back" { this.begin("rel_b"); return 'REL_B';}
"RelIndex" { this.begin("rel_index"); return 'REL_INDEX';} "RelIndex" { this.begin("rel_index"); return 'REL_INDEX';}
"UpdateElementStyle" { this.begin("update_el_style"); return 'UPDATE_EL_STYLE';} "UpdateElementStyle" { this.begin("update_el_style"); return 'UPDATE_EL_STYLE';}
"UpdateRelStyle" { this.begin("update_rel_style"); return 'UPDATE_REL_STYLE';} "UpdateRelStyle" { this.begin("update_rel_style"); return 'UPDATE_REL_STYLE';}
"UpdateLayoutConfig" { this.begin("update_layout_config"); return 'UPDATE_LAYOUT_CONFIG';} "UpdateLayoutConfig" { this.begin("update_layout_config"); return 'UPDATE_LAYOUT_CONFIG';}
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config><<EOF>> return "EOF_IN_STRUCT"; <person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config><<EOF>> return "EOF_IN_STRUCT";
<person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config>[(][ ]*[,] { this.begin("attribute"); return "ATTRIBUTE_EMPTY";} <person,person_ext,system_ext_queue,system_ext_db,system_ext,system_queue,system_db,system,boundary,enterprise_boundary,system_boundary,container_ext_db,container_ext,container_queue,container_db,container,container_boundary,component_ext_db,component_ext,component_queue,component_db,component,node,node_l,node_r,rel,birel,rel_u,rel_d,rel_l,rel_r,rel_b,rel_index,update_el_style,update_rel_style,update_layout_config>[(][ ]*[,] { this.begin("attribute"); return "ATTRIBUTE_EMPTY";}
@@ -189,7 +189,7 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multiline");}
'{' { /* this.begin("lbrace"); */ return "LBRACE";} '{' { /* this.begin("lbrace"); */ return "LBRACE";}
'}' { /* this.popState(); */ return "RBRACE";} '}' { /* this.popState(); */ return "RBRACE";}
[\s]+ return 'SPACE'; [\s]+ return 'SPACE';
[\n\r]+ return 'EOL'; [\n\r]+ return 'EOL';
<<EOF>> return 'EOF'; <<EOF>> return 'EOF';
@@ -257,7 +257,7 @@ graphConfig
statements statements
: otherStatements : otherStatements
| diagramStatements | diagramStatements
| otherStatements diagramStatements | otherStatements diagramStatements
; ;
otherStatements otherStatements
@@ -268,10 +268,10 @@ otherStatements
otherStatement otherStatement
: title {yy.setTitle($1.substring(6));$$=$1.substring(6);} : title {yy.setTitle($1.substring(6));$$=$1.substring(6);}
| accDescription {yy.setAccDescription($1.substring(15));$$=$1.substring(15);} | accDescription {yy.setAccDescription($1.substring(15));$$=$1.substring(15);}
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); } | acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); } | acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); } | acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }
; ;
boundaryStatement boundaryStatement
@@ -301,7 +301,7 @@ boundaryStopStatement
diagramStatements diagramStatements
: diagramStatement : diagramStatement
| diagramStatement NEWLINE | diagramStatement NEWLINE
| diagramStatement NEWLINE statements | diagramStatement NEWLINE statements
; ;
diagramStatement diagramStatement
@@ -312,19 +312,19 @@ diagramStatement
| SYSTEM_QUEUE attributes {yy.addPersonOrSystem('system_queue', ...$2); $$=$2;} | SYSTEM_QUEUE attributes {yy.addPersonOrSystem('system_queue', ...$2); $$=$2;}
| SYSTEM_EXT attributes {yy.addPersonOrSystem('external_system', ...$2); $$=$2;} | SYSTEM_EXT attributes {yy.addPersonOrSystem('external_system', ...$2); $$=$2;}
| SYSTEM_EXT_DB attributes {yy.addPersonOrSystem('external_system_db', ...$2); $$=$2;} | SYSTEM_EXT_DB attributes {yy.addPersonOrSystem('external_system_db', ...$2); $$=$2;}
| SYSTEM_EXT_QUEUE attributes {yy.addPersonOrSystem('external_system_queue', ...$2); $$=$2;} | SYSTEM_EXT_QUEUE attributes {yy.addPersonOrSystem('external_system_queue', ...$2); $$=$2;}
| CONTAINER attributes {yy.addContainer('container', ...$2); $$=$2;} | CONTAINER attributes {yy.addContainer('container', ...$2); $$=$2;}
| CONTAINER_DB attributes {yy.addContainer('container_db', ...$2); $$=$2;} | CONTAINER_DB attributes {yy.addContainer('container_db', ...$2); $$=$2;}
| CONTAINER_QUEUE attributes {yy.addContainer('container_queue', ...$2); $$=$2;} | CONTAINER_QUEUE attributes {yy.addContainer('container_queue', ...$2); $$=$2;}
| CONTAINER_EXT attributes {yy.addContainer('external_container', ...$2); $$=$2;} | CONTAINER_EXT attributes {yy.addContainer('external_container', ...$2); $$=$2;}
| CONTAINER_EXT_DB attributes {yy.addContainer('external_container_db', ...$2); $$=$2;} | CONTAINER_EXT_DB attributes {yy.addContainer('external_container_db', ...$2); $$=$2;}
| CONTAINER_EXT_QUEUE attributes {yy.addContainer('external_container_queue', ...$2); $$=$2;} | CONTAINER_EXT_QUEUE attributes {yy.addContainer('external_container_queue', ...$2); $$=$2;}
| COMPONENT attributes {yy.addComponent('component', ...$2); $$=$2;} | COMPONENT attributes {yy.addComponent('component', ...$2); $$=$2;}
| COMPONENT_DB attributes {yy.addComponent('component_db', ...$2); $$=$2;} | COMPONENT_DB attributes {yy.addComponent('component_db', ...$2); $$=$2;}
| COMPONENT_QUEUE attributes {yy.addComponent('component_queue', ...$2); $$=$2;} | COMPONENT_QUEUE attributes {yy.addComponent('component_queue', ...$2); $$=$2;}
| COMPONENT_EXT attributes {yy.addComponent('external_component', ...$2); $$=$2;} | COMPONENT_EXT attributes {yy.addComponent('external_component', ...$2); $$=$2;}
| COMPONENT_EXT_DB attributes {yy.addComponent('external_component_db', ...$2); $$=$2;} | COMPONENT_EXT_DB attributes {yy.addComponent('external_component_db', ...$2); $$=$2;}
| COMPONENT_EXT_QUEUE attributes {yy.addComponent('external_component_queue', ...$2); $$=$2;} | COMPONENT_EXT_QUEUE attributes {yy.addComponent('external_component_queue', ...$2); $$=$2;}
| boundaryStatement | boundaryStatement
| REL attributes {yy.addRel('rel', ...$2); $$=$2;} | REL attributes {yy.addRel('rel', ...$2); $$=$2;}
| BIREL attributes {yy.addRel('birel', ...$2); $$=$2;} | BIREL attributes {yy.addRel('birel', ...$2); $$=$2;}

View File

@@ -76,12 +76,12 @@ o\{ return 'ZERO_OR_MORE';
start start
: 'ER_DIAGRAM' document 'EOF' { /*console.log('finished parsing');*/ } : 'ER_DIAGRAM' document 'EOF' { /*console.log('finished parsing');*/ }
| directive start | directive start
; ;
document document
: /* empty */ { $$ = [] } : /* empty */ { $$ = [] }
| document line {$1.push($2);$$ = $1} | document line {$1.push($2);$$ = $1}
; ;
line line

View File

@@ -32,7 +32,7 @@ const getStyles = (options) =>
text-anchor: middle; text-anchor: middle;
font-size: 18px; font-size: 18px;
fill: ${options.textColor}; fill: ${options.textColor};
} }
`; `;
export default getStyles; export default getStyles;

View File

@@ -20,7 +20,7 @@ const getStyles = (options) => `
stroke: ${options.requirementBorderColor}; stroke: ${options.requirementBorderColor};
stroke-width: ${options.requirementBorderSize}; stroke-width: ${options.requirementBorderSize};
} }
.reqTitle, .reqLabel{ .reqTitle, .reqLabel{
fill: ${options.requirementTextColor}; fill: ${options.requirementTextColor};
} }

View File

@@ -117,7 +117,7 @@ describe('state parser can parse...', () => {
state "Big State 1" as bigState1 { state "Big State 1" as bigState1 {
state "inner state 1" as inner1 state "inner state 1" as inner1
inner2: inner state 2 inner2: inner state 2
inner1 --> inner2 inner1 --> inner2
}`; }`;
stateDiagram.parser.parse(diagramText); stateDiagram.parser.parse(diagramText);
stateDiagram.parser.yy.extract(stateDiagram.parser.yy.getRootDocV2()); stateDiagram.parser.yy.extract(stateDiagram.parser.yy.getRootDocV2());

View File

@@ -241,7 +241,7 @@ statement
$$={ stmt: 'state', id: $3.trim(), note:{position: $2.trim(), text: $4.trim()}}; $$={ stmt: 'state', id: $3.trim(), note:{position: $2.trim(), text: $4.trim()}};
} }
| note NOTE_TEXT AS ID | note NOTE_TEXT AS ID
| directive | directive
| direction | direction
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); } | acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); } | acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }

View File

@@ -93,7 +93,7 @@ const generateHeader = (file: string): string => {
const sourcePathRelativeToGenerated = posix.join(relativePath, filePathFromRoot); const sourcePathRelativeToGenerated = posix.join(relativePath, filePathFromRoot);
return ` return `
> **Warning** > **Warning**
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. > ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
> ## Please edit the corresponding file in [${filePathFromRoot}](${sourcePathRelativeToGenerated}).`; > ## Please edit the corresponding file in [${filePathFromRoot}](${sourcePathRelativeToGenerated}).`;
}; };

View File

@@ -35,7 +35,7 @@ const MermaidExample = async (md: MarkdownRenderer) => {
} else if (token.info.trim() === 'mermaid') { } else if (token.info.trim() === 'mermaid') {
const key = index; const key = index;
return ` return `
<Suspense> <Suspense>
<template #default> <template #default>
<Mermaid id="mermaid-${key}" graph="${encodeURIComponent(token.content)}"></Mermaid> <Mermaid id="mermaid-${key}" graph="${encodeURIComponent(token.content)}"></Mermaid>
</template> </template>

View File

@@ -94,9 +94,9 @@ b. The importing of mermaid library through the `mermaid.esm.js` or `mermaid.esm
<body> <body>
Here is a mermaid diagram: Here is a mermaid diagram:
<pre class="mermaid"> <pre class="mermaid">
graph TD graph TD
A[Client] --> B[Load Balancer] A[Client] --> B[Load Balancer]
B --> C[Server01] B --> C[Server01]
B --> D[Server02] B --> D[Server02]
</pre> </pre>
</body> </body>
@@ -139,18 +139,18 @@ Please refer to the [Mindmap](../syntax/mindmap.md?id=integrating-with-your-libr
<body> <body>
Here is one mermaid diagram: Here is one mermaid diagram:
<pre class="mermaid"> <pre class="mermaid">
graph TD graph TD
A[Client] --> B[Load Balancer] A[Client] --> B[Load Balancer]
B --> C[Server1] B --> C[Server1]
B --> D[Server2] B --> D[Server2]
</pre> </pre>
And here is another: And here is another:
<pre class="mermaid"> <pre class="mermaid">
graph TD graph TD
A[Client] -->|tcp_123| B A[Client] -->|tcp_123| B
B(Load Balancer) B(Load Balancer)
B -->|tcp_456| C[Server1] B -->|tcp_456| C[Server1]
B -->|tcp_456| D[Server2] B -->|tcp_456| D[Server2]
</pre> </pre>
@@ -172,15 +172,15 @@ In this example mermaid.js is referenced in `src` as a separate JavaScript file,
</head> </head>
<body> <body>
<pre class="mermaid"> <pre class="mermaid">
graph LR graph LR
A --- B A --- B
B-->C[fa:fa-ban forbidden] B-->C[fa:fa-ban forbidden]
B-->D(fa:fa-spinner); B-->D(fa:fa-spinner);
</pre> </pre>
<pre class="mermaid"> <pre class="mermaid">
graph TD graph TD
A[Client] --> B[Load Balancer] A[Client] --> B[Load Balancer]
B --> C[Server1] B --> C[Server1]
B --> D[Server2] B --> D[Server2]
</pre> </pre>
<script type="module"> <script type="module">

View File

@@ -396,7 +396,7 @@ Spaces can be added to a state by first defining the state with an id and then r
In the following example there is a state with the id **yswsii** and description **Your state with spaces in it**. In the following example there is a state with the id **yswsii** and description **Your state with spaces in it**.
After it has been defined, **yswsii** is used in the diagram in the first transition (`[*] --> yswsii`) After it has been defined, **yswsii** is used in the diagram in the first transition (`[*] --> yswsii`)
and also in the transition to **YetAnotherState** (`yswsii --> YetAnotherState`). and also in the transition to **YetAnotherState** (`yswsii --> YetAnotherState`).
(**yswsii** has been styled so that it is different from the other states.) (**yswsii** has been styled so that it is different from the other states.)
```mermaid-example ```mermaid-example