From cfdb913543245e75bbed83c993ddd39391e90f21 Mon Sep 17 00:00:00 2001 From: Becky Sweger Date: Thu, 10 Oct 2024 13:55:18 -0400 Subject: [PATCH] Try autodoc --- docs/conf.py | 29 +++++++++++++++++++---------- docs/index.rst | 1 + docs/reference/cladetime.rst | 10 ++++++++++ docs/reference/index.rst | 6 ++++++ 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 docs/reference/cladetime.rst create mode 100644 docs/reference/index.rst diff --git a/docs/conf.py b/docs/conf.py index 875cb68..96eb4cb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,5 @@ +import os +import sys from datetime import date # Configuration file for the Sphinx documentation builder. @@ -8,9 +10,16 @@ copyright = f"{date.today().year}, Reich Lab @ The University of Massachusetts Amherst" author = "Reich Lab" +# Add cladetime location to the path, so we can use autodoc to +# generate API documentation from docstrings. +root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +sys.path.insert(0, root_path) + release = "0.1" +# FIXME: get the version dynamically version = "0.1.0" + # -- General configuration extensions = [ @@ -51,16 +60,16 @@ } # Order sidebar content, placing ads in the left sidebar -html_sidebars = { - "**": [ - "sidebar/brand.html", - "sidebar/search.html", - "sidebar/scroll-start.html", - "sidebar/navigation.html", - "sidebar/scroll-end.html", - "sidebar/ethical-ads.html", - ] -} +# html_sidebars = { +# "**": [ +# "sidebar/brand.html", +# "sidebar/search.html", +# "sidebar/scroll-start.html", +# "sidebar/navigation.html", +# "sidebar/scroll-end.html", +# "sidebar/ethical-ads.html", +# ] +# } # from https://myst-parser.readthedocs.io/en/latest/syntax/optional.html diff --git a/docs/index.rst b/docs/index.rst index a13372b..16fdd92 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,3 +13,4 @@ Contents Home user-guide + reference/index diff --git a/docs/reference/cladetime.rst b/docs/reference/cladetime.rst new file mode 100644 index 0000000..f70d268 --- /dev/null +++ b/docs/reference/cladetime.rst @@ -0,0 +1,10 @@ +CladeTime +========== + +.. automodule:: cladetime.CladeTime + + +.. autoclass:: cladetime.CladeTime + :members: + :exclude-members: putrequest + :show-inheritance: \ No newline at end of file diff --git a/docs/reference/index.rst b/docs/reference/index.rst new file mode 100644 index 0000000..7660209 --- /dev/null +++ b/docs/reference/index.rst @@ -0,0 +1,6 @@ +API Reference +============= + +.. toctree:: + + cladetime