1 # -*- coding: utf-8 -*-
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # ARIA TOSCA documentation build configuration file.
20 # This file is execfile()d with the current directory set to its
23 # Note that not all possible configuration values are present in this
26 # All configuration values have a default; values that are commented out
27 # serve to show the default.
29 # If extensions (or modules to document with autodoc) are in another directory,
30 # add these directories to sys.path here. If the directory is relative to the
31 # documentation root, use os.path.abspath to make it absolute, like shown here.
36 sys.path.append(os.path.abspath('../aria'))
37 sys.path.append(os.path.abspath('../extensions'))
39 with open('../VERSION') as f:
40 version = f.readline()
42 # -- General configuration ------------------------------------------------
44 # If your documentation needs a minimal Sphinx version, state it here.
46 # needs_sphinx = '1.0'
48 # Add any Sphinx extension module names here, as strings. They can be
49 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
53 'sphinx.ext.autosummary',
54 'sphinx.ext.intersphinx',
58 # Add any paths that contain templates here, relative to this directory.
59 templates_path = ['_templates']
61 # The suffix(es) of source filenames.
62 # You can specify multiple suffix as a list of string:
64 # source_suffix = ['.rst', '.md']
65 source_suffix = '.rst'
67 # The encoding of source files.
69 # source_encoding = 'utf-8-sig'
71 # The master toctree document.
74 # General information about the project.
75 project = u'ARIA TOSCA'
76 copyright = u'2016-2017, Apache Software Foundation' # @ReservedAssignment
77 author = u'Apache Software Foundation'
79 # The version info for the project you're documenting, acts as replacement for
80 # |version| and |release|, also used in various other places throughout the
83 # The short X.Y version.
85 # The full version, including alpha/beta/rc tags.
86 release = version # @UndefinedVariable
88 # The language for content autogenerated by Sphinx. Refer to documentation
89 # for a list of supported languages.
91 # This is also used if you do content translation via gettext catalogs.
92 # Usually you set "language" from the command line for these cases.
95 # There are two options for replacing |today|: either, you set today to some
96 # non-false value, then it is used:
100 # Else, today_fmt is used as the format for a strftime call.
102 # today_fmt = '%B %d, %Y'
104 # List of patterns, relative to source directory, that match files and
105 # directories to ignore when looking for source files.
106 # This patterns also effect to html_static_path and html_extra_path
107 exclude_patterns = []
109 # The reST default role (used for this markup: `text`) to use for all
112 # default_role = None
114 # If true, '()' will be appended to :func: etc. cross-reference text.
116 # add_function_parentheses = True
118 # If true, the current module name will be prepended to all description
119 # unit titles (such as .. function::).
121 # add_module_names = True
123 # If true, sectionauthor and moduleauthor directives will be shown in the
124 # output. They are ignored by default.
126 # show_authors = False
128 # The name of the Pygments (syntax highlighting) style to use.
129 pygments_style = 'sphinx'
131 # A list of ignored prefixes for module index sorting.
132 # modindex_common_prefix = []
134 # If true, keep warnings as "system message" paragraphs in the built documents.
135 # keep_warnings = False
137 # If true, `todo` and `todoList` produce output, else they produce nothing.
138 todo_include_todos = False
141 # -- Options for HTML output ----------------------------------------------
143 # The theme to use for HTML and HTML Help pages. See the documentation for
144 # a list of builtin themes.
146 html_theme = 'sphinx_rtd_theme'
148 # Theme options are theme-specific and customize the look and feel of a theme
149 # further. For a list of options available for each theme, see the
152 # html_theme_options = {}
154 # Add any paths that contain custom themes here, relative to this directory.
155 #html_theme_path = []
157 # The name for this set of Sphinx documents.
158 # "<project> v<release> documentation" by default.
160 # html_title = u'ARIA TOSCA v0.1.0'
162 # A shorter title for the navigation bar. Default is the same as html_title.
164 # html_short_title = None
166 # The name of an image file (relative to this directory) to place at the top
171 # The name of an image file (relative to this directory) to use as a favicon of
172 # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
175 # html_favicon = None
177 # Add any paths that contain custom static files (such as style sheets) here,
178 # relative to this directory. They are copied after the builtin static files,
179 # so a file named "default.css" will overwrite the builtin "default.css".
180 html_static_path = ['_static']
182 # Add any extra paths that contain custom files (such as robots.txt or
183 # .htaccess) here, relative to this directory. These files are copied
184 # directly to the root of the documentation.
186 # html_extra_path = []
188 # If not None, a 'Last updated on:' timestamp is inserted at every page
189 # bottom, using the given strftime format.
190 # The empty string is equivalent to '%b %d, %Y'.
192 # html_last_updated_fmt = None
194 # If true, SmartyPants will be used to convert quotes and dashes to
195 # typographically correct entities.
197 # html_use_smartypants = True
199 # Custom sidebar templates, maps document names to template names.
203 # Additional templates that should be rendered to pages, maps page names to
206 # html_additional_pages = {}
208 # If false, no module index is generated.
210 # html_domain_indices = True
212 # If false, no index is generated.
214 # html_use_index = True
216 # If true, the index is split into individual pages for each letter.
218 # html_split_index = False
220 # If true, links to the reST sources are added to the pages.
222 # html_show_sourcelink = True
224 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
226 # html_show_sphinx = True
228 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
230 # html_show_copyright = True
232 # If true, an OpenSearch description file will be output, and all pages will
233 # contain a <link> tag referring to it. The value of this option must be the
234 # base URL from which the finished HTML is served.
236 # html_use_opensearch = ''
238 # This is the file name suffix for HTML files (e.g. ".xhtml").
239 # html_file_suffix = None
241 # Language to be used for generating the HTML full-text search index.
242 # Sphinx supports the following languages:
243 # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
244 # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
246 # html_search_language = 'en'
248 # A dictionary with options for the search language support, empty by default.
249 # 'ja' uses this config value.
250 # 'zh' user can custom change `jieba` dictionary path.
252 # html_search_options = {'type': 'default'}
254 # The name of a javascript file (relative to the configuration directory) that
255 # implements a search results scorer. If empty, the default will be used.
257 # html_search_scorer = 'scorer.js'
259 # Output file base name for HTML help builder.
260 htmlhelp_basename = 'ARIATOSCAdoc'
262 # -- Options for LaTeX output ---------------------------------------------
265 # The paper size ('letterpaper' or 'a4paper').
267 # 'papersize': 'letterpaper',
269 # The font size ('10pt', '11pt' or '12pt').
271 # 'pointsize': '10pt',
273 # Additional stuff for the LaTeX preamble.
277 # Latex figure (float) alignment
279 # 'figure_align': 'htbp',
282 # Grouping the document tree into LaTeX files. List of tuples
283 # (source start file, target name, title,
284 # author, documentclass [howto, manual, or own class]).
286 (master_doc, 'ARIATOSCA.tex', u'ARIA TOSCA',
287 u'Apache Software Foundation', 'manual'),
290 # The name of an image file (relative to this directory) to place at the top of
295 # For "manual" documents, if this is true, then toplevel headings are parts,
298 # latex_use_parts = False
300 # If true, show page references after internal links.
302 # latex_show_pagerefs = False
304 # If true, show URL addresses after external links.
306 # latex_show_urls = False
308 # Documents to append as an appendix to all manuals.
310 # latex_appendices = []
312 # If false, no module index is generated.
314 # latex_domain_indices = True
317 # -- Options for manual page output ---------------------------------------
319 # One entry per manual page. List of tuples
320 # (source start file, name, description, authors, manual section).
322 (master_doc, 'aria', u'ARIA TOSCA',
326 # If true, show URL addresses after external links.
328 # man_show_urls = False
331 # -- Options for Texinfo output -------------------------------------------
333 # Grouping the document tree into Texinfo files. List of tuples
334 # (source start file, target name, title, author,
335 # dir menu entry, description, category)
336 texinfo_documents = [
337 (master_doc, 'ARIATOSCA', u'ARIA TOSCA',
338 author, 'ARIA TOSCA', 'an open, light, CLI-driven library of orchestration tools that other '
339 'open projects can consume to easily build TOSCA-based orchestration solutions.',
343 # Documents to append as an appendix to all manuals.
345 # texinfo_appendices = []
347 # If false, no module index is generated.
349 # texinfo_domain_indices = True
351 # How to display URL addresses: 'footnote', 'no', or 'inline'.
353 # texinfo_show_urls = 'footnote'
355 # If true, do not generate a @detailmenu in the "Top" node's menu.
357 # texinfo_no_detailmenu = False
360 # -- Options for InterSphinx
362 intersphinx_mapping = {
363 'python': ('https://docs.python.org/2.7', None)
366 # -- Options for Python domain
368 # Append __init__ docstring into class docstring
369 autoclass_content = 'both'
371 # Default to everything important
372 autodoc_default_flags = [
380 'ALLOW_UNKNOWN_FIELDS',
382 'INSTRUMENTATION_FIELDS'
385 SKIP_MEMBER_SUFFIXES = (
389 NEVER_SKIP_MEMBERS = (
395 from sphinx import addnodes
396 from sphinx.domains.python import PythonDomain
401 # Note: "exclude_patterns" is not good enough for us, because we still have a TOC entry.
402 # Unfortunately, there is no way to conditionally exclude a TOC entry, and TOC entries without
403 # matching documents emit an error. So, we will have to manipulate the doctree directly!
404 SKIP_DOCUMENTS = ('aria.orchestrator.execution_plugin.ssh',)
406 def on_autodoc_skip_member(app, what, name, obj, skip, options):
407 if name in NEVER_SKIP_MEMBERS:
409 if name in SKIP_MEMBERS:
411 for suffix in SKIP_MEMBER_SUFFIXES:
412 if name.endswith(suffix):
416 def on_source_read(app, docname, source):
418 if docname in SKIP_DOCUMENTS:
421 def on_doctree_read(app, doctree):
422 # Remove TOC entry (see: https://gist.github.com/kakawait/9215487)
423 for toctreenode in doctree.traverse(addnodes.toctree):
424 for e in toctreenode['entries']:
426 if ref in SKIP_DOCUMENTS:
427 toctreenode['entries'].remove(e)
429 class PatchedPythonDomain(PythonDomain):
430 # See: https://github.com/sphinx-doc/sphinx/issues/3866
431 def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
432 if 'refspecific' in node:
433 del node['refspecific']
434 return super(PatchedPythonDomain, self).resolve_xref(
435 env, fromdocname, builder, typ, target, node, contnode)
438 app.connect('autodoc-skip-member', on_autodoc_skip_member)
439 app.connect('source-read', on_source_read)
440 app.connect('doctree-read', on_doctree_read)
441 app.override_domain(PatchedPythonDomain)