Skip to content

Add instructions for building the docs #982

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

Merged
merged 11 commits into from
Jul 17, 2020
38 changes: 34 additions & 4 deletions docs/sphinx/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,42 @@ Parameters that specify a specific type require that specific input type.

Read the Docs will automatically build the documentation for each pull
request. Please confirm the documentation renders correctly by following
the ``continuous-documentation/read-the-docs`` link within the checks
the ``docs/readthedocs.org:pvlib-python`` link within the checks
status box at the bottom of the pull request.

To build the docs locally, install the ``doc`` dependencies specified in the
`setup.py <https://github.com/pvlib/pvlib-python/blob/master/setup.py>`_
file. See :ref:`installation` instructions for more information.
Building the documentation
--------------------------

Building the documentation locally is useful for testing out changes to the
documentation's source code without having to repeatedly update a PR and have
Read the Docs build it for you. Building the docs locally requires installing
pvlib python as an editable library (see :ref:`installation` for instructions).
First, install the ``doc`` dependencies specified in the
``EXTRAS_REQUIRE`` section of
`setup.py <https://github.com/pvlib/pvlib-python/blob/master/setup.py>`_.
An easy way to do this is with::

pip install pvlib[doc]

Note: Anaconda users may have trouble using the above command to update an
older version of docutils. If that happens, you can update it with ``conda``
(e.g. ``conda install docutils=0.15.2``) and run the above command again.

Once the ``doc`` dependencies are installed, navigate to ``/docs/sphinx`` and
execute::

make html

Be sure to skim through the output of this command because Sphinx might emit
helpful warnings about problems with the documentation source code.
If the build succeeds, it will make a new directory ``docs/sphinx/build``
with the documentation's homepage located at ``build/html/index.html``.
This file can be opened with a web browser to view the local version
like any other website. Other output formats are available; run ``make help``
for more information.

Note that Windows users need not have the ``make`` utility installed as pvlib
includes a ``make.bat`` batch file that emulates its interface.

Example Gallery
---------------
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/source/whatsnew/v0.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Documentation
* Clarify units for heat loss factors in
:py:func:`pvlib.temperature.pvsyst_cell` and
:py:func:`pvlib.temperature.faiman`. (:pull:`960`)
* Add instructions to build the documentation. (:pull:`982`)
* Corrected key names for :py:func:`pvlib.inverter.sandia`. (:issue:`976`,
:pull:`886`)
* Add a transposition gain example to the gallery. (:pull:`979`)
Expand Down
5 changes: 3 additions & 2 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
python:
version: 3
use_system_site_packages: true
# only use the packages specified in setup.py
use_system_site_packages: false
pip_install: true
extra_requirements:
- all
- doc
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
'optional': ['ephem', 'cython', 'netcdf4', 'nrel-pysam', 'numba',
'pvfactors', 'scipy', 'siphon', 'tables', 'cftime >= 1.1.1'],
'doc': ['ipython', 'matplotlib', 'sphinx == 1.8.5', 'sphinx_rtd_theme',
'sphinx-gallery', 'docutils == 0.15.2'],
'sphinx-gallery', 'docutils == 0.15.2', 'pillow', 'scipy',
'netcdf4', 'siphon', 'tables'],
'test': TESTS_REQUIRE
}
EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))
Expand Down