-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed 6a94ada to 0.2 with MkDocs 1.4.1 and mike 1.1.2
- Loading branch information
1 parent
6a94ada
commit f5d5539
Showing
83 changed files
with
34,501 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2,455 changes: 2,455 additions & 0 deletions
2,455
0.2/api/element_deeplabcut/readers/dlc_reader/index.html
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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,44 @@ | ||
"""Generate the api pages and navigation. | ||
NOTE: Works best when following the Google style guide | ||
https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html | ||
https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings | ||
""" | ||
|
||
import mkdocs_gen_files | ||
from pathlib import Path | ||
import os | ||
import subprocess | ||
|
||
package = os.getenv("PACKAGE") | ||
|
||
element = package.split("_", 1)[1] | ||
if not Path(f"workflow_{element}").is_dir(): | ||
try: | ||
subprocess.run( | ||
f"git clone https://github.com/datajoint/workflow-{element.replace('_','-')}.git /main/delete".split( | ||
" " | ||
), | ||
check=True, | ||
timeout=5, | ||
) | ||
os.system(f"mv /main/delete/workflow_{element} /main/") | ||
os.system("rm -fR /main/delete") | ||
except subprocess.CalledProcessError: | ||
pass # no repo found | ||
|
||
nav = mkdocs_gen_files.Nav() | ||
for path in sorted(Path(package).glob("**/*.py")) + sorted( | ||
Path(f"workflow_{element}").glob("**/*.py") | ||
): | ||
if path.stem == "__init__": | ||
continue | ||
with mkdocs_gen_files.open(f"api/{path.with_suffix('')}.md", "w") as f: | ||
module_path = ".".join( | ||
[p for p in path.with_suffix("").parts if p != "__init__"] | ||
) | ||
print(f"::: {module_path}", file=f) | ||
nav[path.parts] = f"{path.with_suffix('')}.md" | ||
|
||
with mkdocs_gen_files.open("api/navigation.md", "w") as nav_file: | ||
nav_file.writelines(nav.build_literate_nav()) |
Oops, something went wrong.