Skip to content

Commit dbd3d02

Browse files
Migrate docs to mkdocs (#3900)
`mkdocs` works with markdown similar to `mdbook` but is generally more pleasing to the eye and has several nice UX features. This PR does the bulk of the transition - likely, a followup would be needed to fully make use of the extra features and navigation. Book pages have been kept url-compatible, meaning that for the most part, old links should continue to work! Co-authored-by: Etan Kissling <[email protected]>
1 parent ddb7a3e commit dbd3d02

40 files changed

+547
-911
lines changed

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -658,14 +658,13 @@ libnfuzz.a: | build deps
658658
[[ -e "$@" ]] && mv "$@" build/ || true # workaround for https://github.com/nim-lang/Nim/issues/12745
659659

660660
book:
661+
"$(MAKE)" -C docs book
662+
663+
auditors-book:
661664
[[ "$$(mdbook --version)" = "mdbook v0.4.18" ]] || { echo "'mdbook v0.4.18' not found in PATH. See 'docs/README.md'. Aborting."; exit 1; }
662665
[[ "$$(mdbook-toc --version)" == "mdbook-toc 0.8.0" ]] || { echo "'mdbook-toc 0.8.0' not found in PATH. See 'docs/README.md'. Aborting."; exit 1; }
663666
[[ "$$(mdbook-open-on-gh --version)" == "mdbook-open-on-gh 2.1.0" ]] || { echo "'mdbook-open-on-gh 2.1.0' not found in PATH. See 'docs/README.md'. Aborting."; exit 1; }
664667
[[ "$$(mdbook-admonish --version)" == "mdbook-admonish 1.7.0" ]] || { echo "'mdbook-open-on-gh 1.7.0' not found in PATH. See 'docs/README.md'. Aborting."; exit 1; }
665-
cd docs/the_nimbus_book && \
666-
mdbook build
667-
668-
auditors-book:
669668
cd docs/the_auditors_handbook && \
670669
mdbook build
671670

@@ -680,7 +679,7 @@ publish-book: | book auditors-book
680679
rm -rf tmp-book/* && \
681680
mkdir -p tmp-book/auditors-book && \
682681
cp -a docs/the_nimbus_book/CNAME tmp-book/ && \
683-
cp -a docs/the_nimbus_book/book/* tmp-book/ && \
682+
cp -a docs/the_nimbus_book/site/* tmp-book/ && \
684683
cp -a docs/the_auditors_handbook/book/* tmp-book/auditors-book/ && \
685684
cd tmp-book && \
686685
git add . && { \

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mkdocs

docs/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
mkdocs: mkdocs/bin/mkdocs
2+
3+
mkdocs/bin/mkdocs:
4+
test -d mkdocs || python -m venv mkdocs
5+
. mkdocs/bin/activate; pip install -r requirements.txt
6+
7+
compile:
8+
. mkdocs/bin/activate; pip-compile requirements.in
9+
10+
sync:
11+
. mkdocs/bin/activate; pip-sync requirements.txt
12+
13+
serve: mkdocs
14+
. mkdocs/bin/activate; cd the_nimbus_book; mkdocs serve
15+
16+
book: mkdocs
17+
. mkdocs/bin/activate; cd the_nimbus_book; mkdocs build

docs/requirements.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pip-tools
2+
mkdocs-material

docs/requirements.txt

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#
2+
# This file is autogenerated by pip-compile with python 3.10
3+
# To update, run:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
build==0.8.0
8+
# via pip-tools
9+
click==8.1.3
10+
# via
11+
# mkdocs
12+
# pip-tools
13+
ghp-import==2.1.0
14+
# via mkdocs
15+
importlib-metadata==4.12.0
16+
# via mkdocs
17+
jinja2==3.1.2
18+
# via
19+
# mkdocs
20+
# mkdocs-material
21+
markdown==3.3.7
22+
# via
23+
# mkdocs
24+
# mkdocs-material
25+
# pymdown-extensions
26+
markupsafe==2.1.1
27+
# via jinja2
28+
mergedeep==1.3.4
29+
# via mkdocs
30+
mkdocs==1.3.1
31+
# via mkdocs-material
32+
mkdocs-material==8.3.9
33+
# via -r requirements.in
34+
mkdocs-material-extensions==1.0.3
35+
# via mkdocs-material
36+
packaging==21.3
37+
# via
38+
# build
39+
# mkdocs
40+
pep517==0.12.0
41+
# via build
42+
pip-tools==6.8.0
43+
# via -r requirements.in
44+
pygments==2.12.0
45+
# via mkdocs-material
46+
pymdown-extensions==9.5
47+
# via mkdocs-material
48+
pyparsing==3.0.9
49+
# via packaging
50+
python-dateutil==2.8.2
51+
# via ghp-import
52+
pyyaml==6.0
53+
# via
54+
# mkdocs
55+
# pyyaml-env-tag
56+
pyyaml-env-tag==0.1
57+
# via mkdocs
58+
six==1.16.0
59+
# via python-dateutil
60+
tomli==2.0.1
61+
# via
62+
# build
63+
# pep517
64+
watchdog==2.1.9
65+
# via mkdocs
66+
wheel==0.37.1
67+
# via pip-tools
68+
zipp==3.8.1
69+
# via importlib-metadata
70+
71+
# The following packages are considered to be unsafe in a requirements file:
72+
# pip
73+
# setuptools

docs/the_nimbus_book/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
book
2+
site

docs/the_nimbus_book/book.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/the_nimbus_book/custom.css

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)