blob: 460860cda133617695e4fe78a6bf511430b7c915 [file] [log] [blame]
Aric Gardner0fb94b12020-01-28 15:21:34 -05001from docs_conf.conf import *
Rich Bennett22ef0852017-07-19 18:05:55 -04002
Aric Gardner0fb94b12020-01-28 15:21:34 -05003branch = 'latest'
Rich Bennett22ef0852017-07-19 18:05:55 -04004master_doc = 'index'
5
Aric Gardner0fb94b12020-01-28 15:21:34 -05006linkcheck_ignore = [
7 'http://localhost',
8]
Rich Bennettc5995662017-10-18 15:27:52 -04009
Aric Gardner0fb94b12020-01-28 15:21:34 -050010intersphinx_mapping = {}
Rich Bennettc5995662017-10-18 15:27:52 -040011
Rich Bennett80455a52017-11-08 05:17:00 -050012html_last_updated_fmt = '%d-%b-%y %H:%M'
Rich Bennett22ef0852017-07-19 18:05:55 -040013
Rich Bennett317d81a2018-09-11 07:38:05 -040014def setup(app):
Aric Gardner0fb94b12020-01-28 15:21:34 -050015 app.add_stylesheet("css/ribbon_onap.css")
Aric Gardnere2417212020-02-07 13:56:45 -050016
17
18from docutils.parsers.rst import directives
19
20needs_extra_options = {
21 "target": directives.unchanged,
22 "keyword": directives.unchanged,
23 "introduced": directives.unchanged,
24 "updated": directives.unchanged,
25 "impacts": directives.unchanged,
26 "validation_mode": directives.unchanged,
27 "validated_by": directives.unchanged,
28 "test": directives.unchanged,
29 "test_case": directives.unchanged,
30 "test_file": directives.unchanged,
31 "notes": directives.unchanged,
32}
33
34needs_id_regex = "^[A-Z0-9]+-[A-Z0-9]+"
35needs_id_required = True
36needs_title_optional = True
37
38needs_template_collapse = """
39.. _{{id}}:
40
41{% if hide == false -%}
42.. role:: needs_tag
43.. role:: needs_status
44.. role:: needs_type
45.. role:: needs_id
46.. role:: needs_title
47
48.. rst-class:: need
49.. rst-class:: need_{{type_name}}
50
51.. container:: need
52
53 `{{id}}` - {{content|indent(4)}}
54
55 .. container:: toggle
56
57 .. container:: header
58
59 Details
60
61{% if status and status|upper != "NONE" and not hide_status %} | status: :needs_status:`{{status}}`{% endif %}
62{% if tags and not hide_tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %}
63{% if keyword %} | keyword: `{{keyword}}` {% endif %}
64{% if target %} | target: `{{target}}` {% endif %}
65{% if introduced %} | introduced: `{{introduced}}` {% endif %}
66{% if updated %} | updated: `{{updated}}` {% endif %}
67{% if impacts %} | impacts: `{{impacts}}` {% endif %}
68{% if validation_mode %} | validation mode: `{{validation_mode}}` {% endif %}
69{% if validated_by %} | validated by: `{{validated_by}}` {% endif %}
70{% if test %} | test: `{{test}}` {% endif %}
71{% if test_case %} | test case: {{test_case}} {% endif %}
72{% if test_file %} | test file: `{{test_file}}` {% endif %}
73{% if notes %} | notes: `{{notes}}` {% endif %}
74 | children: :need_incoming:`{{id}}`
75 | parents: :need_outgoing:`{{id}}`
76{% endif -%}
77"""
78