Skip to content

Commit

Permalink
Update auto-generated documentation
Browse files Browse the repository at this point in the history
Change Sphinx theme to furo `https://pypi.org/project/furo/`.

Enable napoleon for handling of Google style docstrings.

Enable `inherited-members` and `show-inheritance` for `autodoc`.
  • Loading branch information
fabcor-maxiv committed Oct 17, 2023
1 parent 2530e7a commit f0bfc4e
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 252 deletions.
33 changes: 12 additions & 21 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
PROJECT_PACKAGE_NAME = "mxcubeweb" # Distribution package (not import package)
PROJECT_PACKAGE_METADATA = importlib.metadata.metadata(PROJECT_PACKAGE_NAME)

PROJECT_SLUG_NAME = PROJECT_PACKAGE_NAME

# This is necessary to for the `autoflask` directive to get access to the routes
server, _ = mxcube3.build_server_and_config(test=True, argv=[])
# This is to avoid `Server.kill_processes`, that makes the build return non-zero
Expand All @@ -37,8 +35,6 @@
author = PROJECT_PACKAGE_METADATA["Author"]
copyright = f"{datetime.datetime.today().year}, {author}"

DOCUMENT_DESCRIPTION = f"{project} documentation"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Expand All @@ -52,23 +48,7 @@

# -- Options for HTML output ----------------------------------------------

html_theme = "alabaster"

html_theme_options = {
"description": DOCUMENT_DESCRIPTION,
"github_banner": "true",
"github_button": "true",
"github_repo": "mxcubeweb",
"github_user": "mxcube",
}

html_sidebars = {
"**": [
"about.html",
"globaltoc.html",
"searchbox.html",
],
}
html_theme = "furo"


# -- Extensions ---------------------------------------------------------------
Expand All @@ -79,7 +59,9 @@
extensions.append("sphinx.ext.autodoc")

autodoc_default_options = {
"inherited-members": True,
"members": True,
"show-inheritance": True,
}

autodoc_typehints = "both"
Expand All @@ -103,6 +85,15 @@
}


# -- Options for sphinx.ext.napoleon
# https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html

# We use Google style docstrings
# https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings

extensions.append("sphinx.ext.napoleon")


# -- sphinx.ext.viewcode
# https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html

Expand Down
Loading

0 comments on commit f0bfc4e

Please sign in to comment.