pydle/docs/conf.py

101 lines
2.3 KiB
Python
Raw Permalink Normal View History

2014-01-23 01:44:19 +00:00
#!/usr/bin/env python3
2014-03-08 17:47:00 +00:00
import sys
import os
import os.path as path
import datetime
2014-01-23 01:44:19 +00:00
2014-03-08 17:47:00 +00:00
### -- General options -- ###
# Make autodoc and import work.
if path.exists(path.join('..', 'pydle')):
sys.path.insert(0, os.path.abspath('..'))
2014-01-23 01:44:19 +00:00
import pydle
2014-03-08 17:47:00 +00:00
# General information about the project.
project = pydle.__name__
copyright = '2013-{current}, Shiz'.format(current=datetime.date.today().year)
version = release = pydle.__version__
# Sphinx extensions to use.
2014-01-23 01:44:19 +00:00
extensions = [
2014-03-08 17:47:00 +00:00
# Generate API description from code.
2014-01-23 01:44:19 +00:00
'sphinx.ext.autodoc',
2014-03-08 17:47:00 +00:00
# Generate unit tests from docstrings.
2014-01-23 01:44:19 +00:00
'sphinx.ext.doctest',
2014-03-08 17:47:00 +00:00
# Link to Sphinx documentation for related projects.
2014-01-23 01:44:19 +00:00
'sphinx.ext.intersphinx',
2014-03-08 17:47:00 +00:00
# Generate TODO descriptions from docstrings.
2014-01-23 01:44:19 +00:00
'sphinx.ext.todo',
2014-03-08 17:47:00 +00:00
# Conditional operator for documentation.
2014-01-23 01:44:19 +00:00
'sphinx.ext.ifconfig',
2014-03-08 17:47:00 +00:00
# Include full source code with documentation.
2014-01-23 01:44:19 +00:00
'sphinx.ext.viewcode'
]
2014-03-08 17:47:00 +00:00
# Documentation links for projects we link to.
intersphinx_mapping = {
2016-10-12 03:55:33 +00:00
'python': ('http://docs.python.org/3', None)
2014-03-08 17:47:00 +00:00
}
### -- Build locations -- ###
2014-01-23 01:44:19 +00:00
templates_path = ['_templates']
exclude_patterns = ['_build']
source_suffix = '.rst'
master_doc = 'index'
2014-03-08 17:47:00 +00:00
### -- General build settings -- ###
pygments_style = 'trac'
2014-01-23 01:44:19 +00:00
2014-03-08 17:47:00 +00:00
### -- HTML output -- ##
2014-01-23 01:44:19 +00:00
2014-03-08 17:47:00 +00:00
# Only set RTD theme if we're building locally.
if os.environ.get('READTHEDOCS', None) != 'True':
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [ sphinx_rtd_theme.get_html_theme_path() ]
2014-01-23 01:44:19 +00:00
html_show_sphinx = False
htmlhelp_basename = 'pydledoc'
2014-03-08 17:47:00 +00:00
### -- LaTeX output -- ##
2014-01-23 01:44:19 +00:00
latex_documents = [
('index', 'pydle.tex', 'pydle Documentation', 'Shiz', 'manual'),
]
2014-03-08 17:47:00 +00:00
### -- Manpage output -- ###
2014-01-23 01:44:19 +00:00
man_pages = [
('index', 'pydle', 'pydle Documentation', ['Shiz'], 1)
]
2014-03-08 17:47:00 +00:00
### -- Sphinx customization code -- ##
2014-01-23 01:44:19 +00:00
def skip(app, what, name, obj, skip, options):
if skip:
return True
if name.startswith('_') and name != '__init__':
return True
2014-03-08 17:47:00 +00:00
if name.startswith('on_data'):
return True
2014-01-23 01:44:19 +00:00
if name.startswith('on_raw_'):
return True
2014-03-08 17:47:00 +00:00
if name.startswith('on_ctcp') and name not in ('on_ctcp', 'on_ctcp_reply'):
2014-01-23 01:44:19 +00:00
return True
if name.startswith('on_isupport_'):
return True
if name.startswith('on_capability_'):
return True
return False
def setup(app):
app.connect('autodoc-skip-member', skip)