Skip to content

Commit 8855b93

Browse files
committed
Add mermaid diagram support to documentation
1 parent 91f2e45 commit 8855b93

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.github/workflows/publish.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ jobs:
1010
uses: actions/checkout@v3
1111

1212
- name: Install doxygen
13-
run: sudo apt install doxygen graphviz pandoc
13+
run: sudo apt install doxygen graphviz pandoc npm
1414

1515
- name: Install python modules
1616
run: sudo python3 -m pip install gitpython pandocfilters
1717

18+
- name: Install mermaid diagram filter
19+
run: sudo npm install --global mermaid-filter
20+
1821
- name: Build documentation
1922
run: cd doc/doxygen-root && make && touch html/.nojekyll
2023

doc/doxygen-root/doxygen-markdown/markdown.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ $BINDIR/append-last-modified-dates.py $FILES
3434
# $BINDIR/pandoc-codeblock-repair.sh > $file
3535
# done
3636

37+
echo
38+
echo "Rendering mermaid diagrams"
39+
FILES=$(grep --include=\*.md -rl . -e "\`\`\`mermaid")
40+
for file in $FILES; do
41+
echo $file
42+
tmp=/tmp/${file%.*}2.md
43+
mkdir -p $(dirname $tmp)
44+
cp $file $tmp
45+
pandoc --write=markdown_phpextra --wrap=none --filter=mermaid-filter $tmp |
46+
$BINDIR/pandoc-codeblock-repair.sh > $file
47+
done
48+
3749
cprovers=$(find . -name cprover-manual)
3850
cprover=${cprovers[0]}
3951

@@ -49,7 +61,7 @@ echo "Running pandoc filter over cprover-manual markdown files"
4961
FILES=$(find $cprover -name '*.md')
5062
for file in $FILES; do
5163
echo $file
52-
tmp=/tmp/${file%.*}2.md
64+
tmp=/tmp/${file%.*}3.md
5365
mkdir -p $(dirname $tmp)
5466
cp $file $tmp
5567
pandoc --write=markdown_phpextra --wrap=none --filter=$BINDIR/pandoc-cprover-link-filter.py $tmp |

0 commit comments

Comments
 (0)