Update Dublin Release
[doc.git] / docs / conf.py
1 #Copyright (c) 2017 Open Network Automation Platform and contributors
2 #
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
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 import sphinx_bootstrap_theme
16 from docs_conf.conf import *
17
18
19 #Sphinx Extensions
20 extensions = [
21     'sphinx.ext.autodoc',
22     'sphinx.ext.doctest',
23     'sphinx.ext.graphviz',
24     'sphinx.ext.todo',
25     'sphinx.ext.imgmath',
26     'sphinx.ext.viewcode',
27     'sphinxcontrib.blockdiag',
28     'sphinxcontrib.needs',
29     'sphinxcontrib.nwdiag',
30     'sphinxcontrib.seqdiag',
31     'sphinx.ext.ifconfig',
32     'sphinx.ext.todo',
33     'sphinxcontrib.plantuml',
34     'sphinxcontrib.swaggerdoc'
35 ]
36
37 # Extension Configuration
38 seqdiag_fontpath = '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf'
39 nwdiag_fontpath =  '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf'
40
41 # Template Paths
42 templates_path = ['_templates']
43
44 # The suffix(es) of source filenames.
45 source_suffix = '.rst'
46
47 # The master toctree document.
48 master_doc = 'index'
49
50 # General information about the project.
51 project = u''
52 copyright = u'2019 ONAP. Licensed under Creative Commons Attribution 4.0 International License'
53 author = u'Open Network Automation Platform'
54
55 # Project version and release
56 version = 'dublin'
57 release = 'dublin'
58
59 # The language for content autogenerated by Sphinx.
60 language = None
61
62 # List of patterns, relative to source directory, that match files and
63 # directories to ignore when looking for source files.
64 exclude_patterns = [
65         '_build'
66         ]
67
68 # The name of the Pygments (syntax highlighting) style to use.
69 pygments_style = 'sphinx'
70
71 # If true, keep warnings as "system message" paragraphs in the built documents.
72 keep_warnings = False
73
74 # If true, `todo` and `todoList` produce output, else they produce nothing.
75 todo_include_todos = True
76
77
78 # -- Options for HTML output ----------------------------------------------
79
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
85         }
86 html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
87
88 # The name for this set of Sphinx documents.  If None, it defaults to
89 # "<project> v<release> documentation".
90 #html_title = None
91
92 # A shorter title for the navigation bar.  Default is the same as html_title.
93 #html_short_title = None
94
95 # The name of an image file (relative to this directory) to place at the top
96 # of the sidebar.
97 html_logo = '_static/logo_onap_2017.png'
98 html_favicon = '_static/favicon.ico'
99
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']
104
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 = []
109
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'
113
114 # If true, SmartyPants will be used to convert quotes and dashes to
115 # typographically correct entities.
116 #html_use_smartypants = True
117
118 # Custom sidebar templates, maps document names to template names.
119 #html_sidebars = {}
120
121 # Additional templates that should be rendered to pages, maps page names to
122 # template names.
123 #html_additional_pages = {}
124
125 # If false, no module index is generated.
126 #html_domain_indices = True
127
128 # If false, no index is generated.
129 #html_use_index = True
130
131 # If true, the index is split into individual pages for each letter.
132 #html_split_index = False
133
134 # If true, links to the reST sources are added to the pages.
135 #html_show_sourcelink = True
136
137 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
138 html_show_sphinx = False
139
140 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
141 #html_show_copyright = True
142
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 = ''
147
148 # This is the file name suffix for HTML files (e.g. ".xhtml").
149 #html_file_suffix = None
150
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'
156
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'}
160
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'
164
165 # Output file base name for HTML help builder.
166 htmlhelp_basename = 'ONAPdoc'
167
168 # -- Options for LaTeX output ---------------------------------------------
169
170 latex_elements = {
171 # The paper size ('letterpaper' or 'a4paper').
172 #'papersize': 'letterpaper',
173
174 # The font size ('10pt', '11pt' or '12pt').
175 #'pointsize': '10pt',
176
177 # Additional stuff for the LaTeX preamble.
178 #'preamble': '',
179
180 # Latex figure (float) alignment
181 #'figure_align': 'htbp',
182 }
183
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]).
187 latex_documents = [
188   (master_doc, 'ONAP.tex', u'ONAP Documentation',
189    u'ONAP Contributors', 'manual'),
190 ]
191
192 # The name of an image file (relative to this directory) to place at the top of
193 # the title page.
194 #latex_logo = None
195
196 # For "manual" documents, if this is true, then toplevel headings are parts,
197 # not chapters.
198 #latex_use_parts = False
199
200 # If true, show page references after internal links.
201 #latex_show_pagerefs = False
202
203 # If true, show URL addresses after external links.
204 #latex_show_urls = False
205
206 # Documents to append as an appendix to all manuals.
207 #latex_appendices = []
208
209 # If false, no module index is generated.
210 #latex_domain_indices = True
211
212
213 # -- Options for manual page output ---------------------------------------
214
215 # One entry per manual page. List of tuples
216 # (source start file, name, description, authors, manual section).
217 man_pages = [
218     (master_doc, 'onap', u'ONAP Documentation',
219      [author], 1)
220 ]
221
222 # If true, show URL addresses after external links.
223 #man_show_urls = False
224
225
226 # -- Options for Texinfo output -------------------------------------------
227
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',
234    'Platform'),
235 ]
236
237 # Documents to append as an appendix to all manuals.
238 #texinfo_appendices = []
239
240 # If false, no module index is generated.
241 #texinfo_domain_indices = True
242
243 # How to display URL addresses: 'footnote', 'no', or 'inline'.
244 #texinfo_show_urls = 'footnote'
245
246 # If true, do not generate a @detailmenu in the "Top" node's menu.
247 #texinfo_no_detailmenu = False
248
249
250 # -- Options for Epub output ----------------------------------------------
251
252 # Bibliographic Dublin Core info.
253 epub_title = project
254 epub_author = author
255 epub_publisher = author
256 epub_copyright = copyright
257
258 # The basename for the epub file. It defaults to the project name.
259 #epub_basename = project
260
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
264 # space.
265 #epub_theme = 'epub'
266
267 # The language of the text. It defaults to the language option
268 # or 'en' if the language is not set.
269 #epub_language = ''
270
271 # The scheme of the identifier. Typical schemes are ISBN or URL.
272 #epub_scheme = ''
273
274 # The unique identifier of the text. This can be a ISBN number
275 # or the project homepage.
276 #epub_identifier = ''
277
278 # A unique identification for the text.
279 #epub_uid = ''
280
281 # A tuple containing the cover image and cover page html template filenames.
282 #epub_cover = ()
283
284 # A sequence of (type, uri, title) tuples for the guide element of content.opf.
285 #epub_guide = ()
286
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.
289 #epub_pre_files = []
290
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 = []
294
295 # A list of files that should not be packed into the epub file.
296 epub_exclude_files = ['search.html']
297
298 # The depth of the table of contents in toc.ncx.
299 #epub_tocdepth = 3
300
301 # Allow duplicate toc entries.
302 #epub_tocdup = True
303
304 # Choose between 'default' and 'includehidden'.
305 #epub_tocscope = 'default'
306
307 # Fix unsupported image types using the Pillow.
308 #epub_fix_images = False
309
310 # Scale large images.
311 #epub_max_image_width = 0
312
313 # How to display URL addresses: 'footnote', 'no', or 'inline'.
314 #epub_show_urls = 'inline'
315
316 # If false, no index is generated.
317 #epub_use_index = True
318
319
320 nitpicky = True
321 html_context = {
322     'version_status': 'supported',
323     }
324
325 # Patterns to ignore in linkcheck builder
326 linkcheck_ignore = [
327         r'http://$',
328         r'http:/$',
329         r'http://10\.',
330         r'http://127\.',
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+/',
338         r'http://localhost',
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',
355         r'https://$',
356         r'https:/$',
357         r'https://10\.',
358         r'https://127\.',
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+/'
374         ]
375
376 from docutils.parsers.rst import directives
377
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,
390 }
391
392 needs_id_regex = "^[A-Z0-9]+-[A-Z0-9]+"
393 needs_id_required = True
394 needs_title_optional = True
395
396 needs_template_collapse = """
397 .. _{{id}}:
398
399 {% if hide == false -%}
400 .. role:: needs_tag
401 .. role:: needs_status
402 .. role:: needs_type
403 .. role:: needs_id
404 .. role:: needs_title
405
406 .. rst-class:: need
407 .. rst-class:: need_{{type_name}}
408
409 .. container:: need
410
411     `{{id}}` - {{content|indent(4)}}
412
413     .. container:: toggle
414
415         .. container:: header
416
417             Details
418
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}}`
434 {% endif -%}
435 """
436
437 def setup(app):
438     app.add_stylesheet("css/ribbon.css")