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 `tractolearn` as the entry for the reference section.
- Set the `scripts` package as the entry for the scripts section in the
  `index.rst` file.
  • Loading branch information
jhlegarreta committed Oct 28, 2023
1 parent 548392e commit 5607ea7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 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 @@ -43,6 +43,7 @@
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
12 changes: 9 additions & 3 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ Welcome to the tractolearn documentation!
=========================================

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

modules/tractolearn
scripts/modules
tractolearn

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

scripts

0 comments on commit 5607ea7

Please sign in to comment.