Sync a few commit ids
[doc.git] / docs / conf.py
index 7126e34..7b5bb4c 100644 (file)
@@ -1,35 +1,22 @@
-# -*- coding: utf-8 -*-
+#Copyright (c) 2017 Open Network Automation Platform and contributors
 #
-# ONAP documentation build configuration file, created by
-# sphinx-quickstart on Wed Jul 19 16:25:31 2017.
+#Licensed under the Apache License, Version 2.0 (the "License");
+#you may not use this file except in compliance with the License.
+#You may obtain a copy of the License at
 #
-# This file is execfile()d with the current directory set to its
-# containing dir.
+#         http://www.apache.org/licenses/LICENSE-2.0
 #
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys
-import os
-import shlex
-#import sphinx_bootstrap_theme
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#either express or implied. See the License for the specific
+#language governing permissions and limitations under the License.
 
-# -- General configuration ------------------------------------------------
+import sphinx_bootstrap_theme
+from docs_conf.conf import *
 
-# If your documentation needs a minimal Sphinx version, state it here.
-needs_sphinx = '1.5.3'
 
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
+#Sphinx Extensions
 extensions = [
     'sphinx.ext.autodoc',
     'sphinx.ext.doctest',
@@ -38,6 +25,7 @@ extensions = [
     'sphinx.ext.imgmath',
     'sphinx.ext.viewcode',
     'sphinxcontrib.blockdiag',
+    'sphinxcontrib.needs',
     'sphinxcontrib.nwdiag',
     'sphinxcontrib.seqdiag',
     'sphinx.ext.ifconfig',
@@ -46,81 +34,42 @@ extensions = [
     'sphinxcontrib.swaggerdoc'
 ]
 
-# Font path for seqdiag
+# Extension Configuration
 seqdiag_fontpath = '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf'
 nwdiag_fontpath =  '/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf'
 
-# Add any paths that contain templates here, relative to this directory.
+# Template Paths
 templates_path = ['_templates']
 
 # The suffix(es) of source filenames.
-# You can specify multiple suffix as a list of string:
-# source_suffix = ['.rst', '.md']
 source_suffix = '.rst'
 
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
 # The master toctree document.
 master_doc = 'index'
 
 # General information about the project.
 project = u''
-copyright = u'2017 ONAP. Licensed under Creative Commons Attribution 4.0 International License'
-
-
+copyright = u'2019 ONAP. Licensed under Creative Commons Attribution 4.0 International License'
 author = u'Open Network Automation Platform'
 
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-# The short X.Y version.
-version = 'master branch'
-# The full version, including alpha/beta/rc tags.
-release = 'master branch'
+# Project version and release
+version = 'dublin'
+release = 'dublin'
 
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#
-# This is also used if you do content translation via gettext catalogs.
-# Usually you set "language" from the command line for these cases.
+# The language for content autogenerated by Sphinx.
 language = None
 
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
 exclude_patterns = [
-       '_build' 
+       '_build'
        ]
 
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'
 
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
 # If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
+keep_warnings = False
 
 # If true, `todo` and `todoList` produce output, else they produce nothing.
 todo_include_todos = True
@@ -128,18 +77,13 @@ todo_include_todos = True
 
 # -- Options for HTML output ----------------------------------------------
 
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-#html_theme = 'bootstrap'
-html_theme = 'classic'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
+# The theme to use for HTML and HTML Help pages.
+html_theme = 'bootstrap'
+html_theme_options = {
+        'bootswatch_theme': "lumen",
+        'navbar_sidebarrel': False
+       }
+html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
 
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".
@@ -151,10 +95,6 @@ html_theme = 'classic'
 # The name of an image file (relative to this directory) to place at the top
 # of the sidebar.
 html_logo = '_static/logo_onap_2017.png'
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
 html_favicon = '_static/favicon.ico'
 
 # Add any paths that contain custom static files (such as style sheets) here,
@@ -376,30 +316,123 @@ epub_exclude_files = ['search.html']
 # If false, no index is generated.
 #epub_use_index = True
 
+
+nitpicky = True
+html_context = {
+    'version_status': 'supported',
+    }
+
 # Patterns to ignore in linkcheck builder
 linkcheck_ignore = [
-       r'http://localhost',
-       r'http://yourhostname',
-       r'http://{PDP_URL}:\d+/',
-       r'http://.*simpledemo.onap.org:\d+/',
+       r'http://$',
+       r'http:/$',
+       r'http://10\.',
+       r'http://127\.',
+       r'http://172\.[123]',
+       r'http://app_host:port/',
+       r'http://app-host:port/',
+       r'http://ESR_SERVICE_IP',
+       r'http://ESR_SERVER_IP',
+       r'http://hostIP:\d+/',
        r'http://load-balanced-address:\d+/',
-       r'http://127.0.0.1',
-       r'http://ESR_SERVER_IP:\d+/',
-       r'http://MSB_SERVER_IP:\d+/',
-       r'http://msb_docker_host_ip:\d+/',
-       r'http://msb.onap.org/',
+       r'http://localhost',
        r'http://\$msb_address/',
-       r'http://hostIP:\d+/',
-       r'https://\$CBAM_IP:\d+/',
-       r'http://app-host:port/',
+       r'http://\$MSB_SERVER_IP:\d+/',
+       r'http://msb_docker_host_ip:\d+/',
+       r'http://MSB_IP:MSB_PORT/',
+       r'http://msb.onap.org',
+       r'http://MSB_SERVER_IP:\d+/',
+       r'http://org.openecomp.',
+       r'http://{PDP_URL}:\d+/',
        r'http://servername.domain.com',
-       r'https://we-are-message-router.us:\d+/',
-       r'https://we-are-data-router.us:\d+/',
-       r'http://prov.datarouternew.com:8443/',
-       r'http://www.[host]:[port]/',
-       r'http:/$',
-       r'https:/$',
-       r'http://$',
+       r'http://.*simpledemo.openecomp.org',
+       r'http://.*simpledemo.onap.org',
+       r'http://.*test.att.com:\d+/',
+       r'http://we-are-data-router.us',
+       r'http://we-are-message-router.us:\d+/'
+       r'http://www.\[host\]:\[port\]/',
+       r'http://yourhostname',
        r'https://$',
-       r'http://app-host:port/'
+       r'https:/$',
+       r'https://10\.',
+       r'https://127\.',
+       r'https://172\.[123]',
+       r'https://aaf.onap.org',
+       r'https://\$CBAM_IP',
+       r'https://ESR_SERVICE_IP',
+       r'https://ESR_SERVER_IP',
+       r'https://msb.onap.org',
+       r'https://my-subscriber-app.dcae',
+       r'https://\$CBAM_IP:\d+/',
+       r'https://load-balanced-address:\d+/',
+       r'https://prov.datarouternew.com:8443',
+       r'https://.*simpledemo.openecomp.org',
+       r'https://.*simpledemo.onap.org',
+       r'https://.*test.att.com:\d+/',
+       r'https://we-are-data-router.us',
+       r'https://we-are-message-router.us:\d+/'
        ]
+
+from docutils.parsers.rst import directives
+
+needs_extra_options = {
+    "target": directives.unchanged,
+    "keyword": directives.unchanged,
+    "introduced": directives.unchanged,
+    "updated": directives.unchanged,
+    "impacts": directives.unchanged,
+    "validation_mode": directives.unchanged,
+    "validated_by": directives.unchanged,
+    "test": directives.unchanged,
+    "test_case": directives.unchanged,
+    "test_file": directives.unchanged,
+    "notes": directives.unchanged,
+}
+
+needs_id_regex = "^[A-Z0-9]+-[A-Z0-9]+"
+needs_id_required = True
+needs_title_optional = True
+
+needs_template_collapse = """
+.. _{{id}}:
+
+{% if hide == false -%}
+.. role:: needs_tag
+.. role:: needs_status
+.. role:: needs_type
+.. role:: needs_id
+.. role:: needs_title
+
+.. rst-class:: need
+.. rst-class:: need_{{type_name}}
+
+.. container:: need
+
+    `{{id}}` - {{content|indent(4)}}
+
+    .. container:: toggle
+
+        .. container:: header
+
+            Details
+
+{% if status and  status|upper != "NONE" and not hide_status %}        | status: :needs_status:`{{status}}`{% endif %}
+{% if tags and not hide_tags %}        | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %}
+{% if keyword %}        | keyword: `{{keyword}}` {% endif %}
+{% if target %}        | target: `{{target}}` {% endif %}
+{% if introduced %}        | introduced: `{{introduced}}` {% endif %}
+{% if updated %}        | updated: `{{updated}}` {% endif %}
+{% if impacts %}        | impacts: `{{impacts}}` {% endif %}
+{% if validation_mode %}        | validation mode: `{{validation_mode}}` {% endif %}
+{% if validated_by %}        | validated by: `{{validated_by}}` {% endif %}
+{% if test %}        | test: `{{test}}` {% endif %}
+{% if test_case %}        | test case: {{test_case}} {% endif %}
+{% if test_file %}        | test file: `{{test_file}}` {% endif %}
+{% if notes %}        | notes: `{{notes}}` {% endif %}
+        | children: :need_incoming:`{{id}}`
+        | parents: :need_outgoing:`{{id}}`
+{% endif -%}
+"""
+
+def setup(app):
+    app.add_stylesheet("css/ribbon.css")