Skip to content

Commit 4b2bb43

Browse files
committed
docs: Migrate to mdBook and pdoc
1 parent 45a999c commit 4b2bb43

35 files changed

+962
-678
lines changed

.github/workflows/build.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
run: |
2929
pip install poetry
3030
poetry install
31+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
32+
source $HOME/.cargo/env
33+
cargo install mdbook
3134
- name: Get PR number
3235
uses: jwalton/gh-find-current-pr@v1
3336
id: findPr
@@ -50,6 +53,6 @@ jobs:
5053
with:
5154
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5255
BRANCH: gh-pages
53-
FOLDER: docs
56+
FOLDER: out
5457
COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }}
5558
CLEAN: true

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ pip-wheel-metadata
1515
.DS_Store
1616
venv/
1717
.idea/
18+
out/
19+
docs/CHANGELOG.md

Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ fmt:
3737
$(POETRY) run pre-commit run -a
3838

3939
docs:
40-
mkdir -p docs
41-
$(POETRY) run pdoc serde --html -o html --force --template-dir docs/template
42-
cp -f html/serde/* docs/
40+
mkdir -p docs out/api out/guide
41+
cp -f CHANGELOG.md docs/
42+
$(POETRY) run pdoc -e serde=https://github.com/yukinarit/pyserde/tree/master/serde/ serde -o out/api
43+
mdbook build -d out/guide
4344

4445
open-docs:
45-
$(POETRY) run pdoc serde --html -o html --force --template-dir docs/template --http 127.0.0.1:5001
46+
$(POETRY) run pdoc -e serde=https://github.com/yukinarit/pyserde/tree/master/serde serde
4647

4748
bench:
4849
pushd bench && $(POETRY) run $(PYTHON) bench.py && popd

0 commit comments

Comments
 (0)