Skip to content

Commit 4f16238

Browse files
authored
βž• πŸ“ simlify docs navigation specification with mkdocs-awesome-nav (#451)
1 parent b7bd3a3 commit 4f16238

File tree

4 files changed

+223
-64
lines changed

4 files changed

+223
-64
lines changed

β€Ždocs/.nav.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flatten_single_child_sections: true
2+
3+
nav:
4+
- User Guide: user_guide
5+
- API Reference: reference.md
6+
- Development: contributing.md

β€Žmkdocs.yml

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,62 +11,15 @@ repo_url: https://github.com/numpy/numtype
1111
repo_name: numpy/numtype
1212
edit_uri: blob/main/docs/
1313

14-
nav:
15-
- User Guide:
16-
- NumType User Guide: user_guide/index.md
17-
- Differences with NumPy: user_guide/differences.md
18-
- API Reference: reference.md
19-
- Development: contributing.md
20-
21-
theme:
22-
name: material
23-
favicon: img/favicon.ico
24-
logo: img/icon.svg
25-
26-
features:
27-
- content.tabs.link
28-
- content.tooltips
29-
- navigation.path
30-
- navigation.indexes
31-
- navigation.prune
32-
- navigation.sections
33-
- navigation.tabs
34-
- navigation.top
35-
- navigation.tracking
36-
- search.highlight
37-
- search.share
38-
- search.suggest
39-
- toc.follow
40-
41-
font:
42-
text: Lato
43-
code: JetBrains Mono
44-
45-
palette:
46-
- media: "(prefers-color-scheme)"
47-
toggle:
48-
icon: fontawesome/solid/circle-half-stroke
49-
name: Switch to light mode
50-
- media: "(prefers-color-scheme: light)"
51-
scheme: default
52-
primary: teal
53-
accent: pink
54-
toggle:
55-
icon: fontawesome/regular/moon
56-
name: Switch to dark mode
57-
- media: "(prefers-color-scheme: dark)"
58-
scheme: slate
59-
primary: teal
60-
accent: pink
61-
toggle:
62-
icon: fontawesome/regular/sun
63-
name: Switch to system preference
64-
6514
plugins:
6615
# https://github.com/mkdocstrings/autorefs
6716
- autorefs:
6817
resolve_closest: true
6918

19+
# https://lukasgeiter.github.io/mkdocs-awesome-nav/
20+
- awesome-nav:
21+
filename: .nav.yml
22+
7023
# https://github.com/mondeja/mkdocs-include-markdown-plugin
7124
- include-markdown
7225

@@ -129,6 +82,53 @@ markdown_extensions:
12982
user: numpy
13083
repo: numtype
13184

85+
theme:
86+
name: material
87+
favicon: img/favicon.ico
88+
logo: img/icon.svg
89+
90+
features:
91+
- content.tabs.link
92+
- content.tooltips
93+
- navigation.path
94+
- navigation.indexes
95+
- navigation.prune
96+
- navigation.sections
97+
- navigation.tabs
98+
- navigation.top
99+
- navigation.tracking
100+
- search.highlight
101+
- search.share
102+
- search.suggest
103+
- toc.follow
104+
105+
font:
106+
text: Lato
107+
code: JetBrains Mono
108+
109+
palette:
110+
- media: "(prefers-color-scheme)"
111+
toggle:
112+
icon: fontawesome/solid/circle-half-stroke
113+
name: Switch to light mode
114+
- media: "(prefers-color-scheme: light)"
115+
scheme: default
116+
primary: teal
117+
accent: pink
118+
toggle:
119+
icon: fontawesome/regular/moon
120+
name: Switch to dark mode
121+
- media: "(prefers-color-scheme: dark)"
122+
scheme: slate
123+
primary: teal
124+
accent: pink
125+
toggle:
126+
icon: fontawesome/regular/sun
127+
name: Switch to system preference
128+
129+
extra_css:
130+
- style/theme.css
131+
132132
extra:
133133
analytics:
134134
provider: google
@@ -141,7 +141,4 @@ extra:
141141
find what they're searching for. With your consent, you're helping us to
142142
make our documentation better.
143143
144-
extra_css:
145-
- style/theme.css
146-
147-
copyright: Copyright © 2025 NumPy Developers.
144+
copyright: Copyright ©, 2025 NumPy Developers.

β€Žpyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ typecheck = [
7979
{include-group = "mypy"},
8080
]
8181
docs = [
82-
"mkdocs-material>=9.6.9",
82+
"mkdocs-material>=9.6.10",
83+
"mkdocs-awesome-nav>=3.1.0",
8384
"mkdocs-include-markdown-plugin>=7.1.5",
8485
"mkdocs-minify-plugin>=0.8.0",
85-
"mkdocstrings[python]>=0.29.0",
86+
"mkdocstrings[python]>=0.29.1",
8687
"pygments>=2.19.1",
8788
]
8889
dev = [

0 commit comments

Comments
Β (0)