Features

🔍 Features

ID

Title

SI

Errors

FE_SN_CONTENT_RENDER

Display Traceability objects content in Sphinx-Needs

yes

ER_SN_CONTENT_SYNTAX

FE_SN_DOCTREE

Generate object representation in Sphinx-Needs

yes

ER_SN_LAY_META_MIS; ER_SN_LAY_META_WRONG

FE_SN_DYN_FUNC

Apply dynamic functions for meta-data computation

yes

ER_SN_DYN_NO_EXEC; ER_SN_DYN_INVALID2; ER_SN_DYN_WRONG_CALC

FE_SN_JSON

Export needs.json file using Sphinx-Needs

yes

ER_SN_JSON_MIS; ER_SN_JSON_COR

FE_SN_LINK

Establish links between Traceability objects in Sphinx-Needs

yes

ER_SN_LINKS_NO_BACK; ER_SN_LINKS_NO_TARGET; ER_SN_LINKS_NO_EXT; ER_SN_LINKS_EXT_COR; ER_SN_LINKS_MISSING

FE_SN_READ

Read Traceability objects in Sphinx-Needs

yes

ER_SN_SYN_ER; ER_SN_JSON_NOT_FOUND; ER_SN_JSON_CORRUPTED; ER_SN_SER_AUTH; ER_SN_DATA_INVALID; ER_SN_CODE_ERR; ER_SN_JSON_FILTER; ER_SN_SER_DOWN; ER_SN_SER_INVALID

FE_SN_SET_META

Assign meta-data to Traceability objects in Sphinx-Needs

yes

ER_SN_DYN_INVALID; ER_SN_DYN_WRONG; ER_SN_META_INVALID; ER_SN_META_NOT_COMPLIANT

FE_SN_TEMPLATE_NEED

Enhance Need content using templates in Sphinx-Needs

yes

FE_SN_TEMPLATE_PAGE

Extend page content with templates in Sphinx-Needs

yes

FE_SPHINX_NEEDS_AUTO_ID

Automatic ID generation

yes

FE_SPHINX_NEEDS_CONFIG_FILES

Configuration via conf.py or an external TOML file

no

FE_SPHINX_NEEDS_CONFIG_LAYOUTS

Customizable layouts for need presentation

yes

FE_SPHINX_NEEDS_CUSTOMIZABLE_LINKS

Customizable link types

yes

FE_SPHINX_NEEDS_CUSTOMIZABLE_OPTIONS

Customizable need options

yes

FE_SPHINX_NEEDS_DEFINABLE_TYPES

Definable need types

yes

FE_SPHINX_NEEDS_DIRECTIVE_NEEDBAR

Create a bar chart based on need statistics (needbar)

no

FE_SPHINX_NEEDS_DIRECTIVE_NEEDEXTEND

Modify existing needs in bulk (needextend)

yes

FE_SPHINX_NEEDS_DIRECTIVE_NEEDFLOW

Render a PlantUML flow diagram of needs (needflow)

no

FE_SPHINX_NEEDS_DIRECTIVE_NEEDIMPORT

Import needs from an external JSON file (needimport)

yes

FE_SPHINX_NEEDS_DIRECTIVE_NEEDPIE

Create a pie chart based on need statistics (needpie)

no

FE_SPHINX_NEEDS_DIRECTIVE_NEEDTABLE

Display needs in a filterable table (needtable)

no

FE_SPHINX_NEEDS_DYNAMIC_CONSTRAINTS

Constraint checking to validate need relationships

yes

FE_SPHINX_NEEDS_EXPORT_JSON

JSON builder to export all need data

yes

FE_SPHINX_NEEDS_EXPORT_PERMALINKS

Permalink generation to specific need objects

yes

FE_SPHINX_NEEDS_LINKING_BIDIRECTIONAL

Bidirectional link tracking

yes

FE_SPHINX_NEEDS_LINKING_DEAD_LINK_DETECTION

Dead link detection and warnings

yes

FE_SPHINX_NEEDS_LINKING_DIRECT

Direct linking between needs using IDs

yes

FE_SPHINX_NEEDS_MANUAL_ID

Manual ID assignment

yes

FE_SPHINX_NEEDS_NEED_PARTS

In-content need parts for granular references

yes

FE_SPHINX_NEEDS_STATUS_ENFORCEMENT

Need status enforcement

yes

FE_SPHINX_NEEDS_TAGGING

Tagging support

