Skip to content

Commit

Permalink
docs: switch to furo theme
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilland committed Oct 3, 2023
1 parent 2ed7813 commit 937cd6e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 54 deletions.
91 changes: 39 additions & 52 deletions docs/conf.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,28 @@
import sys


sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))


# -- Project information -----------------------------------------------------

from email import message_from_string
from pkg_resources import get_distribution

dist = get_distribution('cacheout')
dist = get_distribution("cacheout")

if hasattr(dist, '_parsed_pkg_info'):
if hasattr(dist, "_parsed_pkg_info"):
pkg_info = dict(dist._parsed_pkg_info)
else:
pkg_info = dict(
message_from_string('\n'.join(dist._get_metadata('PKG-INFO'))))
pkg_info = dict(message_from_string("\n".join(dist._get_metadata("PKG-INFO"))))

project = pkg_info['Name']
author = pkg_info['Author']
description = pkg_info['Summary']
copyright = '{{ cookiecutter.year }}, ' + author
project = pkg_info["Name"]
author = pkg_info["Author"]
description = pkg_info["Summary"]
copyright = "2018, " + author

# The short X.Y version
version = pkg_info['Version']
version = pkg_info["Version"]
# The full version, including alpha/beta/rc tags
release = version

Expand All @@ -48,46 +47,46 @@

# If your documentation needs a minimal Sphinx version, state it here.
#
#needs_sphinx = '1.0'
# needs_sphinx = '1.0'

# 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.doctest',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_parsers = {}
source_suffix = ['.rst']
source_suffix = [".rst"]

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -98,31 +97,18 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
# docs.readthedocs.org.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if on_rtd:
html_theme = 'default'
else:
import sphinx_rtd_theme

html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

def setup(app):
app.add_css_file('theme_override.css')
html_theme = "furo"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
#html_theme_options = {}
# html_theme_options = {}

# 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']
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -132,13 +118,13 @@ def setup(app):
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
#html_sidebars = {}
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = project + 'doc'
htmlhelp_basename = project + "doc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -147,37 +133,31 @@ def setup(app):
# The paper size ('letterpaper' or 'a4paper').
#
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
#'preamble': '',

# Latex figure (float) alignment
# Latex figure (float) alignment
#
#'figure_align': 'htbp',
#'figure_align': 'htbp',
}


# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, project + '.tex', project + ' Documentation', author,
'manual'),
(master_doc, project + ".tex", project + " Documentation", author, "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, project, project + ' Documentation', [author], 1)
]
man_pages = [(master_doc, project, project + " Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -186,8 +166,15 @@ def setup(app):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, project, project + ' Documentation', author, project,
description, 'Miscellaneous'),
(
master_doc,
project,
project + " Documentation",
author,
project,
description,
"Miscellaneous",
),
]


Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dev =
flake8-black
flake8-bugbear
flake8-isort
furo
importlib_metadata<5; python_version=="3.7"
invoke
isort
Expand All @@ -53,9 +54,8 @@ dev =
pytest
pytest-asyncio
pytest-cov
Sphinx
sphinx
sphinx-autodoc-typehints
sphinx-rtd-theme
tox
twine
wheel
Expand Down

0 comments on commit 937cd6e

Please sign in to comment.