[348] | 1 | # -*- coding: utf-8 -*- |
---|
| 2 | # |
---|
[668] | 3 | # ZOO Project documentation build configuration file |
---|
[348] | 4 | |
---|
[659] | 5 | import re |
---|
| 6 | import sphinx |
---|
[348] | 7 | |
---|
[668] | 8 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo','sphinx.ext.autosummary', 'sphinx.ext.extlinks','sphinx.ext.viewcode'] |
---|
[669] | 9 | master_doc = 'index' |
---|
[348] | 10 | templates_path = ['_templates'] |
---|
| 11 | exclude_patterns = ['_build'] |
---|
| 12 | |
---|
[668] | 13 | # General information |
---|
| 14 | |
---|
[659] | 15 | project = 'ZOO-Project' |
---|
[919] | 16 | copyright = '2009-2019, ZOO-Project team' |
---|
[668] | 17 | version = '1.0' |
---|
| 18 | release = '1.5' |
---|
[659] | 19 | show_authors = True |
---|
[348] | 20 | |
---|
[668] | 21 | # Options for HTML output |
---|
| 22 | |
---|
[659] | 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']} |
---|
[670] | 28 | #html_additional_pages = {'index': 'index.html'} |
---|
[659] | 29 | html_use_opensearch = 'http://sphinx-doc.org' |
---|
| 30 | htmlhelp_basename = 'Sphinxdoc' |
---|
[348] | 31 | |
---|
[668] | 32 | # Options for epub output |
---|
| 33 | |
---|
[659] | 34 | epub_theme = 'epub' |
---|
[668] | 35 | epub_basename = 'ZOO-Project' |
---|
| 36 | epub_author = 'ZOO-Project team' |
---|
| 37 | epub_publisher = 'http://zoo-project.org/' |
---|
[659] | 38 | epub_scheme = 'url' |
---|
[668] | 39 | epub_identifier = 'http://zoo-project.org' |
---|
| 40 | epub_pre_files = [('index.html', 'ZOO-Project documentation')] |
---|
[727] | 41 | #epub_post_files = [('install.html', 'Installing Sphinx'),('develop.html', 'Sphinx development')] |
---|
[668] | 42 | epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js','_static/jquery.js', '_static/searchtools.js','_static/underscore.js', '_static/basic.css','search.html', '_static/websupport.js'] |
---|
[659] | 43 | epub_fix_images = False |
---|
| 44 | epub_max_image_width = 0 |
---|
| 45 | epub_show_urls = 'inline' |
---|
| 46 | epub_use_index = False |
---|
[669] | 47 | epub_guide = (('toc', 'index.html', u'Table of Contents'),) |
---|
[348] | 48 | |
---|
[668] | 49 | # Options for LaTeX output |
---|
| 50 | |
---|
| 51 | latex_documents = [('contents', 'ZOO-Project.tex', 'ZOO-Project Documentation','ZOO-Project team', 'manual', 1)] |
---|
[727] | 52 | latex_logo = '_static/zoo-simple.png' |
---|
[668] | 53 | latex_elements = {'fontpkg': '\\usepackage{palatino}'} |
---|
[659] | 54 | latex_show_urls = 'footnote' |
---|
| 55 | todo_include_todos = True |
---|
[668] | 56 | man_pages = [('index', 'zooproject', 'ZOO-Project Documentation','ZOO-Project team', 1)] |
---|
[348] | 57 | |
---|
[659] | 58 | # -- Extension interface ------------------------------------------------------- |
---|
[348] | 59 | |
---|
[659] | 60 | from sphinx import addnodes # noqa |
---|
[348] | 61 | |
---|
[659] | 62 | event_sig_re = re.compile(r'([a-zA-Z-]+)\s*\((.*)\)') |
---|
[348] | 63 | |
---|
| 64 | |
---|
[659] | 65 | def parse_event(env, sig, signode): |
---|
| 66 | m = event_sig_re.match(sig) |
---|
| 67 | if not m: |
---|
| 68 | signode += addnodes.desc_name(sig, sig) |
---|
| 69 | return sig |
---|
| 70 | name, args = m.groups() |
---|
| 71 | signode += addnodes.desc_name(name, name) |
---|
| 72 | plist = addnodes.desc_parameterlist() |
---|
| 73 | for arg in args.split(','): |
---|
| 74 | arg = arg.strip() |
---|
| 75 | plist += addnodes.desc_parameter(arg, arg) |
---|
| 76 | signode += plist |
---|
| 77 | return name |
---|
[348] | 78 | |
---|
| 79 | |
---|
[659] | 80 | def setup(app): |
---|
| 81 | from sphinx.ext.autodoc import cut_lines |
---|
| 82 | from sphinx.util.docfields import GroupedField |
---|
| 83 | app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) |
---|
| 84 | app.add_object_type('confval', 'confval', |
---|
| 85 | objname='configuration value', |
---|
| 86 | indextemplate='pair: %s; configuration value') |
---|
| 87 | fdesc = GroupedField('parameter', label='Parameters', |
---|
| 88 | names=['param'], can_collapse=True) |
---|
| 89 | app.add_object_type('event', 'event', 'pair: %s; event', parse_event, |
---|
| 90 | doc_field_types=[fdesc]) |
---|