yes

FE_SPHINX_NEEDS_UNIQUE_ID_ENFORCEMENT

Unique ID enforcement and checks

yes

../../_images/need_pie_54381.svg
Feature: Read Traceability objects in Sphinx-Needs FE_SN_READ

Read Traceability objects from rst/md files into the internal storage.

Error: Syntax errors in rst/md files cause Traceability objects to be ignored ER_SN_SYN_ER
style: red_bar
td: 1
parent needs: FE_SN_READ
Error: Missing external needs.json file ER_SN_JSON_NOT_FOUND
style: red_bar
td: 1
parent needs: FE_SN_READ
Error: Corrupted external needs.json file ER_SN_JSON_CORRUPTED
style: red_bar
td: 1
parent needs: FE_SN_READ
Error: Authentication issues with needsservice ER_SN_SER_AUTH
style: red_bar
td: 1
parent needs: FE_SN_READ
Error: Invalid meta-data in rst/md files leads to ignored Traceability objects ER_SN_DATA_INVALID
style: red_bar
td: 1
parent needs: FE_SN_READ
avoided by: RE_SN_WARNINGS
Error: Programmatic errors in rst/md files result in ignored Traceability objects ER_SN_CODE_ERR
style: red_bar
td: 1
parent needs: FE_SN_READ
Error: Invalid or incorrect filters used for external needs.json ER_SN_JSON_FILTER
style: red_bar
td: 1
parent needs: FE_SN_READ
Error: External service unreachable by needsservice ER_SN_SER_DOWN
style: red_bar
td: 1
parent needs: FE_SN_READ
Error: needsservice unable to process data from external service ER_SN_SER_INVALID
style: red_bar
td: 1
parent needs: FE_SN_READ
Feature: Display Traceability objects content in Sphinx-Needs FE_SN_CONTENT_RENDER
style: green_bar
si: yes
featured by: UC_SW_REQ
tools: TOOL_SN
Error: Content contains syntax errors ER_SN_CONTENT_SYNTAX
style: red_bar
td: 1
parent needs: FE_SN_CONTENT_RENDER
Feature: Assign meta-data to Traceability objects in Sphinx-Needs FE_SN_SET_META
style: green_bar
si: yes
Error: Dynamic functions return invalid meta-data ER_SN_DYN_INVALID
style: red_bar
td: 1
parent needs: FE_SN_SET_META
avoided by: CHECK_SN_NO_DYN
Error: Dynamic functions return wrong meta-data ER_SN_DYN_WRONG
style: red_bar
td: 3
parent needs: FE_SN_SET_META
avoided by: CHECK_SN_NO_DYN

Internal dynamic functions are checked by test-cases in Sphinx-Needs itself.

But self-written dynamic functions can do whatever they want, as long as the returned data ist still valid (but may be wrong).

So self-written dynamic functions need test cases as well!

Error: Sphinx-Needs data not valid ER_SN_META_INVALID
style: red_bar
td: 1
parent needs: FE_SN_SET_META
Error: Sphinx-Needs data is not process-compliant ER_SN_META_NOT_COMPLIANT
style: red_bar
td: 1
parent needs: FE_SN_SET_META
Feature: Generate object representation in Sphinx-Needs FE_SN_DOCTREE
style: green_bar
si: yes
Error: Meta-data missing ER_SN_LAY_META_MIS
style: red_bar
td: 1
parent needs: FE_SN_DOCTREE

Needed meta-data is not part of the final representation in the doctree and so later HTML/PDF build

Error: Wrong meta-data is used ER_SN_LAY_META_WRONG
style: red_bar
td: 1
parent needs: FE_SN_DOCTREE

Sphinx-Needs is adding wrong Meta-Data to the final doctree-layout

Feature: Export needs.json file using Sphinx-Needs FE_SN_JSON
style: green_bar
si: yes
tools: TOOL_SN
Error: Objects missing in needs.json ER_SN_JSON_MIS
style: red_bar
td: 1
parent needs: FE_SN_JSON
Error: Traceability objects meta-data corrupted ER_SN_JSON_COR
style: red_bar
td: 1
parent needs: FE_SN_JSON

Dynamic Content

Feature: Apply dynamic functions for meta-data computation FE_SN_DYN_FUNC
style: green_bar
si: yes
Error: Function gets not executed ER_SN_DYN_NO_EXEC
style: red_bar
td: 1
parent needs: FE_SN_DYN_FUNC

