summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAric Gardner <agardner@linuxfoundation.org>2020-02-07 13:56:45 -0500
committerAric Gardner <agardner@linuxfoundation.org>2020-02-07 14:13:42 -0500
commite24172103c81e2c6f244d1d301d65ec9ac55b7ee (patch)
treecf0c854692e149fb8d974c0515369d2ebe026e07 /docs
parent68d3425a789ed1ef28e617f59ab0ae4aca4c0eff (diff)
sphinxcontrib-needs extension to work
template added in the conf.py file that signifies the metadata allowed. necessary for the vnfrqts project. Issue-ID: CIMAN-33 Signed-off-by: Aric Gardner <agardner@linuxfoundation.org> Change-Id: I9c50dc18ac22ec7ca575186a4761e1a277387b50
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py63
-rw-r--r--docs/index.rst1
2 files changed, 64 insertions, 0 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 8f40e8b81..460860cda 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -13,3 +13,66 @@ html_last_updated_fmt = '%d-%b-%y %H:%M'
def setup(app):
app.add_stylesheet("css/ribbon_onap.css")
+
+
+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 -%}
+"""
+
diff --git a/docs/index.rst b/docs/index.rst
index 64ff88783..ee6933c21 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,6 +1,7 @@
.. This work is licensed under a
Creative Commons Attribution 4.0 International License.
+
.. _master_index:
Open Network Automation Platform