Skip to content

Commit e8fc1da

Browse files
authored
Merge pull request #66 from CBroz1/main
[bugfix] Render notebooks as tutorials
2 parents 5264f2d + 889f7df commit e8fc1da

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ temp/*
8787
workflow_deeplabcut/
8888

8989
# docs
90-
/docs/site
90+
/docs/site/
91+
/docs/src/tutorials/*ipynb
92+
/docs/mike-mkdocs*

docs/docker-compose.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# MODE="LIVE|QA|PUSH" PACKAGE=element_deeplabcut UPSTREAM_REPO=https://github.com/datajoint/element-deeplabcut.git HOST_UID=$(id -u) docker compose -f docs/docker-compose.yaml up --build
2-
#
32
# navigate to http://localhost/
3+
#
4+
# Check templates: https://github.com/dj-sciops/djsciops-cicd/tree/main/docker-template
45
version: "2.4"
56
services:
67
docs:
@@ -16,6 +17,7 @@ services:
1617
- MODE
1718
- GOOGLE_ANALYTICS_KEY
1819
- PATCH_VERSION
20+
- JUPYTER_PLATFORM_DIRS=1
1921
volumes:
2022
- ../docs:/main/docs
2123
- ../${PACKAGE}:/main/${PACKAGE}
@@ -28,7 +30,14 @@ services:
2830
- |
2931
git config --global --add safe.directory /main
3032
set -e
33+
export ELEMENT_NAME=$$(echo $${PACKAGE} | sed 's/element_//g')
3134
export PATCH_VERSION=$$(cat /main/$${PACKAGE}/version.py | grep -oE '\d+\.\d+\.[a-z0-9]+')
35+
git clone https://github.com/datajoint/workflow-$${ELEMENT_NAME}.git /main/delete || true
36+
if [ -d /main/delete/ ]; then
37+
mv /main/delete/workflow_$${ELEMENT_NAME} /main/
38+
mv /main/delete/notebooks/*ipynb /main/docs/src/tutorials/
39+
rm -fR /main/delete
40+
fi
3241
if echo "$${MODE}" | grep -i live &>/dev/null; then
3342
mkdocs serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80
3443
elif echo "$${MODE}" | grep -iE "qa|push" &>/dev/null; then

docs/mkdocs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ nav:
1616
- Automate: tutorials/04-Automate_Optional.ipynb
1717
- Visualization: tutorials/05-Visualization_Optional.ipynb
1818
- Drop Schemas: tutorials/06-Drop_Optional.ipynb
19-
- Alternate Dataset: tutorials/09-AlternateDataset.ipynb
19+
- Alternate Dataset: tutorials/09-AlternateDataset.ipynb
2020
- Citation: citation.md
2121
- API: api/ # defer to gen-files + literate-nav
2222
- Changelog: changelog.md
@@ -118,6 +118,7 @@ plugins:
118118
- "*/navigation.md"
119119
- mkdocs-jupyter:
120120
ignore_h1_titles: True
121+
ignore: ["*make_pages.py"]
121122

122123
markdown_extensions:
123124
- attr_list

docs/src/api/make_pages.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,7 @@
1313
package = os.getenv("PACKAGE")
1414

1515
element = package.split("_", 1)[1]
16-
if not Path(f"workflow_{element}").is_dir():
17-
try:
18-
subprocess.run(
19-
f"git clone https://github.com/datajoint/workflow-{element.replace('_','-')}.git /main/delete".split(
20-
" "
21-
),
22-
check=True,
23-
timeout=5,
24-
)
25-
os.system(f"mv /main/delete/workflow_{element} /main/")
26-
os.system(f"mv /main/delete/notebooks/*ipynb /main/docs/src/tutorials/")
27-
os.system("rm -fR /main/delete")
28-
except subprocess.CalledProcessError:
29-
pass # no repo found
16+
# Previous git clone feature moved to docker compose
3017

3118
nav = mkdocs_gen_files.Nav()
3219
for path in sorted(Path(package).glob("**/*.py")) + sorted(

docs/src/tutorials.md

Whitespace-only changes.

0 commit comments

Comments
 (0)