tomwright / mermaid-server Goto Github PK
View Code? Open in Web Editor NEWGo implementation of a HTTP server to allow remote generation of mermaid-js diagrams without any pre-requisites installed locally.
Go implementation of a HTTP server to allow remote generation of mermaid-js diagrams without any pre-requisites installed locally.
When I try to start mermaid-server for the first time using docker command. The docker container returns instantly, I go to the output and see this:
node: bad option: --allow-all-origins=true
I run the command found on this repo's readme file:
docker run -d --name mermaid-server -p 80:80 tomwright/mermaid-server:latest --allow-all-origins=true
As mentioned in mermaid-js/mermaid-cli#112 my text elements are not shown. Is it possible to pass a config like mmdc -c ~/.config/mermaid/config.json?
By executing command on Mac M1 Max:
docker run -d --name mermaid-server -p 88:80 tomwright/mermaid-server:latest
This error will appear:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Hi Tom,
This is a great project, wel done!
I managed to get it working.
Could you help to fix the issue with special characters?
graph LR
p1[" Implementation "]
p2[[" Office 365 โญ๏ธ "]]p1 --- p2
After encoding (UTF-8) the special chars are changed. Attached is a picture of the input and output in Postman.
In the live editor it works fine.
Cors not enabled?
There is currently no clean-up of old diagrams.
Ideally a we should have a go-routine running to clean-up any diagrams that haven't been accessed without a given amount of time.
Tracking this here in case it's relevant / actionable...
When running the docker container (make docker-run
), and making a request, it looks like the "in" file (.mmd
) gets written, but the "out" file (.svg
) doesn't get written, and the container returns a 500
.
I made a slight modification to the Makefile
in order to build the docker image on my M1 Mac.
docker-image:
docker buildx build --platform linux/amd64 -t ${DOCKER_IMAGE} .
Docker logs
2022/08/04 14:01:53 [500] could not generate diagram: cachingGenerater.generate failed: failed when executing mermaid: exit status 1: Generating single mermaid chart
:
ProtocolError: Protocol error (Target.createTarget): Target closed.
at /usr/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:103:24
at new Promise (<anonymous>)
at Connection.send (/usr/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:99:16)
at Browser._createPageInContext (/usr/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:258:91)
at BrowserContext.newPage (/usr/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:622:75)
at Browser.newPage (/usr/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:252:75)
at /usr/app/node_modules/@mermaid-js/mermaid-cli/index.bundle.js:174:32
at Generator.next (<anonymous>)
at asyncGeneratorStep (/usr/app/node_modules/@mermaid-js/mermaid-cli/index.bundle.js:18:103)
at _next (/usr/app/node_modules/@mermaid-js/mermaid-cli/index.bundle.js:20:194)
This puppeteer/puppeteer#1947 issue seems to be related
Any plans to make this Deno compatible?
Sometimes, rendering results are truncated and displayed incompletely. Here are the cases I have tested:
curl --location 'http://182.195.92.127:8082/generate' \
--header 'Content-Type: text/plain' \
--data 'graph
a --> b1
d --> b3
a --> b2
a --> b3
b1 --> c
b2 --> c
b3 --> c
c --> d
e --> f
f --> d
'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.