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

docs: initial developer documentation guildlines #1298

Merged
merged 3 commits into from
Jan 28, 2025
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
1 change: 1 addition & 0 deletions changelog/1298.contributor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added :ref:`gv-developer-documentation` guidelines. (:user:`bjlittle`)
1 change: 1 addition & 0 deletions docs/src/_static/images/icons/documentation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/src/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.. _Cartopy: https://github.com/SciTools/cartopy
.. _Diátaxis: https://diataxis.fr/
.. _Discussions: https://github.com/bjlittle/geovista/discussions
.. _Executable Books: https://github.com/executablebooks
.. _GeoVista: https://github.com/bjlittle/geovista
.. _Issue: https://github.com/bjlittle/geovista/issues
.. _Issues: https://github.com/bjlittle/geovista/issues
Expand All @@ -30,16 +31,25 @@
.. _conda: https://docs.conda.io/projects/conda/en/latest/index.html
.. _conda environment.yml file: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file
.. _conda-forge: https://anaconda.org/conda-forge/geovista
.. _docutils: https://github.com/docutils/docutils
.. _feedstock: https://github.com/conda-forge/geovista-feedstock
.. _geopandas: https://github.com/geopandas/geopandas
.. _geovista: https://github.com/bjlittle/geovista
.. _geovista-data: https://github.com/bjlittle/geovista-data
.. _geovista-media: https://github.com/bjlittle/geovista-media
.. _iris: https://github.com/scitools/iris
.. _matplotlib: https://github.com/matplotlib/matplotlib
.. _myst-nb: https://github.com/executablebooks/MyST-NB
.. _myst-parser: https://github.com/executablebooks/MyST-Parser
.. _pip: https://pip.pypa.io/en/stable/index.html
.. _pre-commit: https://pre-commit.com/
.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
.. _sphinx: https://github.com/sphinx-doc/sphinx
.. _sphinx-autoapi: https://github.com/readthedocs/sphinx-autoapi
.. _sphinx-build: https://www.sphinx-doc.org/en/master/man/sphinx-build.html
.. _sphinx-gallery: https://github.com/sphinx-gallery/sphinx-gallery
.. _sphinx-tags: https://github.com/melissawm/sphinx-tags
.. _sphinx.ext.doctest: https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html
.. _tox: https://tox.wiki/en/stable/
.. _xarray: https://github.com/pydata/xarray

Expand Down
1 change: 1 addition & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def autolog(message: str, section: str | None = None, color: str | None = None)
"https://www.ncei.noaa.gov/products/optimum-interpolation-sst",
"https://earthexplorer.usgs.gov",
"https://www.fvcom.org",
"https://www.gnu.org/software/make/",
]
linkcheck_retries = 3

Expand Down
131 changes: 131 additions & 0 deletions docs/src/developer/documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
.. include:: ../common.txt

.. _gv-developer-documentation:

:fa:`square-pen` Documentation
==============================

Here we provide some high-level guidelines and best practice advice for authors and
contributors wishing to build and render the documentation.


:fa:`screwdriver-wrench` Building
---------------------------------

The documentation is built using `sphinx`_ to parse and render `reStructuredText`_
(``rst``) documents into ``HTML``.

We also use `myst-parser`_, a ``sphinx`` and `docutils`_ extension to parse and convert
:term:`MyST` to ``rst``, and `myst-nb`_ to execute and convert
`Jupyter Notebooks`_ into ``sphinx`` documents.

.. seealso::
:class: margin, dropdown, toggle-shown

For configuration details see ``Makefile`` and ``conf.py``.

The documentation is built using `sphinx-build`_ and the `GNU make`_ tool.


:fa:`pump-medical` Hygiene
~~~~~~~~~~~~~~~~~~~~~~~~~~

Start afresh by performing documentation hygiene to purge various build artifacts.

.. table:: Housekeeping Commands
:widths: 1 3
:align: center

+-------------------------+----------------------------------------------------------------------------------+
| Make Command | Description |
+=========================+==================================================================================+
| :guilabel:`clean` | Purge all `sphinx-autoapi`_, `sphinx-gallery`_, `sphinx-tags`_, carousel, and |
| | other `sphinx-build`_ artifacts. |
+-------------------------+----------------------------------------------------------------------------------+
| :guilabel:`clean-all` | Perform both a ``clean`` and ``clean-cache``. |
+-------------------------+----------------------------------------------------------------------------------+
| :guilabel:`clean-cache` | Purge the `myst-nb`_ Jupyter cache. See `myst-nb configuration`_ |
| | for further details. |
+-------------------------+----------------------------------------------------------------------------------+


:fa:`pen-to-square` Build
~~~~~~~~~~~~~~~~~~~~~~~~~

