use external toc for docs

This commit is contained in:
Izalia Mae 2022-11-16 09:02:37 -05:00
parent 17783d5b9e
commit f74a046d3b
5 changed files with 28 additions and 27 deletions

View file

@ -8,8 +8,8 @@ import sys
from pathlib import Path
## Make sure aputils is in sys.path
modpath = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(modpath))
docpath = Path(__file__).resolve().parent
sys.path.insert(0, str(docpath.parent))
## Get the major and minor Python version numbers to link to the proper documentation for Python classes
pyversion = '.'.join(str(v) for v in sys.version_info[:2])
@ -30,9 +30,17 @@ release = '0.0.1'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode'
'sphinx.ext.viewcode',
'sphinx_external_toc'
]
autodoc_typehints = "description"
autodoc_class_signature = "separated"
autodoc_member_order = "bysource"
external_toc_path = str(docpath.joinpath('toc.yml'))
external_toc_exclude_missing = False
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
intersphinx_mapping = {
@ -40,14 +48,10 @@ intersphinx_mapping = {
'crypto': ('https://www.pycryptodome.org/', None)
}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
autodoc_typehints = "description"
autodoc_class_signature = "separated"
autodoc_member_order = "bysource"
#html_theme = 'sphinx_rtd_theme'
html_theme = 'furo'
html_static_path = ['_static']
# latex_elements = {

View file

@ -2,11 +2,3 @@ Welcome to ActivityPub Utilities's documentation!
=================================================
ApUtils is a collection of classes and functions to aid in the development of an ActivityPub server.
.. toctree::
:maxdepth: 2
:caption: Contents
:hidden:
Usage <pages/usage>
API <pages/api>

View file

@ -1,9 +1,2 @@
API
===
.. toctree::
api/signer
api/misc
api/enums
api/exceptions

View file

@ -1,6 +1,2 @@
Usage
=====
.. toctree::
usage/signer

16
docs/toc.yml Normal file
View file

@ -0,0 +1,16 @@
root: index
subtrees:
- entries:
- file: pages/api.rst
title: API
subtrees:
- entries:
- file: pages/api/signer.rst
- file: pages/api/misc.rst
- file: pages/api/enums.rst
- file: pages/api/exceptions.rst
- file: pages/usage.rst
title: Usage
subtrees:
- entries:
- file: pages/usage/signer.rst