The following assumes that :
- the Markdown file foo.md needs converting to foo.html
- pandoc is installed
- easy-pandoc-templates (https://github.com/ryangrose/easy-pandoc-templates) have been downloaded and copied to ~/.pandoc/templates
curl 'https://raw.githubusercontent.com/ryangrose/easy-pandoc-templates/master/copy_templates.sh' | bash
- mermaid-filter (https://github.com/raghur/mermaid-filter) has not yet been installed, and you wish to install it locally.
mkdir my-mermaid-project
cd my-mermaid-project
npm init -y
npm install mermaid-filter
cd ..
pandoc -F ./my-mermaid-project/node_modules/.bin/mermaid-filter --template=clean_menu.html -f markdown -t html5 -o ./foo.html ./foo.md
To date I have not been able to render the mermaid format entity-relationship diagrams to HTML directly. However I have been able to render them to SVG and PDF.
First install mermaid-client (in this example I have a NPM project within my-mermaid-project and I am installing the package locally into that).
cd my-mermaid-project
npm install @mermaid-js/mermaid-cli
Assume that a Markdown file exists which contains only the mermaid diagram (a more complex input may work but I haven't yet tested that), now execute the following command.
./my-mermaid-project/node_modules/.bin/mmdc -e pdf -i ./shea-test-material/test2.md -o ./shea-test-material/test2.pdf