1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
"""Configuration file for Sphinx."""
import sys
import os
from subprocess import check_output
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))
# Fake import to avoid actually loading CFFI and the PortAudio library
import fake__sounddevice
sys.modules['_sounddevice'] = sys.modules['fake__sounddevice']
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon', # support for NumPy-style docstrings
]
autoclass_content = 'init'
autodoc_member_order = 'bysource'
napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = False
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = False
napoleon_use_rtype = False
intersphinx_mapping = {
'python': ('/usr/share/doc/python3-doc/html/', None),
'numpy': ('/usr/share/doc/python-numpy/html/', None),
}
master_doc = 'index'
exclude_patterns = ['installation.rst']
authors = 'Matthias Geier'
project = 'python-sounddevice'
release = os.getenv('SOUNDDEVICE_VERSION_RELEASE', '<unknown>')
today = os.getenv('SOUNDDEVICE_VERSION_TODAY', '<unknown date>')
default_role = 'py:obj'
nitpicky = True
html_theme = 'sphinx_rtd_theme'
html_theme_options = {
}
html_title = project + ', version ' + release
html_favicon = 'favicon.svg'
html_domain_indices = False
html_show_copyright = False
html_copy_source = False
html_permalinks_icon = 'ยง'
htmlhelp_basename = 'python-sounddevice'
latex_elements = {
'papersize': 'a4paper',
#'preamble': '',
'printindex': '',
}
latex_documents = [('index', 'python-sounddevice.tex', project, authors, 'howto')]
latex_show_urls = 'footnote'
latex_domain_indices = False
def gh_example_role(rolename, rawtext, text, lineno, inliner,
options={}, content=()):
from docutils import nodes, utils
github_url = 'https://github.com/spatialaudio/python-sounddevice'
base_url = github_url + '/blob/' + release + '/examples/%s'
text = utils.unescape(text)
full_url = base_url % text
pnode = nodes.reference(internal=False, refuri=full_url)
pnode += nodes.literal(text, text, classes=['file'])
return [pnode], []
def setup(app):
app.add_role('gh-example', gh_example_role)
|