Skip to content

Commit

Permalink
DOC: Fix Sphinx documentation
Browse files Browse the repository at this point in the history
Fix Sphinx documentation:
- Add a pre-build task to the `readthedocs` config file in order to
  generate the `rst` files from the package docstrings so that Sphinx
  build the HTML files from them.
- Add the `napoleon` extension to the Sphinx config file so that it can
  parse NumPy and Google style docstrings.
- Fix the `index.rst` file so that the package API is effectively
  displayed: set `whitematterpackage` as the entry for the reference
  section.
- Set the `bin` and `utilities` packages as the entries for the scripts
  section in the `index.rst` file.
  • Loading branch information
jhlegarreta committed Oct 24, 2023
1 parent 6bd4a22 commit 7acafa0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ build:
apt_packages:
- libblas-dev
- liblapack-dev
jobs:
pre_build:
- sphinx-apidoc -f -o doc .

# Build documentation in the doc/ directory with Sphinx
sphinx:
Expand Down
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
8 changes: 8 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
Welcome to the whitematteranalysis documentation!
=================================================

.. toctree::
:maxdepth: 1
:caption: Reference

whitematteranalysis

.. toctree::
:maxdepth: 1
:caption: Scripts

bin
utilities

0 comments on commit 7acafa0

Please sign in to comment.