1 #Copyright (c) 2017 Open Network Automation Platform and contributors
3 #Licensed under the Apache License, Version 2.0 (the "License");
4 #you may not use this file except in compliance with the License.
5 #You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 #Unless required by applicable law or agreed to in writing,
10 #software distributed under the License is distributed on an
11 #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12 #either express or implied. See the License for the specific
13 #language governing permissions and limitations under the License.
15 import sphinx_bootstrap_theme
16 from docs_conf.conf import *
23 'sphinx.ext.graphviz',
26 'sphinx.ext.viewcode',
27 'sphinxcontrib.blockdiag',
28 'sphinxcontrib.needs',
29 'sphinxcontrib.nwdiag',
30 'sphinxcontrib.seqdiag',
31 'sphinx.ext.ifconfig',
33 'sphinxcontrib.plantuml',
34 'sphinxcontrib.swaggerdoc'
37 # Extension Configuration
38 seqdiag_fontpath = '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf'
39 nwdiag_fontpath = '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf'
42 templates_path = ['_templates']
44 # The suffix(es) of source filenames.
45 source_suffix = '.rst'
47 # The master toctree document.
50 # General information about the project.
52 copyright = u'2019 ONAP. Licensed under Creative Commons Attribution 4.0 International License'
53 author = u'Open Network Automation Platform'
55 # Project version and release
59 # The language for content autogenerated by Sphinx.
62 # List of patterns, relative to source directory, that match files and
63 # directories to ignore when looking for source files.
68 # The name of the Pygments (syntax highlighting) style to use.
69 pygments_style = 'sphinx'
71 # If true, keep warnings as "system message" paragraphs in the built documents.
74 # If true, `todo` and `todoList` produce output, else they produce nothing.
75 todo_include_todos = True
78 # -- Options for HTML output ----------------------------------------------
80 # The theme to use for HTML and HTML Help pages.
81 html_theme = 'bootstrap'
82 html_theme_options = {
83 'bootswatch_theme': "lumen",
84 'navbar_sidebarrel': False
86 html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
88 # The name for this set of Sphinx documents. If None, it defaults to
89 # "<project> v<release> documentation".
92 # A shorter title for the navigation bar. Default is the same as html_title.
93 #html_short_title = None
95 # The name of an image file (relative to this directory) to place at the top
97 html_logo = '_static/logo_onap_2017.png'
98 html_favicon = '_static/favicon.ico'
100 # Add any paths that contain custom static files (such as style sheets) here,
101 # relative to this directory. They are copied after the builtin static files,
102 # so a file named "default.css" will overwrite the builtin "default.css".
103 html_static_path = ['_static']
105 # Add any extra paths that contain custom files (such as robots.txt or
106 # .htaccess) here, relative to this directory. These files are copied
107 # directly to the root of the documentation.
108 #html_extra_path = []
110 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
111 # using the given strftime format.
112 html_last_updated_fmt = '%d-%b-%y %H:%M'
114 # If true, SmartyPants will be used to convert quotes and dashes to
115 # typographically correct entities.
116 #html_use_smartypants = True
118 # Custom sidebar templates, maps document names to template names.
121 # Additional templates that should be rendered to pages, maps page names to
123 #html_additional_pages = {}
125 # If false, no module index is generated.
126 #html_domain_indices = True
128 # If false, no index is generated.
129 #html_use_index = True
131 # If true, the index is split into individual pages for each letter.
132 #html_split_index = False
134 # If true, links to the reST sources are added to the pages.
135 #html_show_sourcelink = True
137 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
138 html_show_sphinx = False
140 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
141 #html_show_copyright = True
143 # If true, an OpenSearch description file will be output, and all pages will
144 # contain a <link> tag referring to it. The value of this option must be the
145 # base URL from which the finished HTML is served.
146 #html_use_opensearch = ''
148 # This is the file name suffix for HTML files (e.g. ".xhtml").
149 #html_file_suffix = None
151 # Language to be used for generating the HTML full-text search index.
152 # Sphinx supports the following languages:
153 # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
154 # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
155 #html_search_language = 'en'
157 # A dictionary with options for the search language support, empty by default.
158 # Now only 'ja' uses this config value
159 #html_search_options = {'type': 'default'}
161 # The name of a javascript file (relative to the configuration directory) that
162 # implements a search results scorer. If empty, the default will be used.
163 #html_search_scorer = 'scorer.js'
165 # Output file base name for HTML help builder.
166 htmlhelp_basename = 'ONAPdoc'
168 # -- Options for LaTeX output ---------------------------------------------
171 # The paper size ('letterpaper' or 'a4paper').
172 #'papersize': 'letterpaper',
174 # The font size ('10pt', '11pt' or '12pt').
175 #'pointsize': '10pt',
177 # Additional stuff for the LaTeX preamble.
180 # Latex figure (float) alignment
181 #'figure_align': 'htbp',
184 # Grouping the document tree into LaTeX files. List of tuples
185 # (source start file, target name, title,
186 # author, documentclass [howto, manual, or own class]).
188 (master_doc, 'ONAP.tex', u'ONAP Documentation',
189 u'ONAP Contributors', 'manual'),
192 # The name of an image file (relative to this directory) to place at the top of
196 # For "manual" documents, if this is true, then toplevel headings are parts,
198 #latex_use_parts = False
200 # If true, show page references after internal links.
201 #latex_show_pagerefs = False
203 # If true, show URL addresses after external links.
204 #latex_show_urls = False
206 # Documents to append as an appendix to all manuals.
207 #latex_appendices = []
209 # If false, no module index is generated.
210 #latex_domain_indices = True
213 # -- Options for manual page output ---------------------------------------
215 # One entry per manual page. List of tuples
216 # (source start file, name, description, authors, manual section).
218 (master_doc, 'onap', u'ONAP Documentation',
222 # If true, show URL addresses after external links.
223 #man_show_urls = False
226 # -- Options for Texinfo output -------------------------------------------
228 # Grouping the document tree into Texinfo files. List of tuples
229 # (source start file, target name, title, author,
230 # dir menu entry, description, category)
231 texinfo_documents = [
232 (master_doc, 'ONAP', u'ONAP Documentation',
233 author, 'ONAP', 'Open Network Automation Platform',
237 # Documents to append as an appendix to all manuals.
238 #texinfo_appendices = []
240 # If false, no module index is generated.
241 #texinfo_domain_indices = True
243 # How to display URL addresses: 'footnote', 'no', or 'inline'.
244 #texinfo_show_urls = 'footnote'
246 # If true, do not generate a @detailmenu in the "Top" node's menu.
247 #texinfo_no_detailmenu = False
250 # -- Options for Epub output ----------------------------------------------
252 # Bibliographic Dublin Core info.
255 epub_publisher = author
256 epub_copyright = copyright
258 # The basename for the epub file. It defaults to the project name.
259 #epub_basename = project
261 # The HTML theme for the epub output. Since the default themes are not optimized
262 # for small screen space, using the same theme for HTML and epub output is
263 # usually not wise. This defaults to 'epub', a theme designed to save visual
267 # The language of the text. It defaults to the language option
268 # or 'en' if the language is not set.
271 # The scheme of the identifier. Typical schemes are ISBN or URL.
274 # The unique identifier of the text. This can be a ISBN number
275 # or the project homepage.
276 #epub_identifier = ''
278 # A unique identification for the text.
281 # A tuple containing the cover image and cover page html template filenames.
284 # A sequence of (type, uri, title) tuples for the guide element of content.opf.
287 # HTML files that should be inserted before the pages created by sphinx.
288 # The format is a list of tuples containing the path and title.
291 # HTML files shat should be inserted after the pages created by sphinx.
292 # The format is a list of tuples containing the path and title.
293 #epub_post_files = []
295 # A list of files that should not be packed into the epub file.
296 epub_exclude_files = ['search.html']
298 # The depth of the table of contents in toc.ncx.
301 # Allow duplicate toc entries.
304 # Choose between 'default' and 'includehidden'.
305 #epub_tocscope = 'default'
307 # Fix unsupported image types using the Pillow.
308 #epub_fix_images = False
310 # Scale large images.
311 #epub_max_image_width = 0
313 # How to display URL addresses: 'footnote', 'no', or 'inline'.
314 #epub_show_urls = 'inline'
316 # If false, no index is generated.
317 #epub_use_index = True
322 'version_status': 'supported',
325 # Patterns to ignore in linkcheck builder
331 r'http://172\.[123]',
332 r'http://app_host:port/',
333 r'http://app-host:port/',
334 r'http://ESR_SERVICE_IP',
335 r'http://ESR_SERVER_IP',
336 r'http://hostIP:\d+/',
337 r'http://load-balanced-address:\d+/',
339 r'http://\$msb_address/',
340 r'http://\$MSB_SERVER_IP:\d+/',
341 r'http://msb_docker_host_ip:\d+/',
342 r'http://MSB_IP:MSB_PORT/',
343 r'http://msb.onap.org',
344 r'http://MSB_SERVER_IP:\d+/',
345 r'http://org.openecomp.',
346 r'http://{PDP_URL}:\d+/',
347 r'http://servername.domain.com',
348 r'http://.*simpledemo.openecomp.org',
349 r'http://.*simpledemo.onap.org',
350 r'http://.*test.att.com:\d+/',
351 r'http://we-are-data-router.us',
352 r'http://we-are-message-router.us:\d+/'
353 r'http://www.\[host\]:\[port\]/',
354 r'http://yourhostname',
359 r'https://172\.[123]',
360 r'https://aaf.onap.org',
361 r'https://\$CBAM_IP',
362 r'https://ESR_SERVICE_IP',
363 r'https://ESR_SERVER_IP',
364 r'https://msb.onap.org',
365 r'https://my-subscriber-app.dcae',
366 r'https://\$CBAM_IP:\d+/',
367 r'https://load-balanced-address:\d+/',
368 r'https://prov.datarouternew.com:8443',
369 r'https://.*simpledemo.openecomp.org',
370 r'https://.*simpledemo.onap.org',
371 r'https://.*test.att.com:\d+/',
372 r'https://we-are-data-router.us',
373 r'https://we-are-message-router.us:\d+/'
376 from docutils.parsers.rst import directives
378 needs_extra_options = {
379 "target": directives.unchanged,
380 "keyword": directives.unchanged,
381 "introduced": directives.unchanged,
382 "updated": directives.unchanged,
383 "impacts": directives.unchanged,
384 "validation_mode": directives.unchanged,
385 "validated_by": directives.unchanged,
386 "test": directives.unchanged,
387 "test_case": directives.unchanged,
388 "test_file": directives.unchanged,
389 "notes": directives.unchanged,
392 needs_id_regex = "^[A-Z0-9]+-[A-Z0-9]+"
393 needs_id_required = True
394 needs_title_optional = True
396 needs_template_collapse = """
399 {% if hide == false -%}
401 .. role:: needs_status
404 .. role:: needs_title
407 .. rst-class:: need_{{type_name}}
411 `{{id}}` - {{content|indent(4)}}
413 .. container:: toggle
415 .. container:: header
419 {% if status and status|upper != "NONE" and not hide_status %} | status: :needs_status:`{{status}}`{% endif %}
420 {% if tags and not hide_tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %}
421 {% if keyword %} | keyword: `{{keyword}}` {% endif %}
422 {% if target %} | target: `{{target}}` {% endif %}
423 {% if introduced %} | introduced: `{{introduced}}` {% endif %}
424 {% if updated %} | updated: `{{updated}}` {% endif %}
425 {% if impacts %} | impacts: `{{impacts}}` {% endif %}
426 {% if validation_mode %} | validation mode: `{{validation_mode}}` {% endif %}
427 {% if validated_by %} | validated by: `{{validated_by}}` {% endif %}
428 {% if test %} | test: `{{test}}` {% endif %}
429 {% if test_case %} | test case: {{test_case}} {% endif %}
430 {% if test_file %} | test file: `{{test_file}}` {% endif %}
431 {% if notes %} | notes: `{{notes}}` {% endif %}
432 | children: :need_incoming:`{{id}}`
433 | parents: :need_outgoing:`{{id}}`
438 app.add_stylesheet("css/ribbon.css")