Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: use sphinx-apipages extension #349

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions docs/_templates/autosummary/base.rst

This file was deleted.

19 changes: 0 additions & 19 deletions docs/_templates/autosummary/class.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/_templates/autosummary/function.rst

This file was deleted.

26 changes: 7 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from datetime import date
import os
import shutil

import toml

Expand Down Expand Up @@ -30,18 +28,16 @@
"Thumbs.db",
".DS_Store",
]
templates_path = ["_templates"]
pygments_style = None
extensions = [
"sphinx.ext.graphviz",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon", # support for Google-style docstrings
"sphinx.ext.autosummary",
"sphinx_autodoc_typehints",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_copybutton",
"jupyter_sphinx",
"sphinx_apipages",
]

napoleon_use_ivar = True # List of class attributes
Expand Down Expand Up @@ -73,9 +69,12 @@
]
graphviz_output_format = "svg"

# Disable auto-generation of TOC entries in the API
# https://github.com/sphinx-doc/sphinx/issues/6316
toc_object_entries = False
apipages_hidden_methods = [
"__call__",
"__contains__",
"__getitem__",
"__len__",
]

# HTML --------------------------------------------------------------------
html_theme = "sphinx_audeering_theme"
Expand Down Expand Up @@ -126,14 +125,3 @@
only_metadata=True,
verbose=False,
)


# Copy API (sub-)module RST files to docs/api/ folder ---------------------
audeer.rmdir("api")
audeer.mkdir("api")
api_src_files = audeer.list_file_names("api-src")
api_dst_files = [
audeer.path("api", os.path.basename(src_file)) for src_file in api_src_files
]
for src_file, dst_file in zip(api_src_files, api_dst_files):
shutil.copyfile(src_file, dst_file)
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ipykernel
jupyter-sphinx
pyarrow
sphinx >=3.5.4
sphinx-apipages >=0.1.2
sphinx-audeering-theme >=1.2.1
sphinx-autodoc-typehints
sphinx-copybutton
Expand Down