Skip to content

Commit

Permalink
docs: switch theme to furo
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilland committed Oct 3, 2023
1 parent a0b7d04 commit 74ec236
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 52 deletions.
82 changes: 34 additions & 48 deletions docs/conf.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,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('fnc')
dist = get_distribution("fnc")

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 = '2018, ' + 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 @@ -53,40 +52,40 @@
# 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 = None
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 @@ -97,20 +96,7 @@
# 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
Expand All @@ -121,7 +107,7 @@ def setup(app):
# 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 @@ -137,7 +123,7 @@ def setup(app):
# -- 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 @@ -146,15 +132,12 @@ 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
#
# 'figure_align': 'htbp',
Expand All @@ -165,18 +148,15 @@ def setup(app):
# (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 @@ -185,10 +165,16 @@ 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",
),
]


# -- Extension configuration -------------------------------------------------

6 changes: 2 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ dev =
flake8-black
flake8-bugbear
flake8-isort
furo
importlib_metadata<5; python_version=="3.7"
invoke
isort
pylint
pytest
pytest-cov
pytest-flake8
pytest-pylint
Sphinx
sphinx-rtd-theme
sphinx
tox
twine
wheel
Expand Down

0 comments on commit 74ec236

Please sign in to comment.