Skip to content

Commit 4380445

Browse files
authored
Add instructions for building the docs (pvlib#982)
* Update contributing.rst * whatsnew * review improvements * install optional as well as doc * add pillow to doc requirements * update doc requirements list * only install [doc] instead of [all] for RTD * turn off system packages for RTD
1 parent ca5d62f commit 4380445

File tree

4 files changed

+40
-7
lines changed

4 files changed

+40
-7
lines changed

docs/sphinx/source/contributing.rst

+34-4
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,42 @@ Parameters that specify a specific type require that specific input type.
247247

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

253-
To build the docs locally, install the ``doc`` dependencies specified in the
254-
`setup.py <https://github.com/pvlib/pvlib-python/blob/master/setup.py>`_
255-
file. See :ref:`installation` instructions for more information.
253+
Building the documentation
254+
--------------------------
255+
256+
Building the documentation locally is useful for testing out changes to the
257+
documentation's source code without having to repeatedly update a PR and have
258+
Read the Docs build it for you. Building the docs locally requires installing
259+
pvlib python as an editable library (see :ref:`installation` for instructions).
260+
First, install the ``doc`` dependencies specified in the
261+
``EXTRAS_REQUIRE`` section of
262+
`setup.py <https://github.com/pvlib/pvlib-python/blob/master/setup.py>`_.
263+
An easy way to do this is with::
264+
265+
pip install pvlib[doc]
266+
267+
Note: Anaconda users may have trouble using the above command to update an
268+
older version of docutils. If that happens, you can update it with ``conda``
269+
(e.g. ``conda install docutils=0.15.2``) and run the above command again.
270+
271+
Once the ``doc`` dependencies are installed, navigate to ``/docs/sphinx`` and
272+
execute::
273+
274+
make html
275+
276+
Be sure to skim through the output of this command because Sphinx might emit
277+
helpful warnings about problems with the documentation source code.
278+
If the build succeeds, it will make a new directory ``docs/sphinx/build``
279+
with the documentation's homepage located at ``build/html/index.html``.
280+
This file can be opened with a web browser to view the local version
281+
like any other website. Other output formats are available; run ``make help``
282+
for more information.
283+
284+
Note that Windows users need not have the ``make`` utility installed as pvlib
285+
includes a ``make.bat`` batch file that emulates its interface.
256286

257287
Example Gallery
258288
---------------

docs/sphinx/source/whatsnew/v0.8.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Documentation
4444
* Clarify units for heat loss factors in
4545
:py:func:`pvlib.temperature.pvsyst_cell` and
4646
:py:func:`pvlib.temperature.faiman`. (:pull:`960`)
47+
* Add instructions to build the documentation. (:pull:`982`)
4748
* Corrected key names for :py:func:`pvlib.inverter.sandia`. (:issue:`976`,
4849
:pull:`886`)
4950
* Add a transposition gain example to the gallery. (:pull:`979`)

readthedocs.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
python:
22
version: 3
3-
use_system_site_packages: true
3+
# only use the packages specified in setup.py
4+
use_system_site_packages: false
45
pip_install: true
56
extra_requirements:
6-
- all
7+
- doc

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
'optional': ['ephem', 'cython', 'netcdf4', 'nrel-pysam', 'numba',
4848
'pvfactors', 'scipy', 'siphon', 'tables', 'cftime >= 1.1.1'],
4949
'doc': ['ipython', 'matplotlib', 'sphinx == 1.8.5', 'sphinx_rtd_theme',
50-
'sphinx-gallery', 'docutils == 0.15.2'],
50+
'sphinx-gallery', 'docutils == 0.15.2', 'pillow', 'scipy',
51+
'netcdf4', 'siphon', 'tables'],
5152
'test': TESTS_REQUIRE
5253
}
5354
EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))

0 commit comments

Comments
 (0)