File tree Expand file tree Collapse file tree 4 files changed +43
-7
lines changed
Expand file tree Collapse file tree 4 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 11version : 2
22
3- sphinx :
4- configuration : docs/conf.py
3+ build :
4+ os : ubuntu-22.04
5+ tools :
6+ python : " 3.12"
57
68python :
7- version : 3.7
89 install :
9- - requirements : requirements-dev.txt
10+ - requirements : requirements-dev.txt
11+ - method : pip
12+ path : .
13+
14+ sphinx :
15+ configuration : docs/conf.py
Original file line number Diff line number Diff line change 11import importlib
2+ import os
23import pathlib
4+ import sys
35
46author = "Brian de Silva, Krithika Manohar, Emily Clark"
57project = "pysensors" # package name
1113
1214module = importlib .import_module (project )
1315version = release = getattr (module , "__version__" )
16+ sys .path .insert (0 , os .path .abspath ("." ))
1417
1518# The master toctree document.
1619master_doc = "index"
2225 "sphinx.ext.autosummary" ,
2326 "sphinx.ext.napoleon" ,
2427 "sphinx.ext.mathjax" ,
25- "sphinx_nbexamples" ,
28+ "nbsphinx" ,
29+ "sphinx_copy_examples" ,
2630]
2731
2832apidoc_module_dir = f"../{ project } "
3337autodoc_member_order = "bysource"
3438autoclass_content = "init"
3539
36- language = None
40+ language = "en"
3741
3842here = pathlib .Path (__file__ ).parent
3943
Original file line number Diff line number Diff line change 1+ import shutil
2+ from pathlib import Path
3+
4+ from sphinx .application import Sphinx
5+
6+
7+ def setup (app : Sphinx ):
8+ """Copy notebooks and supporting files from examples/ to docs/examples/"""
9+ source = Path (__file__ ).parent .parent / "examples"
10+ target = Path (__file__ ).parent / "examples"
11+
12+ if target .exists ():
13+ shutil .rmtree (target )
14+ target .mkdir ()
15+
16+ for item in source .rglob ("*" ):
17+ # Accomodates for any helper scripts and data files
18+ rel_path = item .relative_to (source )
19+ dest_path = target / rel_path
20+
21+ if item .is_dir ():
22+ dest_path .mkdir (parents = True , exist_ok = True )
23+ else :
24+ dest_path .parent .mkdir (parents = True , exist_ok = True )
25+ shutil .copy2 (item , dest_path )
26+ print (f"Copied { rel_path } " )
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ sphinx >= 2
1212sphinxcontrib-apidoc
1313sphinx_rtd_theme
1414pre-commit
15- sphinx-nbexamples
15+ nbsphinx
You can’t perform that action at this time.
0 commit comments