Skip to content

Commit

Permalink
merge conf files from regolith and cookiecutter
Browse files Browse the repository at this point in the history
  • Loading branch information
sbillinge committed Jul 20, 2024
1 parent 1a1b6be commit fa8cbac
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
# serve to show the default.

import json
import sys
import tempfile
import time
from collections.abc import MutableMapping
from importlib.metadata import version
from pathlib import Path
from subprocess import check_output
from textwrap import indent

from regolith import __version__ as REGOLITH_VERSION
from regolith.fsclient import _id_key, dump_json, json_to_yaml
from regolith.main import CONNECTED_COMMANDS, DISCONNECTED_COMMANDS
from regolith.schemas import EXEMPLARS, SCHEMAS
Expand All @@ -26,6 +29,11 @@
# regolith,
# ]

sys.path.insert(0, str(Path("../..").resolve()))
sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations
ab_authors = "Billinge Group members and community contributors"


# 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.
Expand All @@ -39,10 +47,14 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.mathjax",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_rtd_theme",
"m2r",
]

napoleon_google_docstring = False
Expand All @@ -53,7 +65,7 @@
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = ".rst"
source_suffix = [".rst", "md"]

# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand All @@ -63,17 +75,18 @@

# General information about the project.
project = "regolith"
copyright = "2015, Anthony Scopatz"
copyright = "2015, Anthony Scopatz, %Y, The Trustees of Columbia University in the City of New York"

# 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.
#
# The short X.Y version.
version = REGOLITH_VERSION.rsplit(".", 1)[0]
fullversion = version(project)
version = "".join(fullversion.split(".post")[:1])

# The full version, including alpha/beta/rc tags.
release = REGOLITH_VERSION
release = fullversion

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -84,10 +97,13 @@
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
today = time.strftime("%B %d, %Y", time.localtime())
year = today.split()[-1]
copyright = copyright.replace("%Y", year)

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
exclude_patterns = ["_build", "build"]

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
Expand All @@ -105,11 +121,11 @@

# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = 'sphinx'
pygments_style = "pastie"
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

modindex_common_prefix = ["regolith"]
nitpicky = True

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

Expand All @@ -122,7 +138,7 @@
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
html_theme_options = {"roottarget": "index"}
html_theme_options = {"roottarget": "index", "navigation_with_keys": "true"}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
Expand Down Expand Up @@ -192,7 +208,8 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = "regolithdoc"
basename = "regolith-docs".replace(" ", "").replace(".", "")
htmlhelp_basename = basename + "doc"

# -- Options for LaTeX output --------------------------------------------------

Expand All @@ -212,7 +229,7 @@
"index",
"regolith.tex",
"Regolith Documentation",
"Anthony Scopatz",
ab_authors,
"manual",
)
]
Expand Down Expand Up @@ -242,7 +259,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "regolith", "regolith docs", ["Anthony Scopatz"], 1)]
man_pages = [("index", "regolith", "regolith docs", ab_authors, 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -257,10 +274,10 @@
(
"index",
"regolith",
"regolith documentation",
"Anthony Scopatz",
"regolith Documentation",
ab_authors,
"regolith",
"Research group managment software.",
"Research group management software.",
"Miscellaneous",
)
]
Expand Down

0 comments on commit fa8cbac

Please sign in to comment.