Skip to content

Commit bd1eec1

Browse files
committed
improve sorting of pages in natural way
1 parent e8e0772 commit bd1eec1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

docs/_scripts/generate_reference_pages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
from pathlib import Path
44

55
import mkdocs_gen_files
6+
from natsort import natsorted
67

78
nav = mkdocs_gen_files.Nav()
89
mod_symbol = '<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'
910

1011
root = Path(__file__).parents[2]
1112
src = root / "blueprints"
1213

13-
for path in sorted(src.rglob("*.py")):
14+
for path in natsorted(src.rglob("*.py")):
1415
module_path = path.relative_to(src).with_suffix("")
1516
doc_path = path.relative_to(src).with_suffix(".md")
1617
full_doc_path = Path("API reference", doc_path)

docs/requirements_docs.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ mkdocs-open-in-new-tab ~= 1.0.3
55
mkdocs-nav-weight ~= 0.2.0
66
mkdocs-git-revision-date-localized-plugin ~= 1.2.6
77
mkdocstrings[python] ~= 0.27.0
8-
mkdocs-gen-files ~= 0.5.0
8+
mkdocs-gen-files ~= 0.5.0
9+
mkdocs-awesome-nav ~= v3.0.0
10+
natsorted ~= 8.4.0

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ plugins:
9191
unwrap_annotated: true
9292
docstring_section_style: list
9393
show_if_no_docstring: false
94+
- awesome-nav
9495

9596
markdown_extensions:
9697
- pymdownx.highlight:

0 commit comments

Comments
 (0)