Skip to content

Commit 4483afe

Browse files
switch to mkdocs (#50)
* switch to mkdocs * Update docs/gen_cli_doc.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update comment in docs/src/lib.rs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * update name of CI job's step * add to social icons --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 275f189 commit 4483afe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+890
-1574
lines changed

.config/.readthedocs.yaml

+13-17
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,16 @@ build:
99
os: ubuntu-22.04
1010
tools:
1111
rust: latest
12-
commands:
13-
# install cargo-binstall
14-
- >-
15-
curl
16-
-L --proto '=https' --tlsv1.2 -sSf
17-
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh
18-
| bash
19-
# add .cargo bin to PATH
20-
# install mdbook and mdbook-alerts
21-
# build docs
22-
- >-
23-
PATH=/home/docs/.cargo/bin:$PATH &&
24-
cargo binstall --install-path /home/docs/.cargo/bin -y mdbook mdbook-alerts &&
25-
mdbook build docs
26-
# move HTML output to required RTD output path
27-
- mkdir -p ${READTHEDOCS_OUTPUT}
28-
- mv docs/book/html/ "${READTHEDOCS_OUTPUT}"
12+
python: latest
13+
14+
mkdocs:
15+
configuration: docs/mkdocs.yml
16+
17+
18+
# Optionally declare the Python requirements required to build your docs
19+
20+
python:
21+
install:
22+
- requirements: docs/requirements.txt
23+
- method: pip
24+
path: docs/

.github/workflows/build-docs.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }}
3737
- run: cargo fetch
3838

39-
build-mdbook:
39+
build-mkdocs:
4040
runs-on: ubuntu-latest
4141
needs: [cache-deps]
4242
permissions:
@@ -48,26 +48,30 @@ jobs:
4848
with:
4949
path: ~/.cargo
5050
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }}
51-
- name: Install mdbook
52-
uses: taiki-e/install-action@v2
51+
- uses: actions/setup-python@v5
5352
with:
54-
tool: mdbook,cargo-binstall,just
55-
- name: Install mdbook plugins
56-
run: cargo binstall -y mdbook-alerts
57-
- name: Build book
58-
run: just docs-build
53+
python-version: 3.x
54+
cache: 'pip'
55+
cache-dependency-path: docs/requirements.txt
56+
- name: Install workflow deps
57+
run: |
58+
pip install -r docs/requirements.txt
59+
pip install --force-reinstall -v docs/
60+
- name: Build docs
61+
working-directory: docs
62+
run: mkdocs build
5963
- name: Upload docs build as artifact
6064
uses: actions/upload-artifact@v4
6165
with:
6266
name: cpp-linter-docs
63-
path: docs/book/html
67+
path: docs/site
6468
- name: Upload to github pages
6569
# only publish doc changes from main branch
6670
if: github.ref == 'refs/heads/main'
6771
uses: peaceiris/actions-gh-pages@v4
6872
with:
6973
github_token: ${{ secrets.GITHUB_TOKEN }}
70-
publish_dir: docs/book/html
74+
publish_dir: docs/site
7175

7276
build-rustdoc:
7377
runs-on: ubuntu-latest
@@ -80,7 +84,7 @@ jobs:
8084
with:
8185
path: ~/.cargo
8286
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }}
83-
- name: Install mdbook
87+
- name: Install just
8488
uses: taiki-e/install-action@v2
8589
with:
8690
tool: just

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ debug/
338338
!.vscode/tasks.json
339339
!.vscode/extensions.json
340340

341-
# mdbook builds
342-
book
341+
# mkdocs builds
342+
docs/site
343343

344344
# ignore generated files
345345
.cpp-linter_cache/

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repos:
1010
- id: check-added-large-files
1111
args: [--maxkb=9000]
1212
- id: check-yaml
13+
exclude: docs/mkdocs.yml
1314
- id: check-toml
1415
- id: requirements-txt-fixer
1516
- id: mixed-line-ending

.vscode/tasks.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -161,24 +161,25 @@
161161
},
162162
{
163163
"type": "shell",
164-
"command": "mdbook",
165-
"label": "mdbook: serve",
164+
"command": "mkdocs",
165+
"label": "mkdocs: serve",
166166
"args": [
167167
"serve",
168-
"docs",
168+
" --config-file",
169+
"docs/mkdocs.yml",
169170
"--open"
170171
],
171172
"problemMatcher": [],
172173
"group": "build"
173174
},
174175
{
175176
"type": "shell",
176-
"command": "mdbook",
177-
"label": "mdbook: build",
177+
"command": "mkdocs",
178+
"label": "mkdocs: build",
178179
"args": [
179180
"build",
180-
"docs",
181-
"--open"
181+
" --config-file",
182+
"docs/mkdocs.yml"
182183
],
183184
"presentation": {
184185
"close": true,

0 commit comments

Comments
 (0)