Skip to content

Commit ea15e3b

Browse files
committed
docs: explain how to build docs locally
1 parent 5b9c274 commit ea15e3b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/installation.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,38 @@ If you want to run a subset of tests, you can use the `-R` option with a regular
252252
ctest -R Xios
253253
254254
For more information on `ctest` options, you can refer to the official `ctest` documentation.
255+
256+
Building the Documentation (Locally)
257+
------------------------------------
258+
259+
If you would like to build the documentation locally, follow the instructions below.
260+
261+
A Dockerfile is provided in the ``Dockerfiles`` directory to build the documentation i.e., ``Dockerfile.sphinx``.
262+
263+
To build the docker image run the following command from the root of the repository:
264+
265+
.. code-block:: console
266+
267+
docker build --file Dockerfiles/Dockerfile.sphinx . -t nextsim-docs:latest
268+
269+
This should create a local docker image called ``nextsim-docs:latest``.
270+
271+
To build the documentation, run the following command from the root of the repository:
272+
273+
.. code-block:: console
274+
275+
docker run --rm -v $PWD:/docs nextsim-docs:latest
276+
277+
Optionally, you can specify the number of jobs to use for building the documentation. For example, to use 4 jobs, run:
278+
279+
.. code-block:: console
280+
281+
docker run --rm -v $PWD:/docs nextsim-docs:latest 4
282+
283+
Finally, to view the built documentation, open the file ``docs/_build/html/index.html`` in your web browser e.g.,
284+
285+
.. code-block:: console
286+
287+
xdg-open docs/_build/html/index.html # Linux
288+
open docs/_build/html/index.html # MacOS
289+
start docs\_build\html\index.html # Windows

0 commit comments

Comments
 (0)