The function gets not executed and in the generated documentation the dynamic-function string can be found.

Error: Function returns invalid value ER_SN_DYN_INVALID2
style: red_bar
td: 1
parent needs: FE_SN_DYN_FUNC

Function returns a technically not allowed value.

Error: Function returns wrong calculated values ER_SN_DYN_WRONG_CALC
style: red_bar
td: 3
parent needs: FE_SN_DYN_FUNC

The dynamic functions calculates wrong values

Feature: Extend page content with templates in Sphinx-Needs FE_SN_TEMPLATE_PAGE
style: green_bar
si: yes
tools: TOOL_SN
Feature: Enhance Need content using templates in Sphinx-Needs FE_SN_TEMPLATE_NEED
style: green_bar
si: yes
tools: TOOL_SN

Core Need Object

Feature: Definable need types FE_SPHINX_NEEDS_DEFINABLE_TYPES
style: green_bar
si: yes
tools: TOOL_SN

Allows the definition of custom need types beyond the built-in ones. Each type gets its own directive, title, and color for easy identification in diagrams.

# In conf.py
needs_types = [
    dict(directive="req", title="Requirement", prefix="R_", color="#BFD8D2"),
    dict(directive="spec", title="Specification", prefix="S_", color="#FEDCD2"),
    dict(directive="test", title,"Test Case", prefix="T_", color="#DCFED2"),
]
Feature: Customizable need options FE_SPHINX_NEEDS_CUSTOMIZABLE_OPTIONS
style: green_bar
si: yes
tools: TOOL_SN

Define extra options that any need object can have, such as ‘author’ or ‘component’. These custom options can be displayed in tables and used for filtering.

# In conf.py
needs_extra_options = ['author', 'component']
.. req:: A specific requirement
   :id: R_001
   :author: John Doe
   :component: UI
Feature: Automatic ID generation FE_SPHINX_NEEDS_AUTO_ID
style: green_bar
si: yes
tools: TOOL_SN

Sphinx-Needs can automatically generate a unique ID for any need that does not have one. The format of the ID can be configured using a prefix and a specific length.

.. req:: This requirement will get an ID automatically.
   :tags: auto_id
Feature: Manual ID assignment FE_SPHINX_NEEDS_MANUAL_ID
style: green_bar
si: yes
tools: TOOL_SN

Allows for setting a specific, human-readable ID for a need. This is useful for referencing important requirements easily.

.. req:: A requirement with a specific ID
   :id: R_IMPORTANT_FEATURE
Feature: Need status enforcement FE_SPHINX_NEEDS_STATUS_ENFORCEMENT
style: green_bar
si: yes
tools: TOOL_SN

You can define a list of allowed statuses for needs. If a need uses a status that is not on the list, Sphinx will raise a warning during the build.

# In conf.py
needs_statuses = [
    ('open', 'Is still open'),
    ('in_progress', 'Work in progress'),
    ('closed', 'Is closed'),
    ('rejected', 'Will not be implemented'),
]
Feature: Tagging support FE_SPHINX_NEEDS_TAGGING
style: green_bar
si: yes
tools: TOOL_SN

Assign one or more tags to a need for categorization and filtering. Tags help in organizing needs and creating specific views or reports.

.. spec:: A specification for the login system
   :id: S_LOGIN
   :tags: ui, security
Feature: In-content need parts for granular references FE_SPHINX_NEEDS_NEED_PARTS
style: green_bar
si: yes
tools: TOOL_SN

Create references to specific sentences or parts inside a need’s content. This allows for very precise linking and traceability.

.. req:: User Authentication
   :id: R_AUTH

   The user must be able to log in via a username and password.
   The password must be stored securely. :np:`secure_storage`

.. test:: Test secure password storage
   :id: T_SECURE_STORAGE
   :links: R_AUTH.secure_storage
Feature: Unique ID enforcement and checks FE_SPHINX_NEEDS_UNIQUE_ID_ENFORCEMENT
style: green_bar
si: yes
tools: TOOL_SN

Sphinx-Needs automatically checks if all manually set IDs are unique across the project. The build will fail if a duplicate ID is found, ensuring data consistency.

Directives for Creating & Displaying Needs

Feature: Display needs in a filterable table (needtable) FE_SPHINX_NEEDS_DIRECTIVE_NEEDTABLE
style: green_bar
si: no
tools: TOOL_SN

