1 | # -*- coding: utf-8 -*- |
---|
2 | # |
---|
3 | # Sphinx documentation build configuration file |
---|
4 | |
---|
5 | import re |
---|
6 | import sphinx |
---|
7 | |
---|
8 | |
---|
9 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', |
---|
10 | 'sphinx.ext.autosummary', 'sphinx.ext.extlinks', |
---|
11 | 'sphinx.ext.viewcode'] |
---|
12 | |
---|
13 | master_doc = 'contents' |
---|
14 | templates_path = ['_templates'] |
---|
15 | exclude_patterns = ['_build'] |
---|
16 | |
---|
17 | project = 'ZOO-Project' |
---|
18 | copyright = '2009-2015, ZOO-Project team' |
---|
19 | version = sphinx.__released__ |
---|
20 | release = version |
---|
21 | show_authors = True |
---|
22 | |
---|
23 | html_theme = 'sphinx_rtd_theme' |
---|
24 | html_theme_path = ['_themes'] |
---|
25 | modindex_common_prefix = ['sphinx.'] |
---|
26 | html_static_path = ['_static'] |
---|
27 | html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']} |
---|
28 | html_additional_pages = {'index': 'index.html'} |
---|
29 | html_use_opensearch = 'http://sphinx-doc.org' |
---|
30 | |
---|
31 | htmlhelp_basename = 'Sphinxdoc' |
---|
32 | |
---|
33 | epub_theme = 'epub' |
---|
34 | epub_basename = 'sphinx' |
---|
35 | epub_author = 'Georg Brandl' |
---|
36 | epub_publisher = 'http://sphinx-doc.org/' |
---|
37 | epub_scheme = 'url' |
---|
38 | epub_identifier = epub_publisher |
---|
39 | epub_pre_files = [('index.html', 'Welcome')] |
---|
40 | epub_post_files = [('install.html', 'Installing Sphinx'), |
---|
41 | ('develop.html', 'Sphinx development')] |
---|
42 | epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js', |
---|
43 | '_static/jquery.js', '_static/searchtools.js', |
---|
44 | '_static/underscore.js', '_static/basic.css', |
---|
45 | 'search.html', '_static/websupport.js'] |
---|
46 | epub_fix_images = False |
---|
47 | epub_max_image_width = 0 |
---|
48 | epub_show_urls = 'inline' |
---|
49 | epub_use_index = False |
---|
50 | epub_guide = (('toc', 'contents.html', u'Table of Contents'),) |
---|
51 | |
---|
52 | latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation', |
---|
53 | 'Georg Brandl', 'manual', 1)] |
---|
54 | latex_logo = '_static/sphinx.png' |
---|
55 | latex_elements = { |
---|
56 | 'fontpkg': '\\usepackage{palatino}', |
---|
57 | } |
---|
58 | latex_show_urls = 'footnote' |
---|
59 | |
---|
60 | autodoc_member_order = 'groupwise' |
---|
61 | todo_include_todos = True |
---|
62 | extlinks = {'duref': ('http://docutils.sourceforge.net/docs/ref/rst/' |
---|
63 | 'restructuredtext.html#%s', ''), |
---|
64 | 'durole': ('http://docutils.sourceforge.net/docs/ref/rst/' |
---|
65 | 'roles.html#%s', ''), |
---|
66 | 'dudir': ('http://docutils.sourceforge.net/docs/ref/rst/' |
---|
67 | 'directives.html#%s', '')} |
---|
68 | |
---|
69 | man_pages = [ |
---|
70 | ('contents', 'sphinx-all', 'Sphinx documentation generator system manual', |
---|
71 | 'Georg Brandl', 1), |
---|
72 | ('man/sphinx-build', 'sphinx-build', 'Sphinx documentation generator tool', |
---|
73 | '', 1), |
---|
74 | ('man/sphinx-quickstart', 'sphinx-quickstart', 'Sphinx documentation ' |
---|
75 | 'template generator', '', 1), |
---|
76 | ('man/sphinx-apidoc', 'sphinx-apidoc', 'Sphinx API doc generator tool', |
---|
77 | '', 1), |
---|
78 | ] |
---|
79 | |
---|
80 | texinfo_documents = [ |
---|
81 | ('contents', 'sphinx', 'Sphinx Documentation', 'Georg Brandl', |
---|
82 | 'Sphinx', 'The Sphinx documentation builder.', 'Documentation tools', |
---|
83 | 1), |
---|
84 | ] |
---|
85 | |
---|
86 | # We're not using intersphinx right now, but if we did, this would be part of |
---|
87 | # the mapping: |
---|
88 | intersphinx_mapping = {'python': ('https://docs.python.org/2/', None)} |
---|
89 | |
---|
90 | # Sphinx document translation with sphinx gettext feature uses these settings: |
---|
91 | locale_dirs = ['locale/'] |
---|
92 | gettext_compact = False |
---|
93 | |
---|
94 | |
---|
95 | # -- Extension interface ------------------------------------------------------- |
---|
96 | |
---|
97 | from sphinx import addnodes # noqa |
---|
98 | |
---|
99 | event_sig_re = re.compile(r'([a-zA-Z-]+)\s*\((.*)\)') |
---|
100 | |
---|
101 | |
---|
102 | def parse_event(env, sig, signode): |
---|
103 | m = event_sig_re.match(sig) |
---|
104 | if not m: |
---|
105 | signode += addnodes.desc_name(sig, sig) |
---|
106 | return sig |
---|
107 | name, args = m.groups() |
---|
108 | signode += addnodes.desc_name(name, name) |
---|
109 | plist = addnodes.desc_parameterlist() |
---|
110 | for arg in args.split(','): |
---|
111 | arg = arg.strip() |
---|
112 | plist += addnodes.desc_parameter(arg, arg) |
---|
113 | signode += plist |
---|
114 | return name |
---|
115 | |
---|
116 | |
---|
117 | def setup(app): |
---|
118 | from sphinx.ext.autodoc import cut_lines |
---|
119 | from sphinx.util.docfields import GroupedField |
---|
120 | app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) |
---|
121 | app.add_object_type('confval', 'confval', |
---|
122 | objname='configuration value', |
---|
123 | indextemplate='pair: %s; configuration value') |
---|
124 | fdesc = GroupedField('parameter', label='Parameters', |
---|
125 | names=['param'], can_collapse=True) |
---|
126 | app.add_object_type('event', 'event', 'pair: %s; event', parse_event, |
---|
127 | doc_field_types=[fdesc]) |
---|