Skip to content

Commit

Permalink
conditional sphinx note on rtd
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle committed Dec 22, 2023
1 parent bc3fb4c commit db5ef6b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
5 changes: 5 additions & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
author = f"{project} Contributors"
on_rtd = os.environ.get("READTHEDOCS")

if on_rtd:
# https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#including-content-based-on-tags
# https://www.sphinx-doc.org/en/master/usage/configuration.html#conf-tags
tags.add("on_rtd") # noqa: F821

# The full version, including alpha/beta/rc tags
release = get_version("geovista")
if release.endswith("+dirty"):
Expand Down
7 changes: 7 additions & 0 deletions src/geovista/examples/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ The gallery is generated from the ``geovista.examples``, which can also
be run from the command line::

geovista examples --run all --verbose

.. only:: on_rtd

.. note::
Title text and graticule labels will **not** be rendered when viewing the
documentation on ``ReadtheDocs``, as these are not supported in this
headless environment.
10 changes: 6 additions & 4 deletions src/geovista/examples/spatial_index/uber_h3.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,12 @@ def callback(actor: Actor, flag: bool) -> None:


# %%
# .. note::
# The checkboxes will **not** be rendered when viewing the documentation on
# ``ReadtheDocs``, as the appropriate VTK widget is not supported in this
# headless environment.
# .. only:: on_rtd
#
# .. note::
# The checkboxes will **not** be rendered when viewing the documentation on
# ``ReadtheDocs``, as the appropriate VTK widget is not supported in this
# headless environment.

# %%
# Finally, we create the :class:`~geovista.geoplotter.GeoPlotter` and add the
Expand Down
5 changes: 0 additions & 5 deletions src/geovista/examples/unstructured/dynamico.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,3 @@ def main() -> None:

if __name__ == "__main__":
main()

# %%
# .. note::
# Graticule labels will **not** be rendered when viewing the documentation on
# ``ReadtheDocs``, as labels are not supported in this headless environment.
5 changes: 0 additions & 5 deletions src/geovista/examples/unstructured/dynamico_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,3 @@ def main() -> None:

if __name__ == "__main__":
main()

# %%
# .. note::
# Graticule labels will **not** be rendered when viewing the documentation on
# ``ReadtheDocs``, as labels are not supported in this headless environment.

0 comments on commit db5ef6b

Please sign in to comment.