File: conf.py

package info (click to toggle)
pydle 0.9.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 456 kB
  • sloc: python: 3,037; makefile: 3
file content (100 lines) | stat: -rw-r--r-- 2,394 bytes parent folder | download | duplicates (2)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env python3
import sys
import os
import os.path as path
import datetime


### -- General options -- ###

# Make autodoc and import work.
if path.exists(path.join('..', 'pydle')):
    sys.path.insert(0, os.path.abspath('..'))
import pydle

# 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.
extensions = [
    # Generate API description from code.
    'sphinx.ext.autodoc',
    # Generate unit tests from docstrings.
    'sphinx.ext.doctest',
    # Link to Sphinx documentation for related projects.
    'sphinx.ext.intersphinx',
    # Generate TODO descriptions from docstrings.
    'sphinx.ext.todo',
    # Conditional operator for documentation.
    'sphinx.ext.ifconfig',
    # Include full source code with documentation.
    'sphinx.ext.viewcode'
]

# Documentation links for projects we link to.
intersphinx_mapping = {
    'python': ('http://docs.python.org/3', None)
}


### -- Build locations -- ###

templates_path = ['_templates']
exclude_patterns = ['_build']
source_suffix = '.rst'
master_doc = 'index'


### -- General build settings -- ###

pygments_style = 'trac'


### -- HTML output -- ##

# 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() ]
html_show_sphinx = False
htmlhelp_basename = 'pydledoc'


### -- LaTeX output -- ##

latex_documents = [
    ('index', 'pydle.tex', 'pydle Documentation', 'Shiz', 'manual'),
]


### -- Manpage output -- ###

man_pages = [
    ('index', 'pydle', 'pydle Documentation', ['Shiz'], 1)
]


### -- Sphinx customization code -- ##

def skip(app, what, name, obj, skip, options):
    if skip:
        return True
    if name.startswith('_') and name != '__init__':
        return True
    if name.startswith('on_data'):
        return True
    if name.startswith('on_raw_'):
        return True
    if name.startswith('on_ctcp') and name not in ('on_ctcp', 'on_ctcp_reply'):
        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)