Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readthedocs #381

Merged
merged 6 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ cpp_coverage.xml
docs/bin
docs/lib
docs/source/lib
docs/source/sonata-network.rst
docs/source/sonata-network_files/
docs/source/nmc-portal.rst
docs/source/L5TTPC2_files/
bin
*.tox-info.json
*.ipynb_checkpoints
Expand Down
2 changes: 0 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ build:
python: "3.10"
jobs:
pre_build:
- cd docs
- sh examples_to_rst.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not work if we place the examples_to_rst.sh into either docs or examples and call it sh docs/examples_to_rst.sh in the .readthedocs.yaml?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should work. Let me implement it

- cd -

python:
# Install our python package before building the docs
Expand Down
6 changes: 0 additions & 6 deletions docs/examples_to_rst.sh

This file was deleted.

15 changes: 15 additions & 0 deletions examples_to_rst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# clean up
rm docs/source/sonata-network.rst
rm -rf docs/source/sonata-network_files
rm docs/source/nmc-portal.rst
rm -rf docs/source/L5TTPC2_files

# convert
jupyter nbconvert --to rst examples/sonata-network/sonata-network.ipynb
jupyter nbconvert --to rst examples/nmc-portal/L5TTPC2.ipynb

# move
mv examples/sonata-network/sonata-network.rst docs/source/
mv examples/sonata-network/sonata-network_files docs/source/
mv examples/nmc-portal/L5TTPC2.rst docs/source/nmc-portal.rst
mv examples/nmc-portal/L5TTPC2_files docs/source/
8 changes: 2 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,14 @@ deps =
-r{toxinidir}/requirements_docs.txt
pytest>=7.4.4
allowlist_externals =
make
jupyter
cp
sh
changedir = docs

commands =
sh examples_to_rst.sh
# build the docs to see if it builds fine
make html SPHINXOPTS=-W
sphinx-build -b html -W docs/source docs/_build/html
# make sure the feature names and units are up-to-date
pytest test_feature_units_in_docs.py
pytest docs/test_feature_units_in_docs.py

[testenv:lint]
envdir = {toxworkdir}/lint
Expand Down
Loading