Custom Attributes
The Standard Attributes can be extended by custom attributes using the dox_trace_custom_attributes
option in conf.py
.
Syntax
dox_trace_custom_attributes = {
<name>: {
"directives": <directives-list>, # mandatory
"categories": <categories-list>, # mandatory if directives include "requirement" or "information"
"type": "text|enum|refs", # mandatory
"default": <default>, # optional, defaults to "" or [], depending on type
"export": "yes|no" # optional, defaults to "no"
}
...
}
dox_trace_custom_attributes must be a hash with:
key: name of the attribute
value: parameter of the attribute
The names must be unique and not conflict with Standard Attributes.
Parameters
directives is mandatory; it lists all specification Types for which the attribute shall be available. It must be a non-empty list of strings.
categories is mandatory if the directives parameter includes requirement or information. It must be a non-empty list of strings containing input, system and/or software.
type is mandatory; must be one of text, enum and refs.
text: Attribute value interpreted as RST syntax.
enum: Comma separated textual string list.
refs: Comma separated list of Sphinx references. The references are not considered for calculating downstream or upstream references.
default is optional; used if the attribute is not set explicitly in specifications.
export is optional; setting to “yes” enables the export to Dim files. Note, that the Dim configuration must also support this attribute.
Values
An attribute value is one of the following (in that particular order):
explicitly set in the specifications
defined in the properties files
taken from the default parameter
""
or[]
, depending on the type
The output is formatted according to the type. Empty attributes are rendered as -
.
Example
conf.py:
dox_trace_custom_attributes = {
"custom_text": {
"directives": ["spec", "unit"],
"type": "text",
"default": "THIS IS THE DEFAULT VALUE",
},
"custom_enum": {
"directives": ["spec", "unit"],
"type": "enum",
"default": ["x", "y"],
"export": "yes",
},
"custom_refs": {
"directives": ["spec", "requirement"],
"categories": ["input"],
"type": "refs",
},
}
RST file:
.. requirement:: CRS_CustomAttribute_Requirement
:category: input
.. spec:: SWA_CustomAttribute_Spec
:custom_text:
|br|
This is *italic text*,
- some bullet
- points and ...
.. note::
... a small note!
:custom_enum: a, b, c
:custom_refs: SMD_CustomAttribute_Unit, CRS_CustomAttribute_Requirement, dim_custom_attr
.. unit:: SMD_CustomAttribute_Unit
Rendered output:
|
Asil: not_set | Cal: not_set |
[missing] |
|
Asil: not_set | Cal: not_set | Upstream Asil: - | Upstream Cal: - |
[missing] |
|
Asil: not_set | Cal: not_set | Upstream Asil: - | Upstream Cal: - |
[missing] |