Demo page details

Page source code: index.rst

  1{% set page="index.rst" %}
  2{% include "demo_page_header.rst" with context %}
  3
  4
  5🧰 Basic Example
  6================
  7
  8Sphinx-Needs objects
  9--------------------
 10
 11.. req:: Example Requirement
 12   :id: EX_REQ_001
 13   :tags: security
 14   :status: open
 15
 16   A simple requirement used as example.
 17   The content supports all kind of Sphinx features, like:
 18
 19   **Bold** or *italic* text
 20
 21   Web links, like this `google <https://google.com>`__ link.
 22
 23   Or even images:
 24
 25   .. image:: /_images/sphinx-needs-logo.png
 26      :width: 50px
 27
 28.. spec:: Example Specification
 29   :id: EX_SPEC_001
 30   :links: EX_REQ_001
 31   :tags: security, safety
 32   :status: closed
 33
 34
 35   But also features from integated Sphinx exentions can be used, like this PlantUML generated image from this code
 36
 37   .. grid:: 2
 38
 39      .. grid-item::
 40
 41         .. code-block:: rst
 42
 43            .. uml::
 44
 45               node A
 46               node B
 47               A --> B
 48
 49      .. grid-item::
 50
 51         .. uml::
 52
 53               node A
 54               node B
 55               A --> B
 56
 57This example test cases also links against an external need:
 58
 59.. test:: Example Test case
 60   :id: EX_TEST_001
 61   :links: EX_SPEC_001, REQ_1_1_ext
 62   :status: passed
 63
 64   And for sure also all features from Sphinx-Needs, like this needflow:
 65
 66   .. needflow::
 67      :filter: docname is not None and "basic_example" in docname
 68
 69Sphinx-Needs filtering
 70----------------------
 71
 72.. code-block:: rst
 73
 74   .. needtable::
 75      :filter: docname is not None and "basic_example" in docname
 76
 77.. needtable::
 78      :filter: docname is not None and "basic_example" in docname
 79
 80
 81.. code-block:: rst
 82
 83   .. needflow::
 84      :filter: docname is not None and "basic_example" in docname
 85
 86.. needflow::
 87      :filter: docname is not None and "basic_example" in docname
 88
 89
 90Sphinx-Needs debuging
 91---------------------
 92
 93A Sphinx-Needs object using the ``debug`` layout to show all set and internal values, which can also be used in all filter strings.
 94
 95Sphinx-Needs collect and assigns a lot of data automatically for the specific needs, like their location or the headlines, under which
 96it is presented.
 97
 98.. req:: Example Requirement with debug view
 99   :id: EX_REQ_002
100   :status: open
101   :tags: debug
102   :layout: debug
103
104   Some content
105
106Imported needs
107--------------
108
109.. needimport:: imported_project
110
111External needs
112--------------
113
114Here are some needs that are external to the documentation,
115but can still be linked by other needs in this documentation:
116
117- :need:`REQ_1_1_ext` (this is linked in this documentation by :need:`EX_TEST_001`)
118- :need:`REQ_1_2_ext`
119- :need:`SPEC_1_1_ext`
120- :need:`SPEC_1_2_ext`

🧰 Basic Example¢

Sphinx-Needs objectsΒΆ

This example test cases also links against an external need:

Sphinx-Needs filteringΒΆ

.. needtable::
   :filter: docname is not None and "basic_example" in docname

ID

Title

Status

Type

Outgoing

Tags

EX_REQ_001

Example Requirement

open

req

security

EX_REQ_002

Example Requirement with debug view

open

req

debug

EX_SPEC_001

Example Specification

closed

spec

security; safety

EX_TEST_001

Example Test case

passed

test

REQ_1_1_imp

Requirement page 1 nr 1

approved

req

REQ_1_2_imp

Requirement page 1 nr 2

approved

req

SPEC_1_1_imp

Specification page 1 nr 1

spec

SPEC_1_2_imp

Specification page 1 nr 2

spec

.. needflow::
   :filter: docname is not None and "basic_example" in docname

@startuml

' Nodes definition 

