generated from dataforgoodfr/d4g-project-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from genai-impact/docs/reference
Add API References to Documentation
- Loading branch information
Showing
10 changed files
with
506 additions
and
7 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,30 @@ | ||
"""Generate the code reference pages.""" | ||
|
||
from pathlib import Path | ||
|
||
import mkdocs_gen_files | ||
|
||
PACKAGE = "ecologits" | ||
|
||
nav = mkdocs_gen_files.Nav() | ||
|
||
for path in sorted(Path(PACKAGE).rglob("*.py")): | ||
module_path = path.relative_to(PACKAGE).with_suffix("") | ||
doc_path = path.relative_to(PACKAGE).with_suffix(".md") | ||
full_doc_path = Path("reference", doc_path) | ||
|
||
parts = list(module_path.parts) | ||
|
||
if parts[-1] == "__init__" or parts[-1] == "__main__": | ||
continue | ||
|
||
nav[parts] = doc_path.as_posix() | ||
|
||
with mkdocs_gen_files.open(full_doc_path, "w") as fd: | ||
identifier = ".".join(parts) | ||
fd.write("::: " + identifier) | ||
|
||
mkdocs_gen_files.set_edit_path(full_doc_path, Path("../") / path) | ||
|
||
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: # | ||
nav_file.writelines(nav.build_literate_nav()) |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .ecologits import EcoLogits | ||
|
||
__all__ = ["EcoLogits"] | ||
__version__ = "0.1.3" |
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
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
Oops, something went wrong.