-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconf.py
40 lines (31 loc) · 1.23 KB
/
conf.py
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
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinxcontrib.httpdomain',
]
master_doc = 'index'
project = u'Beaker'
copyright = u'2015, Red Hat, Inc'
release = version = "Project"
html_title = 'Beaker development'
html_use_index = False
html_domain_indices = False
html_theme = 'default'
intersphinx_mapping = {
'python': ('http://docs.python.org/', None),
'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),
}
# This config is also a Sphinx extension with some Beaker-specific customisations:
import docutils.core, docutils.nodes
# A poor man's version of sphinxcontrib-issuetracker
# <https://pypi.python.org/pypi/sphinxcontrib-issuetracker> which unfortunately
# requires a newer python-requests than is available in Fedora.
# This code inspired by Doug Hellman's article
# <http://doughellmann.com/2010/05/defining-custom-roles-in-sphinx.html>.
def beaker_bugzilla_issue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
bz_url = 'https://bugzilla.redhat.com/show_bug.cgi?id=%s' % text
text = "#" + text
node = docutils.nodes.reference(rawtext, text, refuri=bz_url, **options)
return [node], []
def setup(app):
app.add_role('issue', beaker_bugzilla_issue_role)