Skip to content

Commit 7836b2a

Browse files
authored
docs: add mdBook user guide and Pages publishing (#1)
* docs: add user guide design * chore: ignore local worktrees * chore: finalize crate licensing and ignore rules * docs: add mdbook skeleton * docs: port discretized grid user guide * docs: port remaining user guide chapters * ci: validate mdbook user guide * docs: publish mdbook user guide
1 parent 761c53a commit 7836b2a

27 files changed

Lines changed: 811 additions & 676 deletions

.github/workflows/CI.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,32 @@ jobs:
4646
- name: Run tests
4747
run: cargo nextest run --release
4848

49+
docs:
50+
name: Docs
51+
runs-on: ubuntu-22.04
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Install Rust
56+
uses: dtolnay/rust-toolchain@stable
57+
58+
- uses: Swatinem/rust-cache@v2
59+
60+
- name: Install mdBook
61+
run: cargo install mdbook --no-default-features --features search --vers "^0.5" --locked
62+
63+
- name: Verify executable book examples
64+
run: ./scripts/test-book-examples.sh
65+
66+
- name: Build mdBook
67+
run: mdbook build
68+
4969
rollup:
5070
runs-on: ubuntu-latest
5171
needs:
5272
- lint
5373
- test
74+
- docs
5475
if: always()
5576
steps:
5677
- name: All checks passed

.github/workflows/docs-pages.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Docs Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: docs-pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
name: Build docs artifact
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup Pages
26+
uses: actions/configure-pages@v5
27+
28+
- name: Install Rust
29+
uses: dtolnay/rust-toolchain@stable
30+
31+
- uses: Swatinem/rust-cache@v2
32+
33+
- name: Install mdBook
34+
run: cargo install mdbook --no-default-features --features search --vers "^0.5" --locked
35+
36+
- name: Verify executable book examples
37+
run: ./scripts/test-book-examples.sh
38+
39+
- name: Build mdBook
40+
run: mdbook build
41+
42+
- name: Upload Pages artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: book
46+
47+
deploy:
48+
name: Deploy docs
49+
runs-on: ubuntu-latest
50+
needs: build
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
/target
2+
.worktrees/
3+
/book
4+
/Cargo.lock

0 commit comments

Comments
 (0)