Renders a table of needs based on specified filters. The table columns can be customized to show different need options like status or outgoing links.

.. needtable::
   :tags: ui
   :status: open
   :columns: id, title, status, links
Feature: Render a PlantUML flow diagram of needs (needflow) FE_SPHINX_NEEDS_DIRECTIVE_NEEDFLOW
style: green_bar
si: no
tools: TOOL_SN

Generates a flowchart that visualizes the relationships between filtered needs. This is excellent for showing process flows or dependencies.

.. needflow::
   :tags: login_flow
   :show_legend:
Feature: Create a pie chart based on need statistics (needpie) FE_SPHINX_NEEDS_DIRECTIVE_NEEDPIE
style: green_bar
si: no
tools: TOOL_SN

Generates a pie chart from need data, for instance, to show the distribution of statuses. This provides a quick visual summary of the project’s state.

.. needpie:: Requirements Status
   :content: status
   :legend:
Feature: Create a bar chart based on need statistics (needbar) FE_SPHINX_NEEDS_DIRECTIVE_NEEDBAR
style: green_bar
si: no
tools: TOOL_SN

Generates a bar chart to visualize need data. This is useful for comparing counts across different categories, such as components.

.. needbar:: Needs per Component
   :x_option: component
   :x_labels: UI, Backend, Database
Feature: Import needs from an external JSON file (needimport) FE_SPHINX_NEEDS_DIRECTIVE_NEEDIMPORT
style: green_bar
si: yes
tools: TOOL_SN

Import need objects from an external needs.json file. This allows for sharing and reusing requirements across different Sphinx projects.

.. needimport:: ../../shared/output/needs.json
Feature: Modify existing needs in bulk (needextend) FE_SPHINX_NEEDS_DIRECTIVE_NEEDEXTEND
style: green_bar
si: yes
tools: TOOL_SN

Modifies multiple needs at once based on a filter. You can add tags, change the status, or set any other option for all filtered needs.

.. needextend:: status == 'in_progress'
   :add_tags: sprint_5

Linking and Traceability

Feature: Direct linking between needs using IDs FE_SPHINX_NEEDS_LINKING_DIRECT
style: green_bar
si: yes
tools: TOOL_SN

Create links between needs by referencing their unique IDs in link options. This forms the basis of all traceability in Sphinx-Needs.

.. spec:: Defines how the login button works.
   :id: S_LOGIN_BUTTON

.. req:: The login button must be blue.
   :id: R_LOGIN_COLOR
   :links: S_LOGIN_BUTTON
Feature: Bidirectional link tracking FE_SPHINX_NEEDS_LINKING_BIDIRECTIONAL
style: green_bar
si: yes
tools: TOOL_SN

When you link from need A to need B, Sphinx-Needs automatically knows about the incoming link on need B. This allows for full, bidirectional traceability without extra work.

Automated Features

Feature: Constraint checking to validate need relationships FE_SPHINX_NEEDS_DYNAMIC_CONSTRAINTS
style: green_bar
si: yes
tools: TOOL_SN

Define rules, or constraints, about your need data that are checked during the build. For example, you can enforce that every requirement must be linked to a test case.

# In conf.py
needs_constraints = {
    "req_verified": {
        "check_code": "len(links_back['verifies']) > 0",
        "severity": "error",
        "filter": "'req' in tags"
    }
}

Configuration & Customization

Feature: Configuration via conf.py or an external TOML file FE_SPHINX_NEEDS_CONFIG_FILES
style: green_bar
si: no
tools: TOOL_SN

All Sphinx-Needs options can be configured in the main conf.py file. For large configurations, you can also use an external needs.toml file to keep things organized.

Feature: Customizable layouts for need presentation FE_SPHINX_NEEDS_CONFIG_LAYOUTS
style: green_bar
si: yes
tools: TOOL_SN

Change the visual presentation of needs by defining custom layouts. You can reorder options, use grids, and change how information is displayed.

# In conf.py
needs_layouts = {
    'my_layout': {
        'grid': 'simple_side_right',
        'layout': {
            'side': ['id', 'status', 'tags', 'links']
        }
    }
}

Exporting & Reporting

Feature: JSON builder to export all need data FE_SPHINX_NEEDS_EXPORT_JSON
style: green_bar
si: yes
tools: TOOL_SN

Export all need objects and their relationships into a structured needs.json file. This file can be used for external analysis, reporting, or imported into other Sphinx projects.

sphinx-build -b needs . _build