Skip to content

Commit 4cadc31

Browse files
committed
support github CI with mermaid
1 parent d8a03c8 commit 4cadc31

File tree

4 files changed

+41903
-5
lines changed

4 files changed

+41903
-5
lines changed

.github/workflows/deploy.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
run: pip install -r requirements.txt
2020

2121
- name: build doc
22-
run: make html
22+
run: |
23+
make html
24+
cp scripts/mermaid.js build/html/_static/
2325
2426
- name: create .nojekyll
2527
run: touch build/html/.nojekyll

scripts/deploy.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
7+
jobs:
8+
deploy-doc:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
submodules: "true"
15+
- uses: actions/setup-python@v2
16+
with:
17+
python-version: "3.10"
18+
- name: Install dependencies
19+
run: pip install -r requirements.txt
20+
21+
- name: install chrome
22+
run: apt-get update \
23+
&& apt-get install -y wget gnupg \
24+
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
25+
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
26+
&& apt-get update \
27+
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
28+
--no-install-recommends \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
- name: Use Node.js
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: "16.x"
35+
36+
- name: Install dependencies
37+
run: npm install -g @mermaid-js/mermaid-cli
38+
39+
- name: build doc
40+
run: make html
41+
42+
- name: create .nojekyll
43+
run: touch build/html/.nojekyll
44+
45+
- name: Push to gh-pages
46+
uses: peaceiris/actions-gh-pages@v3
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: ./build/html

scripts/mermaid.js

+41,846
Large diffs are not rendered by default.

source/conf.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
"sphinxcontrib.mermaid"
3838
]
3939

40-
mermaid_output_format = 'png'
41-
mermaid_version = ''
40+
# mermaid_output_format = 'png'
41+
mermaid_output_format = 'raw'
42+
mermaid_version = '9.3.0'
4243
html_js_files = [
43-
'js/mermaid.js'
44+
'mermaid.js'
4445
]
45-
mermaid_params = ['--puppeteerConfigFile', '/home/chyyuu/thecodes/rCore-Tutorial-Book-v3/puppeteerConfigFile.json']
46+
# mermaid_params = ['--puppeteerConfigFile', '/home/chyyuu/thecodes/rCore-Tutorial-Book-v3/puppeteerConfigFile.json']
4647

4748
comments_config = {
4849
"utterances": {

0 commit comments

Comments
 (0)