Skip to content

Working with CAM documentation on github and sphinx

Alice Bertini edited this page Feb 23, 2017 · 19 revisions

The CAM documentation is written using reStructuredText markup language. ReStructuredText is a markup language, like HTML, markdown or latex.

Sphinx is a python tool for publishing reStructuredText documents in other formats such as HTML and PDF.

The CAM documentation is stored in the gh-pages branch of the NCAR/CAM repository. The sphinx generated HTML pages are accessible from URL http://ncar.github.io/CAM/doc/build/html/index.html

Here are the steps for working with the NCAR/CAM documentation:

git clone -b gh-pages https://github.com/NCAR/CAM.git

  • edit the *.rst pages of interest in the ~/CAM/doc/source directory

  • generate the html pages using sphinx by running make in the ~/CAM/doc directory Note: you may need to update your PATH environment variable to include the path to the sphinx-build script. On the mac, the default location for this script is:

python-packages/bin/sphinx-build

make html

  • view your changes in a local browser window using::

    open ~/CAM/doc/build/html/index.html

  • push just changes back to the github gh-pages branch.

git push origin gh-pages

The resulting URL with the html generated pages is:

[https://ncar.github.io/CAM/doc/build/html/index.html] (https://ncar.github.io/CAM/doc/build/html/index.html)


Here are some resources for learning markup with reStructuredText and using Sphinx.

For Mac users with Macports (CGD folks, IS will install it for you if you don't already have it), I recommend:

sudo port install py27-sphinx