Skip to content

Commit 29a07e1

Browse files
committed
(fix) Fix the CI to use Sphinx to build and deploy the doc (#11)
1 parent be201cc commit 29a07e1

2 files changed

Lines changed: 41 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
name: ci
2+
23
on:
34
push:
45
branches:
56
- master
67
- main
7-
permissions:
8-
contents: write
8+
99
jobs:
10-
deploy:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
- name: Configure Git Credentials
15-
run: |
16-
git config user.name github-actions[bot]
17-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
18-
- uses: actions/setup-python@v5
19-
with:
20-
python-version: 3.x
21-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22-
- uses: actions/cache@v4
23-
with:
24-
key: mkdocs-material-${{ env.cache_id }}
25-
path: .cache
26-
restore-keys: |
27-
mkdocs-material-
28-
- run: pip install mkdocs-material
29-
- run: mkdocs gh-deploy --force
10+
build-deploy:
11+
name: Build and deploy the documentation
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
submodules: true
20+
21+
- name: Setup Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.11'
25+
26+
- name: Install dependencies
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y make
30+
python -m pip install -U pip
31+
pip install -r requirements.txt
32+
pip install ghp-import
33+
34+
- name: Build
35+
run: |
36+
cd docs
37+
make html
38+
39+
- name: Deploy on the branch gh-pages
40+
run: |
41+
ghp-import -n -f -p ./docs/_build/html
42+

docs/_static/code_annotations.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ const cross_icon = '<path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.34
55

66
const icon_elem = '<svg version="1.1" width="1.0em" height="1.0em" class="sd-octicon sd-octicon-feed-plus sd-text-info code-annotation-icon" viewBox="0 0 16 16" aria-hidden="true">' + plus_icon + '</svg>';
77

8-
var selectedAnnotation = {
9-
"icon": null,
10-
"text": null
11-
}
8+
var selectedAnnotation = null;
129

1310
var selected_icon = null;
1411
var selected_text = null;
@@ -24,8 +21,7 @@ function areSelectedAnnotation() {
2421
* Update the selected annotation.
2522
*/
2623
function selectAnnotation(icon, text) {
27-
selectedAnnotation["icon"] = icon;
28-
selectedAnnotation["text"] = text;
24+
selectedAnnotation = {icon, text};
2925
}
3026

3127
/**
@@ -34,9 +30,8 @@ function selectAnnotation(icon, text) {
3430
*/
3531
function hideSelectedAnnotation() {
3632
if(areSelectedAnnotation()) {
37-
hideAnnotation(selected_icon, selected_text);
38-
selectedAnnotation["icon"] = null;
39-
selectedAnnotation["text"] = null;
33+
hideAnnotation(selectedAnnotation);
34+
selectedAnnotation = null;
4035
}
4136
}
4237

@@ -129,9 +124,9 @@ function onClickAnnotation(id) {
129124
const text = document.getElementById('code-annotation-text-' + id);
130125

131126
if(text.style.display == "none") {
132-
show_annotation(icon, text);
127+
show_annotation({icon, text});
133128
} else {
134-
hideAnnotation(icon, text);
129+
hideAnnotation({icon, text});
135130
}
136131
}
137132

0 commit comments

Comments
 (0)