Skip to content
Snippets Groups Projects
Verified Commit 68380b9a authored by Duncan Macleod's avatar Duncan Macleod
Browse files

docs: use furo docs theme

numerous improvements over sphinx_rtd_theme, namely automatic dark mode
parent 64df77c0
No related branches found
No related tags found
No related merge requests found
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = GWDataFind
SOURCEDIR = .
BUILDDIR = _build
.PHONY: help html
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
html:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# -*- coding: utf-8 -*-
#
# gwdatafind documentation build configuration file
# dqsegdb2 documentation build configuration file
import glob
import os.path
import re
from gwdatafind import __version__ as VERSION
from gwdatafind import __version__ as gwdatafind_version
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx_automodapi.automodapi',
'sphinxarg.ext',
]
# -- metadta
#templates_path = ['_templates']
project = "gwdatafind"
copyright = "2018-2025, Cardiff University"
author = "Duncan Macleod"
release = gwdatafind_version
version = re.split(r'[\w-]', gwdatafind_version)[0]
source_suffix = '.rst'
# -- config
source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'gwdatafind'
copyright = u'2018-2021, Cardiff University'
author = u'Duncan Macleod'
default_role = 'obj'
# -- theme
# The short X.Y version.
version = re.split(r'[\w-]', VERSION)[0]
# The full version, including alpha/beta/rc tags.
release = VERSION
html_theme = "furo"
pygments_dark_style = "monokai"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'monokai'
# -- extensions
# Intersphinx directory
extensions = [
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx_automodapi.automodapi",
"sphinx_copybutton",
"sphinxarg.ext",
]
# automodapi
automodapi_inherited_members = False
# intersphinx
intersphinx_mapping = {
"igwn-auth-utils": (
"https://igwn-auth-utils.readthedocs.io/en/stable/",
......@@ -63,49 +62,5 @@ intersphinx_mapping = {
),
}
# The reST default role (used for this markup: `text`) to use for all
# documents.
default_role = 'obj'
# napoleon configuration
# napoleon
napoleon_use_rtype = False
# Don't inherit in automodapi
numpydoc_show_class_members = False
automodapi_inherited_members = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Output file base name for HTML help builder.
htmlhelp_basename = 'gwdatafinddoc'
# -- add static files----------------------------------------------------------
def setup_static_content(app):
curdir = os.path.abspath(os.path.dirname(__file__))
# configure stylesheets
for sdir in html_static_path:
staticdir = os.path.join(curdir, sdir)
# add stylesheets
for cssf in glob.glob(os.path.join(staticdir, 'css', '*.css')):
app.add_css_file(cssf[len(staticdir)+1:])
# add custom javascript
for jsf in glob.glob(os.path.join(staticdir, 'js', '*.js')):
app.add_js_file(jsf[len(staticdir)+1:])
# -- setup --------------------------------------------------------------------
def setup(app):
setup_static_content(app)
......@@ -44,11 +44,12 @@ dynamic = [
[project.optional-dependencies]
docs = [
"furo",
"numpydoc",
"sphinx >= 4.4.0",
"Sphinx >= 4.4.0",
"sphinx-argparse",
"sphinx_automodapi",
"sphinx_rtd_theme",
"sphinx-copybutton",
]
test = [
"pytest >= 2.8.0",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment