attrs/docs/conf.py

154 lines
4.6 KiB
Python
Raw Normal View History

2015-01-27 16:53:17 +00:00
# -*- coding: utf-8 -*-
import codecs
import os
import re
def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, *parts), "rb", "utf-8") as f:
return f.read()
def find_version(*file_paths):
"""
Build a path from *file_paths* and search for a ``__version__``
string inside.
"""
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
# -- General configuration ------------------------------------------------
# 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.intersphinx',
'sphinx.ext.todo',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'attrs'
copyright = u'2015, Hynek Schlawack'
2015-01-27 16:53:17 +00:00
# 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.
release = find_version("../src/attr/__init__.py")
2015-01-27 16:53:17 +00:00
version = release.rsplit(u".", 1)[0]
# The full version, including alpha/beta/rc tags.
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# If true, '()' will be appended to :func: etc. cross-reference text.
2017-02-20 12:41:20 +00:00
add_function_parentheses = True
2015-01-27 16:53:17 +00:00
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- 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 = "alabaster"
2017-05-23 23:11:37 +00:00
html_theme_options = {
"font_family": "Palatino, Georgia, serif",
"font_size": "18px",
}
2015-01-27 16:53:17 +00:00
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
2017-11-01 13:28:52 +00:00
html_logo = "_static/attrs_logo.svg"
2015-01-27 16:53:17 +00:00
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
2017-02-20 12:41:20 +00:00
# html_favicon = None
2015-01-27 16:53:17 +00:00
# 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".
2017-02-20 12:41:20 +00:00
html_static_path = ['_static']
2015-01-27 16:53:17 +00:00
# If false, no module index is generated.
2017-02-20 12:41:20 +00:00
html_domain_indices = True
2015-01-27 16:53:17 +00:00
# If false, no index is generated.
2017-02-20 12:41:20 +00:00
html_use_index = True
2015-01-27 16:53:17 +00:00
# If true, the index is split into individual pages for each letter.
2017-02-20 12:41:20 +00:00
html_split_index = False
2015-01-27 16:53:17 +00:00
# If true, links to the reST sources are added to the pages.
2017-02-20 12:41:20 +00:00
html_show_sourcelink = False
2015-01-27 16:53:17 +00:00
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
2017-02-20 12:41:20 +00:00
html_show_sphinx = True
2015-01-27 16:53:17 +00:00
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
2017-02-20 12:41:20 +00:00
html_show_copyright = True
2015-01-27 16:53:17 +00:00
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
2017-02-20 12:41:20 +00:00
# html_use_opensearch = ''
2015-01-27 16:53:17 +00:00
# Output file base name for HTML help builder.
htmlhelp_basename = 'attrsdoc'
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'attrs', u'attrs Documentation',
[u'Hynek Schlawack'], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'attrs', u'attrs Documentation',
u'Hynek Schlawack', 'attrs', 'One line description of project.',
'Miscellaneous'),
]
2016-08-15 11:59:04 +00:00
intersphinx_mapping = {
"https://docs.python.org/3": None,
}
2017-03-04 07:43:34 +00:00
# Allow non-local URIs so we can have images in CHANGELOG etc.
suppress_warnings = ['image.nonlocal_uri']