Skip to content

Commit d746a94

Browse files
authored
switch to mdbook for docs (#13)
See also [mdbook docs](https://rust-lang.github.io/mdBook/index.html) This is pretty customized. The CLI doc is still generated from rust src. The doc's site ToC is altered via JS on page load to show the page's ToC. I also renamed some CI workflows to reduce the badges' visual noise (in README).
1 parent ffe60ed commit d746a94

26 files changed

+1766
-383
lines changed

.github/workflows/binary-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Binary executable builds
1+
name: Binary builds
22

33
permissions:
44
contents: read

.github/workflows/build-docs.yml

+12-18
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,38 @@ jobs:
1818
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
1919
- run: cargo fetch
2020

21-
build-sphinx:
21+
build-mdbook:
2222
runs-on: ubuntu-latest
2323
needs: [cache-deps]
2424
permissions:
2525
contents: write
2626
steps:
2727
- uses: actions/checkout@v4
28-
- uses: actions/setup-python@v5
29-
with:
30-
python-version: 3.x
31-
32-
- name: Install dependencies
33-
working-directory: cpp-linter-py
34-
run: pip install -r docs/requirements.txt
35-
3628
- name: Cache .cargo locked resources
3729
uses: actions/cache/restore@v4
3830
with:
3931
path: ~/.cargo
4032
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
41-
42-
- name: Build docs
43-
working-directory: cpp-linter-py
44-
run: sphinx-build docs docs/_build/html
45-
33+
- name: Install mdbook
34+
uses: taiki-e/install-action@v2
35+
with:
36+
tool: mdbook,cargo-binstall
37+
- name: Install mdbook plugins
38+
run: cargo binstall -y mdbook-alerts
39+
- name: Build book
40+
run: mdbook build docs
4641
- name: Upload docs build as artifact
4742
uses: actions/upload-artifact@v4
4843
with:
49-
name: cpp-linter-py_docs
50-
path: cpp-linter-py/docs/_build/html
51-
44+
name: cpp-linter-docs
45+
path: docs/book/html
5246
- name: Upload to github pages
5347
# only publish doc changes from main branch
5448
if: github.ref == 'refs/heads/main'
5549
uses: peaceiris/actions-gh-pages@v4
5650
with:
5751
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
publish_dir: cpp-linter-py/docs/_build/html
52+
publish_dir: docs/book/html
5953

6054
build-rustdoc:
6155
runs-on: ubuntu-latest

.github/workflows/python-packaging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python packaging
1+
name: Python builds
22

33
on:
44
push:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ debug/
193193
# ignore vscode stuff
194194
.vscode/
195195

196+
# mdbook builds
197+
book
196198

197199
# ignore generated files
198200
.cpp-linter_cache/

0 commit comments

Comments
 (0)