From 6d9834b1ea93d917f34e4e7eb4f4702250e25001 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Sun, 29 Oct 2017 22:54:44 +0100 Subject: [PATCH] changed fixed versions to mermaid 7.0.0 and phantomjs 2.1.4 because of bug in drawing arrows in mermaid >7.0.0 --- Dockerfile | 8 +------- README.md | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index e615d3c..4c31fad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,6 @@ FROM node:8.8.1 -RUN mkdir /tmp/phantomjs \ - && curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \ - | tar -xj --strip-components=1 -C /tmp/phantomjs \ - && mv /tmp/phantomjs/bin/phantomjs /usr/bin \ - && rm -rf /tmp/phantomjs - -RUN yarn global add mermaid@7.0.11 +RUN yarn global add phantomjs-prebuilt@2.1.14 mermaid@7.0.0 WORKDIR /data diff --git a/README.md b/README.md index afb0c2f..a307802 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # Docker container for mermaid -[mermaid](http://knsv.github.io/mermaid/) is an open source tool for generating diagram and flowchart from text in a similar manner as markdown. This docker image contains mermaid 7.0.11 and is build on top of the official node 8.8.1 image. Installing the dependency phantomjs is tricky. I chose the solution from [jribar](https://hub.docker.com/r/jribar/node-phantomjs/~/dockerfile/). +[mermaid](http://knsv.github.io/mermaid/) is an open source tool for generating diagram and flowchart from text in a similar manner as markdown. This docker image contains mermaid 7.0.0 and is build on top of the official node 8.8.1 image. * [GitHub Repository with Dockerbuild files](https://github.com/felixlohmeier/mermaid-docker) * [Docker Hub with docker images](https://hub.docker.com/r/felixlohmeier/mermaid) ## fixed versions -* [mermaid 7.0.11](https://www.npmjs.com/package/mermaid) +* [mermaid 7.0.0](https://yarn.pm/mermaid) * [node 8.8.1](https://hub.docker.com/_/node/) -* [phantomjs 2.1.1](https://bitbucket.org/ariya/phantomjs/downloads/) +* [phantomjs 2.1.4](https://yarn.pm/phantomjs-prebuilt) ## usage @@ -18,7 +18,15 @@ ## typical workflow 1. Create your graph in [mermaid's live editor](https://mermaidjs.github.io/mermaid-live-editor/) -2. Copy & paste your graph config in a text editor and save as myflowchart.mmd -3. Run docker to create png and/or svg. Example (render svg and png; width of the generated png: 600 pixel): +2. Copy & paste your graph config in a text editor and save it to a local file +3. Download a stylesheet from (and customize it if you want) +4. Run this docker container to create png and svg. -> docker run --rm -v "$PWD":/data:z mermaid -s -p -w 600 myflowchart.mmd +## Example + +* render both formats (svg + png): `-s -p` +* width of the png: 600 pixel: `-w 600` +* apply custom stylesheet [mermaid.neutral.css](https://unpkg.com/mermaid@7.0.13/dist/themes/mermaid.neutral.css) from local file `-t mermaid.neutral.css` +* name of local file containing graph config: `myflowchart.mmd` + +> docker run --rm -v "$PWD":/data:z felixlohmeier/mermaid -s -p -w 600 -t mermaid.neutral.css myflowchart.mmd \ No newline at end of file