shivasubedi | 8df61a9 | 2021-06-16 14:43:18 +0100 | [diff] [blame] | 1 | # ============LICENSE_START======================================================= |
| 2 | # Copyright (C) 2021 Nordix Foundation |
| 3 | # ================================================================================ |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
lukegleeson | 15b93e7 | 2021-07-07 15:25:30 +0100 | [diff] [blame] | 9 | # |
shivasubedi | 8df61a9 | 2021-06-16 14:43:18 +0100 | [diff] [blame] | 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | # SPDX-License-Identifier: Apache-2.0 |
| 17 | # ============LICENSE_END========================================================= |
| 18 | |
shivasubedi | 44beaa3 | 2021-09-13 15:16:30 +0100 | [diff] [blame] | 19 | |
| 20 | from docutils.parsers.rst import directives |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 21 | from docs_conf.conf import * |
| 22 | |
ToineSiebelink | 3920785 | 2021-10-21 12:11:25 +0100 | [diff] [blame] | 23 | #change 'latest' to relevant branch-name once branch has been created |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 24 | branch = 'latest' |
shivasubedi | 44beaa3 | 2021-09-13 15:16:30 +0100 | [diff] [blame] | 25 | doc_url = 'https://docs.onap.org/projects' |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 26 | master_doc = 'index' |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 27 | |
| 28 | intersphinx_mapping = {} |
| 29 | |
ToineSiebelink | 3920785 | 2021-10-21 12:11:25 +0100 | [diff] [blame] | 30 | intersphinx_mapping['onap-cps-ncmp-dmi-plugin'] = ('{}/onap-cps-ncmp-dmi-plugin/en/%s'.format(doc_url) % branch, None) |
| 31 | intersphinx_mapping['onap-cps-cps-temporal'] = ('{}/onap-cps-cps-temporal/en/%s'.format(doc_url) % branch, None) |
shivasubedi | 44beaa3 | 2021-09-13 15:16:30 +0100 | [diff] [blame] | 32 | |
| 33 | linkcheck_ignore = [ |
| 34 | 'http://localhost', |
| 35 | 'https://example.com', |
| 36 | 'about:config', |
| 37 | # this URL is not directly reachable and must be configured in the system hosts file. |
| 38 | 'https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm', |
| 39 | # anchor issues |
| 40 | 'https://docs.onap.org/projects/onap-integration/en/latest/docs_usecases_release.html#.*', |
| 41 | 'https://docs.linuxfoundation.org/docs/communitybridge/easycla/contributors/contribute-to-a-gerrit-project#.*', |
| 42 | 'https://docs.onap.org/projects/onap-integration/en/latest/docs_robot.html#docs-robot', |
| 43 | 'https://docs.onap.org/projects/onap-integration/en/latest/docs_usecases_release.html#docs-usecases-release', |
| 44 | 'https://docs.onap.org/projects/onap-integration/en/latest/docs_usecases.html#docs-usecases', |
| 45 | 'https://docs.onap.org/projects/onap-integration/en/latest/usecases/release_non_functional_requirements.html#release-non-functional-requirements', |
| 46 | ] |
| 47 | |
| 48 | |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 49 | html_last_updated_fmt = '%d-%b-%y %H:%M' |
| 50 | |
Rishi.Chail | 5272dca | 2021-02-23 12:14:24 +0000 | [diff] [blame] | 51 | |
| 52 | def setup(app): |
shivasubedi | 44beaa3 | 2021-09-13 15:16:30 +0100 | [diff] [blame] | 53 | app.add_css_file("css/ribbon.css") |
| 54 | |
| 55 | |
| 56 | needs_extra_options = { |
| 57 | "target": directives.unchanged, |
| 58 | "keyword": directives.unchanged, |
| 59 | "introduced": directives.unchanged, |
| 60 | "updated": directives.unchanged, |
| 61 | "impacts": directives.unchanged, |
| 62 | "validation_mode": directives.unchanged, |
| 63 | "validated_by": directives.unchanged, |
| 64 | "test": directives.unchanged, |
| 65 | "test_case": directives.unchanged, |
| 66 | "test_file": directives.unchanged, |
| 67 | "notes": directives.unchanged, |
| 68 | } |
| 69 | |
| 70 | needs_id_regex = "^[A-Z0-9]+-[A-Z0-9]+" |
| 71 | needs_id_required = True |
| 72 | needs_title_optional = True |
| 73 | |
| 74 | needs_template_collapse = """ |
| 75 | .. _{{id}}: |
| 76 | |
| 77 | {% if hide == false -%} |
| 78 | .. role:: needs_tag |
| 79 | .. role:: needs_status |
| 80 | .. role:: needs_type |
| 81 | .. role:: needs_id |
| 82 | .. role:: needs_title |
| 83 | |
| 84 | .. rst-class:: need |
| 85 | .. rst-class:: need_{{type_name}} |
| 86 | |
| 87 | .. container:: need |
| 88 | |
| 89 | `{{id}}` - {{content|indent(4)}} |
| 90 | |
| 91 | .. container:: toggle |
| 92 | |
| 93 | .. container:: header |
| 94 | |
| 95 | Details |
| 96 | |
| 97 | {% if status and status|upper != "NONE" and not hide_status %} | status: :needs_status:`{{status}}`{% endif %} |
| 98 | {% if tags and not hide_tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %} |
| 99 | {% if keyword %} | keyword: `{{keyword}}` {% endif %} |
| 100 | {% if target %} | target: `{{target}}` {% endif %} |
| 101 | {% if introduced %} | introduced: `{{introduced}}` {% endif %} |
| 102 | {% if updated %} | updated: `{{updated}}` {% endif %} |
| 103 | {% if impacts %} | impacts: `{{impacts}}` {% endif %} |
| 104 | {% if validation_mode %} | validation mode: `{{validation_mode}}` {% endif %} |
| 105 | {% if validated_by %} | validated by: `{{validated_by}}` {% endif %} |
| 106 | {% if test %} | test: `{{test}}` {% endif %} |
| 107 | {% if test_case %} | test case: {{test_case}} {% endif %} |
| 108 | {% if test_file %} | test file: `{{test_file}}` {% endif %} |
| 109 | {% if notes %} | notes: `{{notes}}` {% endif %} |
| 110 | | children: :need_incoming:`{{id}}` |
| 111 | | parents: :need_outgoing:`{{id}}` |
| 112 | {% endif -%} |
| 113 | """ |