Editing documentation

Editing documentation#

It’s very easy to edit or write documentation for CoFI. Start by cloning our GitHub repository and setting up the environment, following instructions above - fork & clone and environment setup. Then head straight to the parts that you want to change, based on the mapping table below:

Table: documentation page mapping to file path#

Documentation page

File location

Home

docs/index.rst

Installation

docs/installation.rst

Tutorials (front page)

docs/tutorials/scripts/README.rst

Tutorials (tutorials content)

cofi-examples tutorials/tutorial_name.ipynb

Example gallery (front page)

docs/examples/scripts/README.rst

Example gallery (examples content)

cofi-examples examples/example_name/example_name.ipynb

Frequently asked questions

docs/faq.rst

List of functions and classes (API)

docs/api/index.rst

API reference for BaseProblem

src/cofi/base_problem.py

API reference for InversionOptions

src/cofi/inversion_options.py

API reference for Inversion

src/cofi/inversion.py

API reference for InversionResult

src/cofi/inversion.py

API reference for BaseInferenceTool

src/cofi/tools/base_inference_tool.py

Change Log

CHANGELOG.md

Contribute to CoFI

docs/contribute.rst

To change the configuration of this documentation, go change the content in file docs/conf.py.

To adjust the styling of pages, modify things in docs/_static/style.css and docs/_templates.

To test the changes, go to docs directory, run make html and open the file docs/_build/html/index.html in your browser to see the changes.

reStructuredText

All of the documentation (except for the ChangeLog part), including API references, use the reStructuredText format. This is a textual file format that tends to be more powerful compared to markdown.

For the purpose of CoFI documentation, a good resource for reStructuredText syntax is the sample project (we link to the Book theme, the one this documentation uses), with the sources here to refer to.

Build locally#

To generate and check documentation locally,

$ cd docs
$ make html
$ python -m http.server -d build/html

Put localhost:8000 into your browser address bar to read the generated documentation.