..
   -----------------------------------------------------------------------------
   SUNDIALS Copyright Start
   Copyright (c) 2002-2024, Lawrence Livermore National Security
   and Southern Methodist University.
   All rights reserved.

   See the top-level LICENSE and NOTICE files for details.

   SPDX-License-Identifier: BSD-3-Clause
   SUNDIALS Copyright End
   -----------------------------------------------------------------------------

.. _Documentation_Setup:

Developing Documentation
=========================

Setting Up Sphinx
-----------------

The Sundials documentation is generated by Sphinx. To set up Sphinx locally,
run the following commands:

.. code-block:: bash

    $ cd doc
    $ pip install -r requirements.txt

Running the above will install the necessary Sphinx version. A Python virtual environment can also be used by activating the environment before running the above commands.

Building and Running Documentation Locally
-------------------------------------------

To build the general documentation (also viewable from `here <https://sundials.readthedocs.io>`_), run the following:

.. code-block:: bash

    $ cd doc/superbuild
    $ make html

To build the developer documentation, run the following:

.. code-block:: bash

    $ cd doc/sundials_developers
    $ make html

To run documentation locally, open `build/html/index.html`.

On Windows, use the following command:

.. code-block:: bash

    $ start build/html/index.html

On Mac, use the following command:

.. code-block:: bash

    $ open build/html/index.html

On Linux, use the following:

.. code-block:: bash

    $ xdg-open build/html/index.html
