Comments (3)
install mmdc
Test Environment : Ubuntu 20.04
Install Node JS
Open Terminal and run commands.
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg git
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
ARCH=amd64
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
open terminal and run command
sudo npm install -g @mermaid-js/mermaid-cli
test mmdc version
$ mmdc --version
10.6.1
test mmdc with no parameter
$ mmdc
No input file specified, reading from stdin. If you want to specify an input file, please use `-i <input>.` You can use `-i -` to read from stdin and to suppress this warning.
Error: Could not find Chromium (rev. 1108766). This can occur if either
1. you did not perform an installation before running the script (e.g. `npm install`) or
2. your cache path is incorrectly configured (which is: /home/demouser1/.cache/puppeteer).
For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
at ChromeLauncher.resolveExecutablePath (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ProductLauncher.js:263:27)
at ChromeLauncher.executablePath (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:176:25)
at ChromeLauncher.computeLaunchArguments (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:93:37)
at async ChromeLauncher.launch (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ProductLauncher.js:57:28)
at async run (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:404:19)
at async cli (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:184:3)
Set Chrome as the default browser
please Set Chrome as the default browser
find google chrome location
$ which google-chrome
/usr/bin/google-chrome
Edit your .bashrc file
Add this line to your .bashrc
file then save it.
export PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome
then logout and login again or reboot.
test mmdc with no parameter again
$ mmdc
No input file specified, reading from stdin. If you want to specify an input file, please use `-i <input>.` You can use `-i -` to read from stdin and to suppress this warning.
(No error message)
Exit with Ctrl
+ C
create test file
input.mmd
graph
accTitle: My title here
accDescr: My description here
A-->B
Run test mmdc
$ mmdc -i input.mmd -o output2.png -t dark
Generating single mermaid chart
You can find generated file: output2.png
Test WIth AsciidocFX
create test1.adoc
.Mermaid Diagram https://github.com/mermaid-js/mermaid-cli
[mermaid,target="mermaid-diagram"]
--
graph
accTitle: My title here
accDescr: My description here
A-->B
--
[chapter-04.adoc.txt]
(https://github.com/asciidocfx/AsciidocFX/files/13405967/chapter-04.adoc.txt)
Update , add format example
.Mermaid Diagram https://github.com/mermaid-js/mermaid-cli
[mermaid, target="mermaid-diagram-1"]
--
graph
accTitle: My title here
accDescr: My description here
A-->B
--
.Mermaid Diagram 2 https://github.com/mermaid-js/mermaid-cli
[mermaid, target="mermaid-diagram-2", format="png"]
--
graph
accTitle: My title here
accDescr: My description here
A2-->B2
--
.Mermaid Diagram 3 https://github.com/mermaid-js/mermaid-cli
[mermaid, target="mermaid-diagram-3", format="svg"]
--
graph
accTitle: My title here
accDescr: My description here
A3-->B3
--
list version
$ node -v
v20.9.0
$ npm -v
10.1.0
$ mmdc --version
10.6.1
from asciidocfx.
I certainly get your point, nevertheless I am a bit confused by your example, because PlantUML should work out of the box.
from asciidocfx.
Ah good point. Sorry, looks like syntax might have changed since I last had this asciidoc open (it's been a couple years)? ditaa and uml seem to be working after all.
Might be good to explicitly note which extensions are pre-installed, and which need extra work?
Looks like Mermaid needs some help? installed via npm, but complains about PATH
, even after adding to path. Added to document variable, but hits:
Failed to generate image: mmdc failed: file:///home/gstewart/node_modules/@mermaid-js/mermaid-cli/src/index.js:262
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
from asciidocfx.
Related Issues (20)
- Cannot input Chinese character with Microsoft Pinyin IME.
- GUI blocked, no editing possible HOT 11
- GUI blocked : after pasting some text HOT 1
- GUI: Copy paste from asciddocFX to other apps ( notepad) is not working when using righ mouse menu
- Unable to launch in the last version HOT 4
- Keystrokes missed using editor in Windows (AsciidocFX version 1.8.8) HOT 2
- Shift-home and shift-end key combinations not working in Windows editor (AsciidocFX version 1.8.8) HOT 2
- After update, preferences are not fully transfered to new configuration
- add .docx (MSWord) file convert to asciidoc
- backup! enhancement request / proposal HOT 2
- PDF Text Color HOT 1
- Fix included: "Optional" option is not respected for include HOT 1
- strange positioning HOT 1
- Dead keys sometimes non-functioning (macOS, int'l keyboard)
- counter: wrong evaluation HOT 2
- Changing text color in preview HOT 3
- Stalls, AsciidocFX problem? HOT 2
- editing: do we have 'column marking'? If not: enhancement proposal.
- NASTY! - Preview position is way off when editing long documents #459 HOT 2
- search: wrong set of focus in edit window.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciidocfx.