-
Notifications
You must be signed in to change notification settings - Fork 5
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 #72 from Musaefendic/copy-notebook-with-nbsphinx-link
Build the doc, notebook and copy necessary resources
- Loading branch information
Showing
6 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,34 @@ | ||
import os | ||
from pathlib import Path | ||
import shutil | ||
|
||
CWD = Path.cwd() | ||
SOURCEDIR = "source" | ||
BUILDDIR = "_build" | ||
NOTEBOOK_FOLDER = "user_guide/notebooks" | ||
|
||
RESOURCES = ("tf.html", "textures/twiinIT_logo.png", "textures/twiinIT.png") | ||
|
||
|
||
def main(): | ||
build_documentation() | ||
copy_notebook_resources() | ||
|
||
|
||
def build_documentation(): | ||
return os.system("sphinx-build -b html -d _build/doctrees ./source _build") | ||
|
||
|
||
def copy_notebook_resources(): | ||
for resource in RESOURCES: | ||
source_path = CWD / SOURCEDIR / NOTEBOOK_FOLDER / resource | ||
target_path = CWD / BUILDDIR / NOTEBOOK_FOLDER / resource | ||
|
||
if not os.path.exists(target_path.parents[0]): | ||
os.mkdir(target_path.parents[0]) | ||
|
||
shutil.copyfile(source_path, target_path) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"path": "../../../../pyturbo/notebooks/turbofan.ipynb", | ||
"extra-media": [ | ||
"../../../../pyturbo/notebooks/textures" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -20,3 +20,4 @@ dependencies: | |
- pythonocc-core | ||
- ambiance | ||
- furo | ||
- nbsphinx-link |
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