Skip to content

Commit a9a8da8

Browse files
committed
Get things building without errors
1 parent 0e2ec6d commit a9a8da8

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

docs/NAVIGATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ See https://oprypin.github.io/mkdocs-literate-nav/
1313
- [Dependency pinning and testing](further-background/dependency-pinning-and-testing.md)
1414
- [Development](development.md)
1515
- [API reference](api/example_fgen_basic/)
16-
- [Fortran API](fortran-api/)
16+
- [Fortran API](fortran-api/example_fgen_basic/)
1717
- [Changelog](changelog.md)

docs/gen_fortran_api.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
import subprocess
99
from pathlib import Path
1010

11+
import mkdocs_gen_files
12+
1113
REPO_ROOT = Path(__file__).parents[1]
14+
PACKAGE_NAME_ROOT = "example_fgen_basic"
15+
ROOT_DIR = Path("fortran-api")
16+
nav = mkdocs_gen_files.Nav()
1217

1318
ford = shutil.which("ford")
1419
if ford is None:
@@ -21,4 +26,12 @@
2126
)
2227

2328
# Put back the gitkeep file which ford deletes
24-
(REPO_ROOT / "docs" / "fortran-api" / ".gitkeep").touch()
29+
(REPO_ROOT / "docs" / ROOT_DIR / ".gitkeep").touch()
30+
31+
# TODO: figure out why this causes the final route to go to the wrong place
32+
nav[PACKAGE_NAME_ROOT] = "index.html"
33+
34+
# Temporary solution - only add index to navigation.
35+
# Can get more fancy in future.
36+
with mkdocs_gen_files.open(ROOT_DIR / PACKAGE_NAME_ROOT / "NAVIGATION.md", "w") as fh:
37+
fh.writelines(nav.build_literate_nav())

ford_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
project: Example fgen - basic
33
author: TODO align this with pyproject.toml
4-
output_dir: docs/fortran-api
4+
output_dir: docs/fortran-api/example_fgen_basic
55
src_dir: src
66
graph: true
77
---

0 commit comments

Comments
 (0)