diff --git a/docs/sphinx/source/contributing.rst b/docs/sphinx/source/contributing.rst index 59125dbedf..5a629730af 100644 --- a/docs/sphinx/source/contributing.rst +++ b/docs/sphinx/source/contributing.rst @@ -254,6 +254,40 @@ To build the docs locally, install the ``doc`` dependencies specified in the `setup.py `_ file. See :ref:`installation` instructions for more information. +Example Gallery +--------------- + +The example gallery uses `sphinx-gallery `_ +and is generated from script files in the +`docs/examples `_ +directory. sphinx-gallery will execute example files that start with +``plot_`` and capture the output. + +Here is a starter template for new examples: + +.. code-block:: python + + """ + Page Title + ========== + + A sentence describing the example. + """ + + # %% + # Explanatory text about the example, what it does, why it does it, etc. + # Text in the comment block before the first line of code `import pvlib` + # will be printed to the example's webpage. + + import pvlib + import matplotlib.pyplot as plt + + plt.scatter([1, 2, 3], [4, 5, 6]) + plt.show() + +For more details, see the sphinx-gallery +`docs `_. + .. _testing: Testing diff --git a/docs/sphinx/source/whatsnew/v0.7.2.rst b/docs/sphinx/source/whatsnew/v0.7.2.rst index f788c6bf0d..a63440c9bf 100644 --- a/docs/sphinx/source/whatsnew/v0.7.2.rst +++ b/docs/sphinx/source/whatsnew/v0.7.2.rst @@ -38,8 +38,9 @@ Bug fixes Documentation ~~~~~~~~~~~~~ -* Add NumFOCUS affiliation to Sphinx documentation :pull:`862` -* Add example of IV curve generation :pull:`872` +* Add NumFOCUS affiliation to Sphinx documentation (:pull:`862`) +* Add example of IV curve generation (:pull:`872`) +* Add section about gallery examples to Contributing guide (:pull:`905`) Requirements ~~~~~~~~~~~~