-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added files for mkdocs generation (#242)
* added files for mkdocs generation
- Loading branch information
Showing
7 changed files
with
848 additions
and
42 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../CODE_OF_CONDUCT.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../CONTRIBUTING.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Generate the code reference pages and navigation.""" | ||
|
||
from pathlib import Path | ||
|
||
import mkdocs_gen_files | ||
|
||
|
||
nav = mkdocs_gen_files.Nav() | ||
|
||
for path in sorted(Path("src").rglob("*.py")): | ||
module_path = path.relative_to("src").with_suffix("") | ||
doc_path = path.relative_to("src").with_suffix(".md") | ||
full_doc_path = Path("reference", doc_path) | ||
|
||
parts = tuple(module_path.parts) | ||
|
||
if parts[-1] == "__init__": | ||
parts = parts[:-1] | ||
doc_path = doc_path.with_name("index.md") | ||
full_doc_path = full_doc_path.with_name("index.md") | ||
elif parts[-1] == "__main__": | ||
continue | ||
|
||
nav[parts] = doc_path.as_posix() | ||
|
||
with mkdocs_gen_files.open(full_doc_path, "w") as fd: | ||
ident = ".".join(parts) | ||
fd.write(f"::: {ident}") | ||
|
||
mkdocs_gen_files.set_edit_path(full_doc_path, path) | ||
|
||
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: | ||
nav_file.writelines(nav.build_literate_nav()) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
site_name: dapla-toolbelt-pseudo | ||
site_description: Pseudonymization extensions for Dapla Toolbelt | ||
site_url: https://statisticsnorway.github.io/dapla-toolbelt-pseudo | ||
|
||
theme: | ||
name: "material" | ||
repo_name: statisticsnorway/dapla-toolbelt-pseudo | ||
repo_url: https://github.com/statisticsnorway/dapla-toolbelt-pseudo | ||
edit_uri: edit/main/docs/ | ||
|
||
nav: | ||
- Home: "index.md" | ||
- Code Reference: reference/ | ||
- Contributing: "CONTRIBUTING.md" | ||
|
||
plugins: | ||
- search | ||
- gen-files: | ||
scripts: | ||
- docs/gen_ref_pages.py | ||
- literate-nav: | ||
nav_file: SUMMARY.md | ||
- section-index | ||
- mkdocstrings: | ||
# watch: | ||
# - src/dapla_pseudo | ||
|
||
markdown_extensions: | ||
- admonition # note blocks, warning blocks -- https://github.com/mkdocs/mkdocs/issues/1659 | ||
- attr_list # Enables full command headers, see https://github.com/DataDog/mkdocs-click#full-command-path-headers | ||
- mkdocs-typer |
Oops, something went wrong.