mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
Compare commits
12 Commits
v9.2.0
...
3659_heigh
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4be66554b3 | ||
![]() |
57b883c7dd | ||
![]() |
af0f0ca526 | ||
![]() |
bc9ed8e1bd | ||
![]() |
673a2e8228 | ||
![]() |
75c67ed948 | ||
![]() |
353895dceb | ||
![]() |
e5c85cbc64 | ||
![]() |
2bb0cf17d1 | ||
![]() |
622b441eb0 | ||
![]() |
6f05d4b05a | ||
![]() |
ab5111e84f |
4
.github/workflows/docs.yml
vendored
4
.github/workflows/docs.yml
vendored
@@ -16,9 +16,9 @@ jobs:
|
||||
name: 'Docs: Spellcheck'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
name: Check out the code
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v3
|
||||
name: Setup node
|
||||
with:
|
||||
node-version: '16'
|
||||
|
@@ -56,21 +56,10 @@
|
||||
<body>
|
||||
<div>Security check</div>
|
||||
<pre id="diagram" class="mermaid">
|
||||
classDiagram
|
||||
direction LR
|
||||
class Student {
|
||||
-idCard : IdCard
|
||||
}
|
||||
class IdCard{
|
||||
-id : int
|
||||
-name : string
|
||||
}
|
||||
class Bike{
|
||||
-id : int
|
||||
-name : string
|
||||
}
|
||||
Student "1" --o "1" IdCard : carries
|
||||
Student "1" --o "1" Bike : rides
|
||||
flowchart TD
|
||||
A --> B
|
||||
B --> C
|
||||
A --> C
|
||||
</pre>
|
||||
<pre id="diagram" class="mermaid2">
|
||||
mindmap
|
||||
@@ -98,8 +87,14 @@ mindmap
|
||||
::icon(mdi mdi-fire)
|
||||
gc7((grand<br/>grand<br/>child 8))
|
||||
</pre>
|
||||
<pre id="diagram" class="mermaid2">
|
||||
example-diagram
|
||||
<pre id="diagram" class="mermaid">
|
||||
gantt
|
||||
title Style today marker (vertical line should be 5px wide and half-transparent blue)
|
||||
dateFormat YYYY-MM-DD
|
||||
axisFormat %d
|
||||
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
||||
section Section1
|
||||
Today: 1, -1h
|
||||
</pre>
|
||||
|
||||
<!-- <div id="cy"></div> -->
|
||||
@@ -116,13 +111,18 @@ mindmap
|
||||
theme: 'forest',
|
||||
startOnLoad: true,
|
||||
logLevel: 0,
|
||||
// basePath: './packages/',
|
||||
// themeVariables: { darkMode: true },
|
||||
flowchart: {
|
||||
useMaxWidth: false,
|
||||
htmlLabels: true,
|
||||
},
|
||||
gantt: {
|
||||
useMaxWidth: false,
|
||||
},
|
||||
useMaxWidth: false,
|
||||
lazyLoadedDiagrams: [
|
||||
'./mermaid-mindmap-detector.esm.mjs',
|
||||
'./mermaid-example-diagram-detector.esm.mjs',
|
||||
],
|
||||
// lazyLoadedDiagrams: ['../../mermaid-mindmap/registry.ts'],
|
||||
});
|
||||
function callback() {
|
||||
alert('It worked');
|
||||
|
@@ -315,13 +315,13 @@ flowchart LR
|
||||
### Dotted link
|
||||
|
||||
```mermaid-example
|
||||
flowchart LR;
|
||||
A-.->B;
|
||||
flowchart LR
|
||||
A-.->B
|
||||
```
|
||||
|
||||
```mermaid
|
||||
flowchart LR;
|
||||
A-.->B;
|
||||
flowchart LR
|
||||
A-.->B
|
||||
```
|
||||
|
||||
### Dotted link with text
|
||||
@@ -866,13 +866,13 @@ A shorter form of adding a class is to attach the classname to the node using th
|
||||
```mermaid-example
|
||||
flowchart LR
|
||||
A:::someclass --> B
|
||||
classDef someclass fill:#f96;
|
||||
classDef someclass fill:#f96
|
||||
```
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A:::someclass --> B
|
||||
classDef someclass fill:#f96;
|
||||
classDef someclass fill:#f96
|
||||
```
|
||||
|
||||
### Css classes
|
||||
@@ -895,14 +895,14 @@ below:
|
||||
**Example definition**
|
||||
|
||||
```mermaid-example
|
||||
flowchart LR;
|
||||
flowchart LR
|
||||
A-->B[AAA<span>BBB</span>]
|
||||
B-->D
|
||||
class A cssClass
|
||||
```
|
||||
|
||||
```mermaid
|
||||
flowchart LR;
|
||||
flowchart LR
|
||||
A-->B[AAA<span>BBB</span>]
|
||||
B-->D
|
||||
class A cssClass
|
||||
@@ -924,7 +924,7 @@ The icons are accessed via the syntax fa:#icon class name#.
|
||||
flowchart TD
|
||||
B["fab:fa-twitter for peace"]
|
||||
B-->C[fa:fa-ban forbidden]
|
||||
B-->D(fa:fa-spinner);
|
||||
B-->D(fa:fa-spinner)
|
||||
B-->E(A fa:fa-camera-retro perhaps?)
|
||||
```
|
||||
|
||||
@@ -932,7 +932,7 @@ flowchart TD
|
||||
flowchart TD
|
||||
B["fab:fa-twitter for peace"]
|
||||
B-->C[fa:fa-ban forbidden]
|
||||
B-->D(fa:fa-spinner);
|
||||
B-->D(fa:fa-spinner)
|
||||
B-->E(A fa:fa-camera-retro perhaps?)
|
||||
```
|
||||
|
||||
|
@@ -35,7 +35,7 @@ import { exec } from 'child_process';
|
||||
import { globby } from 'globby';
|
||||
import { JSDOM } from 'jsdom';
|
||||
import type { Code, Root } from 'mdast';
|
||||
import { join, dirname } from 'path';
|
||||
import { posix, dirname } from 'path';
|
||||
import prettier from 'prettier';
|
||||
import { remark } from 'remark';
|
||||
// @ts-ignore No typescript declaration file
|
||||
@@ -210,30 +210,28 @@ const transformHtml = (filename: string) => {
|
||||
copyTransformedContents(filename, !verifyOnly, formattedHTML);
|
||||
};
|
||||
|
||||
const getFilesFromGlobs = async (globs: string[]): Promise<string[]> => {
|
||||
return await globby(globs, { dot: true });
|
||||
};
|
||||
|
||||
/** Main method (entry point) */
|
||||
(async () => {
|
||||
if (verifyOnly) {
|
||||
console.log('Verifying that all files are in sync with the source files');
|
||||
}
|
||||
const sourceDirGlob = join('.', SOURCE_DOCS_DIR, '**');
|
||||
const includeFilesStartingWithDot = true;
|
||||
const sourceDirGlob = posix.join('.', SOURCE_DOCS_DIR, '**');
|
||||
const action = verifyOnly ? 'Verifying' : 'Transforming';
|
||||
|
||||
console.log('Transforming markdown files...');
|
||||
const mdFiles = await globby([join(sourceDirGlob, '*.md')], {
|
||||
dot: includeFilesStartingWithDot,
|
||||
});
|
||||
const mdFiles = await getFilesFromGlobs([posix.join(sourceDirGlob, '*.md')]);
|
||||
console.log(`${action} ${mdFiles.length} markdown files...`);
|
||||
mdFiles.forEach(transformMarkdown);
|
||||
|
||||
console.log('Transforming html files...');
|
||||
const htmlFiles = await globby([join(sourceDirGlob, '*.html')], {
|
||||
dot: includeFilesStartingWithDot,
|
||||
});
|
||||
const htmlFiles = await getFilesFromGlobs([posix.join(sourceDirGlob, '*.html')]);
|
||||
console.log(`${action} ${htmlFiles.length} html files...`);
|
||||
htmlFiles.forEach(transformHtml);
|
||||
|
||||
console.log('Transforming all other files...');
|
||||
const otherFiles = await globby([sourceDirGlob, '!**/*.md', '!**/*.html'], {
|
||||
dot: includeFilesStartingWithDot,
|
||||
});
|
||||
const otherFiles = await getFilesFromGlobs([sourceDirGlob, '!**/*.md', '!**/*.html']);
|
||||
console.log(`${action} ${otherFiles.length} other files...`);
|
||||
otherFiles.forEach((file: string) => {
|
||||
copyTransformedContents(file, !verifyOnly); // no transformation
|
||||
});
|
||||
@@ -244,7 +242,7 @@ const transformHtml = (filename: string) => {
|
||||
process.exit(1);
|
||||
}
|
||||
if (git) {
|
||||
console.log('Adding changes in ${FINAL_DOCS_DIR} folder to git');
|
||||
console.log(`Adding changes in ${FINAL_DOCS_DIR} folder to git`);
|
||||
exec('git add docs');
|
||||
}
|
||||
}
|
||||
|
@@ -198,8 +198,8 @@ flowchart LR
|
||||
### Dotted link
|
||||
|
||||
```mermaid-example
|
||||
flowchart LR;
|
||||
A-.->B;
|
||||
flowchart LR
|
||||
A-.->B
|
||||
```
|
||||
|
||||
### Dotted link with text
|
||||
@@ -587,7 +587,7 @@ A shorter form of adding a class is to attach the classname to the node using th
|
||||
```mermaid-example
|
||||
flowchart LR
|
||||
A:::someclass --> B
|
||||
classDef someclass fill:#f96;
|
||||
classDef someclass fill:#f96
|
||||
```
|
||||
|
||||
### Css classes
|
||||
@@ -610,7 +610,7 @@ below:
|
||||
**Example definition**
|
||||
|
||||
```mermaid-example
|
||||
flowchart LR;
|
||||
flowchart LR
|
||||
A-->B[AAA<span>BBB</span>]
|
||||
B-->D
|
||||
class A cssClass
|
||||
@@ -634,7 +634,7 @@ The icons are accessed via the syntax fa:#icon class name#.
|
||||
flowchart TD
|
||||
B["fab:fa-twitter for peace"]
|
||||
B-->C[fa:fa-ban forbidden]
|
||||
B-->D(fa:fa-spinner);
|
||||
B-->D(fa:fa-spinner)
|
||||
B-->E(A fa:fa-camera-retro perhaps?)
|
||||
```
|
||||
|
||||
|
@@ -26,6 +26,7 @@ export const calculateSvgSizeAttrs = function (height, width, useMaxWidth) {
|
||||
attrs.set('width', '100%');
|
||||
attrs.set('style', `max-width: ${width}px;`);
|
||||
} else {
|
||||
attrs.set('height', height);
|
||||
attrs.set('width', width);
|
||||
}
|
||||
return attrs;
|
||||
|
Reference in New Issue
Block a user