Add API documentation

This commit is contained in:
2021-05-04 21:01:30 -07:00
parent 5cc815d8b6
commit f085f318b3
10 changed files with 108 additions and 35 deletions

View File

@ -1,10 +1,10 @@
{% extends "!layout.html" %}
{% block extrahead %}
<link rel="icon" type="image/png" sizes="16x16" href="_static/icon-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="_static/icon-32.png">
<link rel="icon" type="image/png" sizes="48x48" href="_static/icon-48.png">
<link rel="icon" type="image/png" sizes="64x64" href="_static/icon-64.png">
<link rel="icon" type="image/png" sizes="128x128" href="_static/icon-128.png">
<link rel="icon" type="image/png" sizes="256x256" href="_static/icon-256.png">
<link rel="icon" type="image/png" sizes="16x16" href="/_static/icon-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/_static/icon-32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/_static/icon-48.png">
<link rel="icon" type="image/png" sizes="64x64" href="/_static/icon-64.png">
<link rel="icon" type="image/png" sizes="128x128" href="/_static/icon-128.png">
<link rel="icon" type="image/png" sizes="256x256" href="/_static/icon-256.png">
{{ super() }}
{% endblock %}

View File

@ -4,16 +4,18 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
from pkg_resources import get_distribution
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from pkg_resources import get_distribution
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
@ -29,7 +31,10 @@ version = '.'.join(release.split('.')[:3])
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'myst_parser', 'sphinx_rtd_theme'
'myst_parser',
'sphinx_rtd_theme',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
]
# Add any paths that contain templates here, relative to this directory.
@ -40,6 +45,8 @@ templates_path = ['_templates']
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
default_role = 'py:obj'
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@ -54,3 +61,24 @@ html_favicon = 'favicon.ico'
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = ['css/custom.css']
# -- Options for Autodoc -----------------------------------------------------
add_module_names = False
autodoc_docstring_signature = True
autoclass_content = 'both'
autodoc_default_options = {
'member-order': 'bysource',
'undoc-members': True,
}
# -- Options for Intersphinx -------------------------------------------------
# This config value contains the locations and names of other projects that
# should be linked to in this documentation.
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'packaging': ('https://packaging.pypa.io/en/latest/', None),
}

View File

@ -11,7 +11,7 @@ Welcome to Yaclog's documentation!
:includehidden:
:caption: Contents:
Changelog <changelog>
API Reference <reference/index.rst>
.. toctree::
:maxdepth: 1

View File

@ -0,0 +1,5 @@
Changelog Module
================
.. automodule:: yaclog.changelog
:members:

8
docs/reference/index.rst Normal file
View File

@ -0,0 +1,8 @@
API Reference
=============
.. toctree::
:maxdepth: 1
:glob:
*

View File

@ -0,0 +1,5 @@
Markdown Module
==============
.. automodule:: yaclog.markdown
:members:

View File

@ -0,0 +1,5 @@
Version Module
==============
.. automodule:: yaclog.version
:members: