Skip to content

Commit

Permalink
WIP: sketch out source code architecture for apidoc
Browse files Browse the repository at this point in the history
  • Loading branch information
slabasan committed Dec 20, 2023
1 parent 76722c3 commit 4a90617
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@
copyright = "2023, LLNS LLC"
author = "Olga Pearce, Alec Scott, Peter Scheibel, Greg Becker, Riyaz Haque, and Nathan Hanford"

import os
import sys

from sphinx.ext.apidoc import main as sphinx_apidoc

# -- Benchpark customizations ------------------------------------------------
# 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.
sys.path.append(os.path.abspath("../lib/benchpark/benchpark"))
print(sys.path)

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx_rtd_theme",
"sphinx.ext.autodoc",
]

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".spack-env"]
Expand All @@ -24,3 +37,20 @@

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]

# -- Run sphinx-apidoc -------------------------------------------------
# Remove any previous API docs
# ReadtheDocs doesn't clean up after previous builds
# Without this, the API Docs will never actually update
apidoc_args = [
"--force", # Overwrite existing files
"--no-toc", # Don't create a table of contents file
"--output-dir=.", # Directory to place all output
"--module-first", # emit module docs before submodule docs
]
sphinx_apidoc(
apidoc_args
+ [
"../lib/benchpark/benchpark",
]
)

0 comments on commit 4a90617

Please sign in to comment.