docs/conf.py
# -*- coding: utf-8 -*-
import ast
import os
import re
import shlex
import sys
# 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.
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# Using :private-members:, which requires Sphinx 1.1
needs_sphinx = '1.1'
# 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.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'alabaster',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
source_suffix = ['.rst']
# The encoding of source files.
source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'streamexpect'
copyright = u'2015, Digi International, Inc.'
author = u'Nick Stevens'
# Version information, for |version| and |release|
def read_version(filename):
regex = re.compile(r'__version__\s+=\s+(.*)')
with open(filename, 'rb') as f:
return str(ast.literal_eval(regex.search(
f.read().decode('utf-8')).group(1)))
version = release = read_version('../streamexpect.py')
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# Include __init__ documents in class documentation
autoclass_content = 'both'
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
# -- 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'
# 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 = {
'github_user': 'digidotcom',
'github_repo': 'python-streamexpect',
'github_button': True,
'github_banner': False,
'show_powered_by': True,
'extra_nav_links': {
'Digi Wireless Design': 'http://www.digi.com/wds/',
'Streamexpect on Github': 'https://github.com/digidotcom/python-streamexpect',
}
}
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'searchbox.html',
]
}
# If true, "Created using Sphinx" is shown in the HTML footer.
html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer.
html_show_copyright = True
# Output file base name for HTML help builder.
htmlhelp_basename = 'streamexpectdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# 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',
}
# 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, 'streamexpect.tex', u'streamexpect Documentation',
u'Digi International, Inc.', '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, 'streamexpect', u'streamexpect Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
man_show_urls = True
# -- 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 = [
(master_doc, 'streamexpect', u'streamexpect Documentation',
author, 'streamexpect', 'A library providing cross-platform expect'
'functionality for generic Python streams and sockets',
'Miscellaneous'),
]