From 51a982cfbd2603056b27ddf98c3a0e1a1faa5715 Mon Sep 17 00:00:00 2001 From: Gleb Nikonorov Date: Sun, 13 Dec 2020 18:12:50 -0500 Subject: [PATCH] Add plugin hooks to RTD documentation (#415) --- docs/api_reference.rst | 12 ++++++++++++ docs/conf.py | 16 ++++++++++++---- docs/index.rst | 1 + 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 docs/api_reference.rst diff --git a/docs/api_reference.rst b/docs/api_reference.rst new file mode 100644 index 0000000..c3a7267 --- /dev/null +++ b/docs/api_reference.rst @@ -0,0 +1,12 @@ +API Reference +------------- + +This is a reference to the plugin API. + +Hooks +~~~~~ + +This plugin exposes the following hooks: + +.. automodule:: pytest_html.hooks + :members: diff --git a/docs/conf.py b/docs/conf.py index 2aab782..ddb7c3d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,9 +8,12 @@ # 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('.')) +import os +import sys + +sys.path.insert(0, os.path.abspath("../src/")) + + # -- Project information ----------------------------------------------------- project = "pytest-html" @@ -23,7 +26,7 @@ author = "Dave Hunt" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = ["sphinx.ext.autodoc"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -54,3 +57,8 @@ html_static_path = ["_static"] # The master toctree document. master_doc = "index" + + +# -- Options for the autodoc extension --------------------------------------- + +autodoc_member_order = "alphabetical" diff --git a/docs/index.rst b/docs/index.rst index 6f8552a..b223ba4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,6 +14,7 @@ pytest-html is a plugin for `pytest`_ that generates a HTML report for test resu installing user_guide + api_reference development .. _pytest: http://pytest.org