Skip to content

Commit

Permalink
Fix latex make stanza (maybe), add README.md for building documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mkavulich committed Mar 19, 2024
1 parent c710498 commit 3e34a94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions scm/doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SCM documentation

The SCM technical documentation/users' guide is written in [reStructured Text markup language (RST)](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html). It is designed to be built with the [Sphinx documentation tool](https://www.sphinx-doc.org/en/master/index.html), and is documentation from the `main` branch is configured to build automatically on ReadTheDocs: https://ccpp-scm.readthedocs.io/en/latest/

## Building docs locally

To build the HTML documentation locally (for example, when testing modifications to the documentation), you must have Sphinx [installed on your machine](https://www.sphinx-doc.org/en/master/usage/installation.html), as well as the required python packages listed in the `requirements.txt` file. Once the prerequisite software is installed, you can build the HTML documentation using the following commands:

python -m sphinx -T -b html -d _build/doctrees -D language=en . html

To build a PDF locally, in addition to Sphinx you must have Perl as well as the Perl-based [`latexmk` utility](https://mg.readthedocs.io/latexmk.html#installation). You can then build a PDF using the following commands:

python -m sphinx -T -b latex -d _build/doctrees -D language=en . latex
latexmk -f -pdf -pdflatex="pdflatex" -use-make index.tex

In lieu of running the above commands manually, you can also use `make`. The command `make all` will build both HTML and PDF documentation, while `make html` and `make latex` will build HTML and PDF respectively.

2 changes: 1 addition & 1 deletion scm/doc/TechGuide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all: html latex

latex:
python -m sphinx -T -b latex -d _build/doctrees -D language=en . latex
latexmk -f -pdf -pdflatex="pdflatex" -use-make index.tex
cd latex && latexmk -f -pdf -pdflatex="pdflatex" -use-make index.tex

html:
python -m sphinx -T -b html -d _build/doctrees -D language=en . html
Expand Down

0 comments on commit 3e34a94

Please sign in to comment.