Update git submodules
[doc.git] / docs / conf.py
index 815d0d0..3b5c301 100644 (file)
@@ -38,6 +38,7 @@ extensions = [
     'sphinx.ext.imgmath',
     'sphinx.ext.viewcode',
     'sphinxcontrib.blockdiag',
+    'sphinxcontrib.needs',
     'sphinxcontrib.nwdiag',
     'sphinxcontrib.seqdiag',
     'sphinx.ext.ifconfig',
@@ -66,7 +67,7 @@ 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'
@@ -95,7 +96,7 @@ language = None
 # 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
@@ -120,7 +121,7 @@ pygments_style = 'sphinx'
 #modindex_common_prefix = []
 
 # If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
+keep_warnings = True
 
 # If true, `todo` and `todoList` produce output, else they produce nothing.
 todo_include_todos = True
@@ -130,13 +131,16 @@ todo_include_todos = True
 
 # 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'
+#html_theme = 'classic'
+html_theme = 'sphinx_rtd_theme'
 
 # 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 = {}
+html_theme_options = {
+       'style_nav_header_background': 'white',
+       'sticky_navigation': False
+       }
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
@@ -426,3 +430,67 @@ linkcheck_ignore = [
        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")