Skip to content

Commit 7f02ad8

Browse files
committed
Adding notebooks to docs
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
1 parent 32ab23d commit 7f02ad8

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

docs/notebooks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- [Sparse Finch](examples/sparse_finch.ipynb)

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ plugins:
5252
- gen-files:
5353
scripts:
5454
- scripts/gen_ref_pages.py
55+
- scripts/copy_notebooks.py
5556
- literate-nav
5657
- mkdocstrings:
5758
handlers:
@@ -75,6 +76,8 @@ plugins:
7576
include_source: true
7677
execute: true
7778
ignore: ["__init__.py", "utils.py", "gen_logo.py"]
79+
include:
80+
- examples/*.ipynb
7881

7982
nav:
8083
- Home:
@@ -100,3 +103,5 @@ nav:
100103
- completed-tasks.md
101104
- changelog.md
102105
- conduct.md
106+
- Notebooks:
107+
- notebooks.md

scripts/copy_notebooks.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import shutil
2+
from pathlib import Path
3+
4+
source_dir = Path("examples")
5+
dest_dir = Path("docs/examples")
6+
7+
dest_dir.mkdir(parents=True, exist_ok=True)
8+
9+
for notebook in source_dir.glob("*.ipynb"):
10+
shutil.copy2(notebook, dest_dir / notebook.name)

0 commit comments

Comments
 (0)