node "<size:12>Requirement</size>\n**Example**\n**Requirement**\n<size:10>EX_REQ_001</size>" as EX_REQ_001 [[../basic_example/index.html#EX_REQ_001]] #FFB300
node "<size:12>Specification</size>\n**Example**\n**Specification**\n<size:10>EX_SPEC_001</size>" as EX_SPEC_001 [[../basic_example/index.html#EX_SPEC_001]] #ec6dd7
node "<size:12>Test Case</size>\n**Example Test**\n**case**\n<size:10>EX_TEST_001</size>" as EX_TEST_001 [[../basic_example/index.html#EX_TEST_001]] #A6BDD7
node "<size:12>Requirement</size>\n**Example**\n**Requirement**\n**with debug view**\n<size:10>EX_REQ_002</size>" as EX_REQ_002 [[../basic_example/index.html#EX_REQ_002]] #FFB300
node "<size:12>Requirement</size>\n**Requirement**\n**page 1 nr 1**\n<size:10>REQ_1_1_imp</size>" as REQ_1_1_imp [[../basic_example/index.html#REQ_1_1_imp]] #FFB300
node "<size:12>Requirement</size>\n**Requirement**\n**page 1 nr 2**\n<size:10>REQ_1_2_imp</size>" as REQ_1_2_imp [[../basic_example/index.html#REQ_1_2_imp]] #FFB300
node "<size:12>Specification</size>\n**Specification**\n**page 1 nr 1**\n<size:10>SPEC_1_1_imp</size>" as SPEC_1_1_imp [[../basic_example/index.html#SPEC_1_1_imp]] #ec6dd7
node "<size:12>Specification</size>\n**Specification**\n**page 1 nr 2**\n<size:10>SPEC_1_2_imp</size>" as SPEC_1_2_imp [[../basic_example/index.html#SPEC_1_2_imp]] #ec6dd7

' Connection definition 

EX_SPEC_001 --> EX_REQ_001
EX_TEST_001 --> EX_SPEC_001
SPEC_1_1_imp --> REQ_1_1_imp
SPEC_1_2_imp --> REQ_1_2_imp

@enduml

Sphinx-Needs debugingΒΆ

A Sphinx-Needs object using the debug layout to show all set and internal values, which can also be used in all filter strings.

Sphinx-Needs collect and assigns a lot of data automatically for the specific needs, like their location or the headlines, under which it is presented.

EX_REQ_002 Example Requirement with debug view
id: EX_REQ_002
type: req
type_name: Requirement
type_prefix: R_
type_color: #FFB300
type_style: node
title: Example Requirement with debug view
status: open
tags: debug
constraints:
collapse: False
hide: False
style:
layout: debug
external_css: external_link
arch: {}
has_dead_links: False
has_forbidden_dead_links: False
sections: ('Sphinx-Needs debuging', '🧰 Basic Example')
signature:
project:
file:
directory:
local-url:
remote-url:
role:
contact:
image:
date:
customer:
github:
jira:
config:
number:
effort:
approved:
asil:
severity:
exposure:
controllability:
scenario:
safe_state:
duration:
completion:
test_file:
suite:
case:
case_name:
case_parameter:
classname:
time:
suites:
cases:
passed:
skipped:
failed:
errors:
result:
query:
specific:
max_amount:
max_content_lines:
id_prefix:
user:
created_at:
updated_at:
closed_at:
service:
url:
avatar:
params:
prefix:
url_postfix:
links:
parent_needs:
persons:
release:
author:
based_on:
reqs:
implements:
depends_on:
realizes:
spec:
runs:
specs:
mitigates:
derives_from:
provides:
consumes:
uses:
provided_by:
startup_calls:
shutdown_calls:
links_back:
parent_needs_back:
persons_back:
release_back:
author_back:
based_on_back:
reqs_back:
implements_back:
depends_on_back:
realizes_back:
spec_back:
runs_back:
specs_back:
mitigates_back:
derives_from_back:
provides_back:
consumes_back:
uses_back:
provided_by_back:
startup_calls_back:
shutdown_calls_back:
docname: basic_example/index
lineno: 108
lineno_content: 114
external_url:
is_import: False
is_external: False
doctype: .rst
content: Some content
pre_content:
post_content:
jinja_content: False
template:
pre_template:
post_template:
is_need: True
is_part: False
modifications: 0
is_modified: False
id_parent: EX_REQ_002
id_complete: EX_REQ_002
parts: {}
constraints_results: {}
constraints_error:
constraints_passed: True
section_name: Sphinx-Needs debuging
parent_need:

Some content

Imported needsΒΆ

Requirement: Requirement page 1 nr 1 REQ_1_1_imp
status: approved
number: 1
duration: 0
completion: 0
links incoming: SPEC_1_1_imp
Requirement: Requirement page 1 nr 2 REQ_1_2_imp
status: approved
number: 2
duration: 0
completion: 0
links incoming: SPEC_1_2_imp
Specification: Specification page 1 nr 1 SPEC_1_1_imp
number: 1
duration: 0
completion: 0
links outgoing: REQ_1_1_imp
Specification: Specification page 1 nr 2 SPEC_1_2_imp
number: 2
duration: 0
completion: 0
links outgoing: REQ_1_2_imp

External needsΒΆ

Here are some needs that are external to the documentation, but can still be linked by other needs in this documentation: