Skip to content

Commit

Permalink
docs: switch from autodoc to autoapi
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Feb 22, 2024
1 parent d20c603 commit e182bac
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 118 deletions.
7 changes: 4 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "mambaforge-22.9"
python: "3.11"
# python: "mambaforge-22.9"

sphinx:
configuration: docs/conf.py

conda:
environment: env/RTD_env.yml
# conda:
# environment: env/RTD_env.yml
7 changes: 0 additions & 7 deletions docs/_templates/module.rst_t

This file was deleted.

36 changes: 0 additions & 36 deletions docs/_templates/package.rst_t

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_templates/toc.rst_t

This file was deleted.

5 changes: 5 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API Reference

```{toctree}
autoapi/invert4geom/index
```
6 changes: 0 additions & 6 deletions docs/api/invert4geom.cross_validation.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/invert4geom.inversion.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/invert4geom.optimization.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/invert4geom.plotting.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/invert4geom.regional.rst

This file was deleted.

14 changes: 0 additions & 14 deletions docs/api/invert4geom.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/invert4geom.synthetic.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/invert4geom.utils.rst

This file was deleted.

9 changes: 6 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
version = release = invert4geom.__version__
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"autoapi.extension",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx_autodoc_typehints",
"sphinx.ext.autodoc",
"sphinx_copybutton",
"myst_parser",
"sphinx_design",
"nbsphinx",
"sphinx.ext.viewcode",
# "sphinx.ext.autosummary",
]
source_suffix = [".rst", ".md"]
exclude_patterns = [
Expand Down Expand Up @@ -88,6 +87,10 @@
# apidoc_module_dir = '../src/invert4geom'
# apidoc_excluded_paths = ['tests']
# apidoc_separate_modules = False
autoapi_dirs = ["../src/invert4geom"]
autoapi_type = "python"
autoapi_add_toctree_entry = False
autodoc_typehints = "description"

# HTML output configuration
# -----------------------------------------------------------------------------
Expand Down
16 changes: 10 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ gallery/index.md
user_guide/index.md
```

<!-- ```{toctree}
<!--
```{toctree}
:maxdepth: 1
:hidden:
:caption: 🚶 User guide
Expand All @@ -39,20 +40,23 @@ user_guide/including_starting_model
user_guide/adhering_to_constraints
user_guide/combining_it_all
user_guide/estimating_regional_field
``` -->
```
-->

<!-- ```{toctree}
<!--
```{toctree}
:maxdepth: 1
:hidden:
:caption: 📚 Gallery
gallery/index.md
``` -->
```
-->

```{toctree}
:maxdepth: 2
:hidden:
:caption: 📖 Reference documentation
api/invert4geom
api.md
citing.md
changelog.md
references.rst
Expand Down Expand Up @@ -94,7 +98,7 @@ Start a discussion on GitHub!
:::{grid-item-card} {octicon}`file-badge` Reference documentation
:text-align: center
A list of modules and functions
```{button-ref} api/invert4geom
```{button-ref} api
:click-parent:
:color: primary
:outline:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ docs = [
"sphinx>=4.0",
"myst_parser",
"sphinx_copybutton",
"sphinx_autoapi",
"sphinx_autodoc_typehints",
"sphinx-book-theme>=0.3",
"sphinx_design",
Expand Down

0 comments on commit e182bac

Please sign in to comment.