Skip to content

switch to mdbook for docs #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/binary-builds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Binary executable builds
name: Binary builds

permissions:
contents: read
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,38 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- run: cargo fetch

build-sphinx:
build-mdbook:
runs-on: ubuntu-latest
needs: [cache-deps]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install dependencies
working-directory: cpp-linter-py
run: pip install -r docs/requirements.txt

- name: Cache .cargo locked resources
uses: actions/cache/restore@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Build docs
working-directory: cpp-linter-py
run: sphinx-build docs docs/_build/html

- name: Install mdbook
uses: taiki-e/install-action@v2
with:
tool: mdbook,cargo-binstall
- name: Install mdbook plugins
run: cargo binstall -y mdbook-alerts
- name: Build book
run: mdbook build docs
- name: Upload docs build as artifact
uses: actions/upload-artifact@v4
with:
name: cpp-linter-py_docs
path: cpp-linter-py/docs/_build/html

name: cpp-linter-docs
path: docs/book/html
- name: Upload to github pages
# only publish doc changes from main branch
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: cpp-linter-py/docs/_build/html
publish_dir: docs/book/html

build-rustdoc:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-packaging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python packaging
name: Python builds

on:
push:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ debug/
# ignore vscode stuff
.vscode/

# mdbook builds
book

# ignore generated files
.cpp-linter_cache/
Expand Down
Loading