Documentation#
Here we provide some high-level guidelines and best practice advice for authors and contributors wishing to build and render the documentation.
Building#
Reference:
docs/Makefiledocs/src/conf.py
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
MyST to rst, and myst-nb to execute and convert
Jupyter Notebooks into sphinx documents.
The documentation is built using sphinx-build and the GNU make tool from within
the docs root directory e.g.,
$ cd docs
$ make <make-task>
The following sections describe the make command tasks that are available.
Hygiene#
Start afresh with confidence by performing documentation hygiene to purge various build artifacts.
Make Task |
説明 |
|---|---|
clean |
Purge all sphinx-autoapi, sphinx-gallery, sphinx-tags, carousel, and other sphinx-build artifacts. |
clean-all |
Perform both the clean and clean-cache tasks. |
clean-cache |
Purge the myst-nb Jupyter cache. See myst-nb configuration for further details. |
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.
Make Task |
説明 |
|---|---|
html |
Build the full suite of documentation including all images and scenes. |
html-docstring |
Build the full suite of documentation with only the |
html-docstring-inline |
Build the full suite of documentation with only the |
html-gallery |
Build the full suite of documentation with only the sphinx-gallery images and scenes, which also includes the carousel. |
html-inline |
Build the full suite of documentation with only inline documentation images and scenes. |
html-noplot |
Build the full suite of documentation with no static images and no interactive scenes. |
html-tutorial |
Build the full suite of documentation with only the tutorial notebooks. images and scenes. |
Render#
How-to serve the rendered documentation for inspection in a local browser.
Make Task |
説明 |
|---|---|
serve-html |
Start a local |
Test#
Perform documentation quality assurance.
Make Task |
説明 |
|---|---|
doctest |
Execute sphinx.ext.doctest to test code snippets within the documentation. |
Branding#
Reference:
docs/src/_staticdocs/src/conf.py
Our icons are provided by Font Awesome. Font Awesome (Free) is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Static icon assets are located in the docs/src/_static/images/icons directory,
along with the Font Awesome LICENSE.txt file. Refer to the docs/src/conf.py
for asset configuration details.
Other branding assets are available from the geovista-media repository.
Branding colours (RGB) are defined in docs/src/_static/color.css:
#80d050(128,208,80) is the primary colour (gv-text-main)#7f2faf(127,47,175) is the complementary colour (gv-text-comp)
Badge#
Reference:
docs/assets/badge/v0.json
Our shields.io badge asset is encoded as a JSON Endpoint Response.
The badge logo is based on the public domain Earth Grid Symbol SVG Vector, which is freely available and distributed under a CC0-1.0 licence.
<a href="https://geovista.readthedocs.io/en/latest/" >
<img alt="geovista-badge" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/bjlittle/geovista/main/docs/assets/badge/v0.json" />
</a>
[](https://geovista.readthedocs.io/en/latest/)
.. |geovista-badge| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/bjlittle/geovista/main/docs/assets/badge/v0.json
:target: https://geovista.readthedocs.io/en/latest/
Logo#
Reference:
docs/src/_static/brand/geovista-logo.svg
Fig. 5: GeoVista Logo#
The geovista logo takes its inspiration from The Great Wave off Kanagawa
(c. 1830-1832) by Katsushika Hokusai, the influential Japanese ukiyo-e
woodblock print artist. The logo palette is primarily sampled from the painting,
and also includes all four classical elements of earth (),
water (), air (), and fire (),
reflecting the theme of nature woven throughout the geovista documentation.
Logo Font#
Reference:
docs/src/_static/brand/geovista-title.svgdocs/src/_static/fonts/la-machine-company.ttf
The geovista logo title is rendered using the La Machine Company TrueType font.
Fig. 6: GeoVista Logo Title#
Continuous Integration#
Reference:
.github/workflows
The following documentation workflows are available:
Workflow |
説明 |
|---|---|
The ci-docs.yml Action executes sphinx.ext.doctest to test doctest-style and code-output-style blocks within the documentation. Also see the documentation Pixi Workflow doctest task. |
|
The ci-tests-docs.yml Action builds the documentation using the
Also see the make build tasks for further details. |
|
The .readthedocs.yml workflow builds and publishes our documentation on the ReadtheDocs (RTD) platform. See the Versions section for each Refer to the Builds section for a render of the documentation for each
|
Copyright & License#
Reference:
LICENSEpyproject.toml
Source code must contain the following copyright and license preamble at the top of the file:
# Copyright (c) 2021, GeoVista Contributors.
#
# This file is part of GeoVista and is distributed under the 3-Clause BSD license.
# See the LICENSE file in the package root directory for licensing details.
Quality assurance of preamble compliance is provided by the ruff preview rule
CPY001 (flake8-copyright).
Configuration of this single preview rule is defined in the pyproject.toml manifest.
For further details refer to the following TOML tables:
[tool.ruff.lint][tool.ruff.lint.flake8-copyright][tool.ruff.lint.per-file-ignores]
Cross-References#
Reference:
docs/src/common.txt
Arbitrary locations are cross-referenced using reStructuredText labels and the sphinx
:ref:
role.
For consistency, the following structure is recommended for our labels:
A label should be prefixed with
gv-to indicate inclusion within thegeovistanamespace.The
gv-prefix should then be followed by the name of the file containing the label, with hyphens replacing spaces and special characters, and all characters in lower case e.g.,gv-next-stepsfor thedocs/src/next_steps.rstdocument. Include the sub-directory structure in the label if the file is not in thedocs/srcdirectory, e.g.,gv-developer-towncrierfor thedocs/src/developer/towncrier.rstdocument.If appropriate, the label should then be followed by the title of the section or subsection it's referencing, with hyphens replacing spaces and special characters, and all characters in lower case e.g.,
gv-developer-documentation-cross-referencesfor the Cross-References section in thisdocs/src/developer/documentation.rstdocument. If the label doesn't proceed a section or subsection title, then use a suitable description that is concise and uniquely identifies the location within the document. Avoid using abbreviations or acronyms unless strictly necessary.
Tip
A label prefixed with tippy-gv- instead of gv- will have a
sphinx-tippy tooltip rendered for each of its cross-reference links e.g.,
hover over this
Cross-References tooltip enabled link
A top-level label must be present on the first line of a document.
An include directive may be used on the first line of a document providing convenient access to common project references e.g.,
.. include:: common.txt
Where the common.txt file is located in the docs/src directory.
Otherwise, the top-level label must follow the include directive e.g., the
docs/src/developer/documentation.rst document has the following preamble:
.. include:: ../common.txt
.. _gv-developer-documentation:
.. _tippy-gv-developer-documentation:
:fa:`square-pen` Documentation
==============================
To cross-reference a figure or a table use the :name: option to
create the label, ensuring to append its title (or similar) for uniqueness e.g.,
the docs/src/overview.rst document has the following
figure within
its Ecosystem section:
.. figure:: _static/images/ecosystem.png
:align: center
:alt: GeoVista Ecosystem
:name: tippy-gv-overview-ecosystem-geovista-ecosystem
Ecosystem of ``geovista``
ヒント
To support accessibility best practice use the :alt: option for both
image and figure directives.
Pixi Workflow#
Reference:
pyproject.toml
Pixi Environment
Documentation pixi tasks are available in the
docs, geovista and py3xx variant of
those pixi environments e.g., geovista-py313. See
Packaging for further details.
The documentation may be built and rendered using
pixi run tasks, all of
which do not require to be executed from within the docs root directory, unlike
the above Building make command tasks e.g.,
$ pixi run <pixi-task>
Pixi Task |
説明 |
|---|---|
clean |
Purge all sphinx-autoapi, sphinx-gallery, sphinx-tags, carousel, and other sphinx-build artifacts. |
clean-all |
Perform both the clean and clean-cache tasks. |
clean-cache |
Purge the myst-nb Jupyter cache. See myst-nb configuration for further details. |
doctest |
Execute sphinx.ext.doctest to test code snippets within the documentation. Note that the clean task is called prior to running this task. |
make |
Build the documentation using Note that the clean task is called prior to running this task. |
serve-html |
Build the documentation using Note that the clean and make tasks are called prior to running this task. |
tests-doc |
Perform documentation image tests of $ pixi run tests-doc
This task calls Note that the tests-clean, download and make tasks are called prior to running this task. See Packaging for further details. This task is only available in the geovista and geovista-py3xx environments. 注釈 Failed image tests are captured via the |
Tip
Apply the --frozen option to avoid pixi checking and updating the pixi.lock file.
E.g., To only build the Gallery examples and serve the rendered documentation:
$ pixi run --frozen serve-html html-gallery
Tagging#
Reference:
docs/src/conf.py
Themed content Tags are supported using sphinx-tags.
Tags provide a simple and intuitive way to group and filter content, improving discoverability and browsing. This allows users to easily explore or quickly find related topics and content.
Gallery Examples must contain one or more content
tags using the tags directive to highlight noteworthy topics demonstrated
within the example e.g.,
.. tags::
component: manifold, filter: contour
A tag consists of a lower-case category: topic pair, where:
categoryis a domain area of interest,topicis a specific subject within that domain, anda colon (
:) separates each of the above tag components
Single word tags are preferred. However, consider using a hyphen (-) to
separate a multi-word category or topic within a tag e.g.,
data-type: point-cloud.
Endeavour to group tags of the same category on the same line, ordered
alphabetically by topic. Note that multiple tags must be separated by a
comma (,).
Tags may span multiple contiguous lines, ordered alphabetically by category
e.g.,
.. tags::
component: coastlines, component: manifold, component: texture,
filter: threshold,
render: camera, render: subplots,
sample: unstructured,
style: opacity
Category |
Topic |
説明 |
|---|---|---|
component |
|
Content that demonstrates the use of a specific feature. |
domain |
|
Content that is relevant to a specific scientific domain or discipline. |
filter |
|
Content that demonstrates the use of specific filtering techniques. |
load |
|
Demonstrates use of the |
plot |
|
Content that showcases various plotting techniques. |
projection |
|
Content that demonstrates the use of geospatial projections or transformations. |
resolution |
|
Content using high-resolution or high-volume geospatial data. |
sample |
|
Content that leverages the convenience of
pre-canned geospatial sample data available
from the |
style |
|
Content that includes customization of various render styles and aesthetics. |
widget |
|
Content that demonstrates the use of interactive widgets. |
注釈
Experimental features may be tagged with experimental 🧪