Skip to content

Commit

Permalink
DOC: use sphinx-apipages extension (#130)
Browse files Browse the repository at this point in the history
* DOC: use sphinx-apipages extension

* Require sphinx-apipages>=0.1.2

* Specify hidden class methods to be included
  • Loading branch information
hagenw authored Jan 10, 2024
1 parent 73fc6fd commit 2461353
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 51 deletions.
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.

33 changes: 11 additions & 22 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import os
import shutil

import audeer


Expand All @@ -21,16 +18,14 @@
'.DS_Store',
'api-src',
]
templates_path = ['_templates']
pygments_style = None
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon', # support for Google-style docstrings
'sphinx.ext.autosummary',
'sphinx_autodoc_typehints',
'sphinx_copybutton',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
'sphinx_apipages',
]
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
Expand All @@ -44,10 +39,16 @@
autodoc_default_options = {
'undoc-members': False,
}

# 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__',
'__eq__',
'__lt__',
'__le__',
'__gt__',
'__ge__',
'__repr__',
'__str__',
]


# HTML --------------------------------------------------------------------
Expand All @@ -61,15 +62,3 @@
'display_github': True,
}
html_title = title


# 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
@@ -1,4 +1,5 @@
sphinx >=3.0.0
sphinx-apipages >=0.1.2
sphinx-audeering-theme >=1.1.4
sphinx_autodoc_typehints
sphinx-copybutton

0 comments on commit 2461353

Please sign in to comment.