Build the documentation along with various controls to limit image creation. Note that building the documentation
static images and interactive scenes can be resource hungry and time consuming.

.. table:: Build Commands
:widths: 2 1 3
:align: center

+----------------------------+---------------------+--------------------------------------------------------------+
| Make Command | Status | Description |
+============================+=====================+==============================================================+
| :guilabel:`html` | :fas:`square-check` | Build the full suite of documentation including all images |
| | | and scenes. |
+----------------------------+---------------------+--------------------------------------------------------------+
| :guilabel:`html-docstring` | :fas:`square-check` | Build the full suite of documentation and only the |
| | | ``docstring`` images and scenes. |
+----------------------------+---------------------+--------------------------------------------------------------+
| :guilabel:`html-gallery` | :fas:`square-check` | Build the full suite of documentation and only the |
| | | `sphinx-gallery`_ images and scenes, which also includes the |
| | | carousel. |
+----------------------------+---------------------+--------------------------------------------------------------+
| :guilabel:`html-inline` | :fas:`square-xmark` | Build the full suite of documentation and only inline |
| | | documentation images and scenes. See :far:`circle-dot` |
| | | :issue:`1150`. |
+----------------------------+---------------------+--------------------------------------------------------------+
| :guilabel:`html-noplot` | :fas:`square-check` | Build the full suite of documentation with no static images |
| | | and no interactive scenes. |
+----------------------------+---------------------+--------------------------------------------------------------+
| :guilabel:`html-tutorial` | :fas:`square-check` | Build the full suite of documentation and only the tutorial |
| | | notebooks. |
+----------------------------+---------------------+--------------------------------------------------------------+


:fab:`readme` Render
~~~~~~~~~~~~~~~~~~~~

How-to serve the rendered documentation for inspection in a local browser.

.. table:: Render Commands
:widths: 1 3
:align: center

+------------------------+-------------------------------------------------------------------------------------+
| Make Command | Description |
+========================+=====================================================================================+
| :guilabel:`serve-html` | Start a local ``HTTP`` server on port ``11000`` to view the rendered documentation. |
| | This is necessary in order to support interactive scenes. |
+------------------------+-------------------------------------------------------------------------------------+


:fa:`vial-circle-check` Test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Perform documentation quality assurance.

.. table:: Test Commands
:widths: 1 3
:align: center

+-----------------------+----------------------------------------------------------------------------------+
| Make Command | Description |
+=======================+==================================================================================+
| :guilabel:`doctest` | Execute `sphinx.ext.doctest`_ to test snippets within the documentation. |
+-----------------------+----------------------------------------------------------------------------------+
| :guilabel:`linkcheck` | Check the integrity of all external links referenced within the documentation |
| | using the `sphinx linkcheck builder`_. |
+-----------------------+----------------------------------------------------------------------------------+


.. comment

Page link URL resources in alphabetical order:


.. _GNU make: https://www.gnu.org/software/make/
.. _Jupyter Notebooks: https://jupyter.org/
.. _myst-nb configuration: https://myst-nb.readthedocs.io/en/latest/configuration.html
.. _sphinx linkcheck builder: https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.linkcheck.CheckExternalLinksBuilder
14 changes: 13 additions & 1 deletion docs/src/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

|Contributor Covenant|

Firstly, and most importantly, thank you for contributing! All contributions, no
Firstly, and most importantly, thanks for contributing! All contributions, no
matter how large or small are greatly appreciated and welcomed.

Here we provide some guidelines to help get you started on your journey, and
Expand All @@ -36,9 +36,21 @@ clarify the various steps involved in how to contribute to ``geovista``.

Towncrier guidelines.

.. grid-item-card:: Documentation
:class-title: custom-title
:class-body: custom-body
:link: gv-developer-documentation
:link-type: ref
:img-top: ../_static/images/icons/documentation.svg
:class-img-top: dark-light
:class-card: sd-rounded-3

Author & build guidelines.


.. toctree::
:maxdepth: 1
:hidden:

towncrier
documentation
5 changes: 5 additions & 0 deletions docs/src/reference/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ Say what you mean. Mean what you say.
A spatially referenced dataset that may be a surface or volume in 3-D
space. See `What is a Mesh?`_

MyST
*Markedly Structured Text* is a rich and extensible flavour of ``Markdown``
for authoring technical and scientific documents. See `myst-nb`_ and
`myst-parser`_ from the `Executable Books`_ organisation.

Node
Nodes are the vertices of a mesh. Also see :term:`Point`.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Consult our reference material for no fuss facts about ``geovista``.
:class-img-top: dark-light
:class-card: sd-rounded-3

Behaviour and state docstrings.
Behaviour & state docstrings.

.. grid-item-card:: Changelog
:class-title: custom-title
Expand Down
Loading