diff --git a/doc/contributing.rst b/doc/contributing.rst index da9c89234a3..d216488e805 100644 --- a/doc/contributing.rst +++ b/doc/contributing.rst @@ -285,17 +285,23 @@ How to build the *xarray* documentation Requirements ~~~~~~~~~~~~ +Make sure to follow the instructions on :ref:`creating a development environment above `, but +to build the docs you need to use the environment file ``doc/environment.yml``. -First, you need to have a development environment to be able to build xarray -(see the docs on :ref:`creating a development environment above `). +.. code-block:: none -Building the documentation -~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Create and activate the docs environment + conda env create -f doc/environment.yml + conda activate xarray-docs -In your development environment, install ``sphinx``, ``sphinx_rtd_theme``, -``sphinx-gallery`` and ``numpydoc``:: + # or with older versions of Anaconda: + source activate xarray-docs - conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc + # Build and install xarray + pip install -e . + +Building the documentation +~~~~~~~~~~~~~~~~~~~~~~~~~~ Navigate to your local ``xarray/doc/`` directory in the console and run::