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

add flag to disable nbsphinx #1615

Merged
merged 5 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
numpydoc_show_class_members = False
extensions += ["matplotlib.sphinxext.plot_directive", "sphinxcontrib.bibtex"]

nbsphinx_execute = "auto"
if os.getenv('DISABLE_NBSPHINX') == "1":
nbsphinx_execute = "never"
else:
nbsphinx_execute = "auto"

nbsphinx_execute_arguments = [
"--InlineBackend.figure_formats={'svg', 'pdf'}",
Expand All @@ -79,6 +82,7 @@
nbsphinx_prolog = """
This notebook is available at
https://github.com/tardis-sn/tardis/tree/master/docs/{{ env.doc2path(env.docname, base=None) }}

----
"""

Expand Down
11 changes: 6 additions & 5 deletions docs/development/documentation_guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ Besides this, the functions and classes in your code must always contain **docst
Building documentation locally
==============================

To build TARDIS documentation locally, you can use either of the following commands: ::
To build TARDIS documentation locally, use the following commands:

python setup.py build_docs

or ::
.. code ::

cd docs
make html

.. note :: If you're working on a fresh local copy of the TARDIS repository, you might need to do ``python setup.py develop`` before executing these commands.
.. note ::

- If you're working on a fresh local copy of the TARDIS repository, you might need to do ``python setup.py develop`` before executing these commands.
- Use ``DISABLE_NBSPHINX=1 make html`` to disable notebook rendering (fast mode).

After running this command, you can find the built docs (i.e. HTML webpages) in ``docs/_build``. Open the ``index.html`` in your browser to see how the documentation looks like with your edits. Navigate to page where you made changes or file that you added to check whether it looks as intended or not.

Expand Down
2 changes: 1 addition & 1 deletion docs/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ to the Astropy team for designing it.
issues
git_workflow
documentation_guidelines
documentation_preview
running_tests
code_quality
documentation_preview
developer_faq

TARDIS core team Instructions
Expand Down
4 changes: 0 additions & 4 deletions docs/io/optional/custom_source.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
},
"nbsphinx": {
"execute": "always",
"timeout": 600
}
},
"nbformat": 4,
Expand Down
6 changes: 1 addition & 5 deletions docs/io/output/physical_quantities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.8"
},
"nbsphinx": {
"execute": "always",
"timeout": -1
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
6 changes: 1 addition & 5 deletions docs/quickstart/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
},
"nbsphinx": {
"execute": "always",
"timeout": -1
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down