needtable

Added in version 0.2.0.

needtable generates a table, based on the result of given filters.

Example 1

.. needtable:: Example table
   :tags: main_example
   :style: table

No needs passed the filters

We use the argument of a needtable as caption for the table.

Options

Note

needtable supports the full filtering possibilities of Sphinx-Needs. Please see Filtering needs for more information.

Some further options are accepted only for ubCode compatibility, and are otherwise ignored.

columns

A comma/semicolon separated string used to define the position of specific columns. For instance:

.. needtable::
   :columns: id;title;tags

This will show the columns id, title and tags in the order given.

Example 2

.. needtable::
   :columns: id;title;tags

ID

Title

Tags

ACT_ANALYSIS

Analysis issue

ACT_BARKS

Barks for support

ACT_BUG

Find & Report bug

gantt_example

ACT_BUG_ANALYSE

Analyse bug

gantt_example

ACT_CREATE_EX

Create example

gantt_ex_duration

ACT_CREATE_EX_C

Create example

gantt_ex_completion

ACT_CREATE_EX_EW

Create example

gantt_ex_ends_with

ACT_CREATE_EX_SA

Create example

gantt_ex_starts_after

ACT_CREATE_EX_SW

Create example

gantt_ex_starts_with

ACT_DEPLOY

Deploy release

gantt_example

ACT_INFORM

Informs reporter

ACT_ISSUE

Creates issue

ACT_READ_EX

Read example

gantt_ex_duration

ACT_READ_EX_C

Read example

gantt_ex_completion

ACT_READ_EX_EW

Read example

gantt_ex_ends_with

ACT_READ_EX_SA

Read example

gantt_ex_starts_after

ACT_READ_EX_SW

Read example

gantt_ex_starts_with

ACT_RELEASE_PLAN

Add solution to release plan

gantt_example

ACT_REVIEW

Reviews solution

ACT_SOLUTION

Provides solution

ACT_TEST

Test release

gantt_example

ACT_TICKET

Create solution ticket

gantt_example

ACT_TICKET_WORK

Work on solution ticket

gantt_example

ACT_UNDERSTAND_EX_SW

Understand example

gantt_ex_starts_with

basic_example

Basic need example

clv_A

Input A

clv_B

Input B

clv_C

Input C

COMP_001

Component X

COMP_002

Component Y

COMP_A_B

Variant A or B

COMP_NEEDUML2

NeedUml example need 2

needuml

COMP_T_001

COMP_T_001

COMP_T_002

COMP_T_002

COMP_T_003

COMP_T_003

COMP_X

Component X

COMP_Z

Z

CON_REQ_1

Requirement 1

CON_REQ_2

Requirement 2

CON_SPEC_1

Test spec

CON_SPEC_2

Test spec 2

copy_1

copy-example

tag_1; tag_2; tag_3

copy_2

copy-example implementation

copy_3

test of specification and requirement

tag_1; tag_2; tag_3

copy_4

test of current_need value

DELID123

Second Requirement Need

DELID124

Nested Need without delete option

nested-del-need

df_1

my test requirement

test; open

EX_CARD_PROFILE

A specification with a picture

example

EX_CARD_SUMMARY

A requirement summarised on a card

example

EX_CLEAN

CLEAN layout

a; b; c; example

EX_CLEAN_L

CLEAN_L layout

a; b; c; example

EX_CLEAN_LP

CLEAN_LP layout

a; b; c; example

EX_CLEAN_R

CLEAN_R layout

a; b; c; example

EX_CLEAN_RP

CLEAN_RP layout

a; b; c; example

EX_COMPLETE

COMPLETE layout

a; b; c; example

EX_DEBUG

DEBUG layout

a; b; c; example

EX_FOCUS

FOCUS layout

a; b; c; example

EX_FOCUS_F

FOCUS_F layout

a; b; c; example

EX_FOCUS_L

FOCUS_L layout

a; b; c; example

EX_FOCUS_R

FOCUS_R layout

a; b; c; example

EX_REQ_1

A normal requirement

EX_REQ_2

A more complex and highlighted requirement

awesome; nice; great; example

EX_REQ_3

A focused requirement

example

EX_REQ_4

A custom requirement with picture

example

EX_REQ_5

A requirement with a permalink

example

EX_ROW_1

Implemented spec

ex_row_color

EX_ROW_2

Not implemented spec

ex_row_color

EX_ROW_3

Spec under progress

ex_row_color

EX_STYLE_BLUE

Blue background

example

EX_STYLE_BLUE_BAR

Blue bar

example

EX_STYLE_BLUE_BORDER

Blue border

example

EX_STYLE_CLEAN

Clean style

example

EX_STYLE_DISCREET

Discreet background

example

EX_STYLE_DISCREET_BORDER

Discreet border

example

EX_STYLE_DISCREET_COMBI

Discreet view

example

EX_STYLE_GREEN

Green background

example

EX_STYLE_GREEN_BAR

Green bar

example

EX_STYLE_GREEN_BORDER

Green border

example

EX_STYLE_ORANGE_BAR

Orange bar

example

EX_STYLE_RED

Red background

example

EX_STYLE_RED_BAR

Red bar

example

EX_STYLE_RED_BORDER

Red border

example

EX_STYLE_YELLOW

Yellow background

example

EX_STYLE_YELLOW_BAR

Yellow bar

example

EX_STYLE_YELLOW_BORDER

Yellow border

example

EX_STYLE_YELLOW_RED

Yellow background + Red border

example

EXAMPLE_1035

Error when building multiple latex documents

latex; pkg: sphinx-needs

EXAMPLE_1044

Failed to sphinx-build HTML docs for 1.3.0 tag?

EXAMPLE_141

A node can only be in one page, else it will be cut when generate latexpdf

bug; help wanted; no_fix

EXAMPLE_166

Fails to build PDF when 'req' directive contains nested directives

pkg: sphinx-needs

EXAMPLE_436

I cannot build the examples from a clean environment

EXAMPLE_796

NotImplementedError: <class 'sphinx.writers.latex.LaTeXTranslator'> departing unknown node type: NeedRef

EXAMPLE_808

Duplicate labels in `.tex` output

pkg: sphinx-needs

EXAMPLE_902

Issue with sphinxneeds directives during latexpdf build

pkg: sphinx-needs

EXAMPLE_STRING_LINKS

Use needs_string_links

EXT-FEATURE-A

Feature A

EXT-FEATURE-B

Feature B

B

EXT-REQ-1

Requirement 1

A; fast

EXT-REQ-2

Requirement 2

A; big

extend_test_001

needextend Example 1

tag_1; tag_2; new_tag

extend_test_002

needextend Example 2

extend_example; other

extend_test_003

needextend Example 3

extend_test_004

needextend Example 4

extend_test_005

needextend Example 5

extend_test_006

needextend Example 6

extend_test_007

needextend Example 7

applied_first; applied_second

EXTRA_REQ_001

My requirement

EXTRA_TEST_001

Test of requirements

EXTRACT_FEATURE_1

A feature

F_F25D3

Level 1

FAIL_01

FEATURE_NEEDUML1

NeedUml example need

needuml

ID123

User needs to login

user; login

IMAGE_EXAMPLE

My test spec

example

IMPL_01

Implementation for specification

impl_my_car_1

Build awesome car

INT_001

Test needuml save

INT_A

Interface A

JINJA1D8913

Need with jinja_content enabled

JINJAID123

First Req Need

JINJAID125

Nested Spec Need

user; login

JINJAID126

First Spec Need

LAYOUT_1

My layout requirement 1

layout_example

LAYOUT_2

My layout requirement 2

layout_example

LAYOUT_3

My layout requirement 3

layout_example

LFF_REQ_1

Open requirement

→ LFF_REQ_1.p1

→ open part

LFF_REQ_2

Another open requirement

LFF_SPEC_1

Collector of open needs

LFF_SPEC_2

Collector of requirements and their parts

LFM_SPEC_1

login

LFM_SPEC_2

logout

LFM_TEST_1

Session tests

LIST2NEED-001

Feature 1

LIST2NEED-002

Feature 2

LIST2NEED-003

Feature 3

LIST2NEED-REQ-1

Requirement which shall get also need-parts

→ LIST2NEED-REQ-1.1

→ The first need-part

→ LIST2NEED-REQ-1.ANOTHER

→ ANOTHER need-part

MS_BUG_SOLVED

Bug solved

gantt_example

MS_TICKET_CLOSED

Solution ticket closed

gantt_example

my_car_1

Car must be awesome

car

→ my_car_1.1

→ A top speed of 300 km/h

car

→ my_car_1.2

→ An acceleration of 200 m/s² or much much more

car

→ my_car_1.awesome_3

→ a turbo button

car

NEED-002

Another Need example on level 1 with a given ID

NEED-A

Login user

NEED-B

Provide login screen

NEED-C

Create password hash

NEED-D

Recalculate hash and compare

OWN_ID_123

Specification of a requirement

R_17EB4

Set admin e-mail to admin@mycompany.com

R_22EB2

Requirement B

B; filter_example

R_262A1

Link example Source

R_2A9D0

Requirement A

A; filter_example

R_316DE

Collapse is set to False

collapse; example

R_3C95C

Result 4

R_446C7

Group big short

R_50FCC

Level 1 need and more

R_53FBF

Level 1 need with rst

R_565A6

This is a requirement with a very long title that will need to be

R_6F47F

critical

R_96D5E

Result 2

R_A2D07

Collapse is set to True

collapse; example

R_A6A4E

test requirement

R_BAFCF

The first sentence will be the title

R_D0791

Result 3

R_D8F29

This will be my title

R_EA5C4

Level 2

R_ERROR_LOGGING

R_F199E

Level 1 need with newlines

R_F1B63

Need example on level 1

R_F4722

My first requirement

requirement; test; awesome

R_F7DEB

Result 1

req_arch_001

Requirement arch

req_arch_002

Req Arch second

req_arch_003

Req Arch third

req_arch_004

Req Arch four

req_flow_001

A requirement

flow_example

REQ_LINK_1

Link example Target

roles_req_1

Sliced Bread

roles_req_2

Butter on Bread

S_01A67

Specification B

B; filter_example

S_38199

And a complex sub-need on level 2 with an image-directive

S_3A83D

result 1: Positive check

S_4137F

result 2: Negative check

S_69FFD

Another Sub-Need on level 2

S_6A582

And a spec need

S_78442

result 3: Positive check thanks of used filter

S_951C8

result 5: Two checks and a joint status

S_9ED38

result 4: Positive check thanks of one_hit option

S_B4B62

Sub-Need on level 2 with status option set

S_CE0AA

Level 3

S_D70B0

Specification A

A; filter_example

SECURITY_REQ

SP_INT

Interfaces

spec_flow_001

A specification

flow_example

→ spec_flow_001.subspec_1

→ A testable part of the specification

flow_example

→ spec_flow_001.subspec_2

→ Another testable part of the specification

flow_example

spec_flow_002

Another specification

flow_example

spec_flow_003

A child specification

flow_example

STYLE_001

My styled requirement

style_example

STYLE_002

Another styled requirement

style_example

STYLE_003

Green is my color

style_example

STYLE_004

Yellow and blue border

STYLE_005

My automatically styled requirement

style_example

STYLE_006

My automatically styled requirement

style_example

STYLE_EX_SERVICE

Order service

styles_example

STYLE_EX_STORE

Order store

styles_example

sum_input_1

Do this

sum_input_2

Do that

sum_input_3

Do too much

SYS_ROCKET

System RocketScience

T_001

Unit test 1

tutorial; tutorial_tests

T_002

Unit test 2

tutorial; tutorial_tests

T_003

Unit test 3

tutorial; tutorial_tests

T_004

Unit test 4

tutorial; tutorial_tests

T_0F2B7

Level 4

T_5CCAA

Test 1

filter_example

T_C3893

Test for XY

test; user_interface; python27

T_CAR

Our new car

tutorial

T_CONNECT

Connectivity and Entertainment

tutorial

T_DIST

Implement distant detection

tutorial

T_EA5AF

Sub-Need on level 3

T_RADAR

Implement RADAR system

tutorial

T_SAFE

Safety Features

tutorial

table_001

Test need with need parts

test_table

→ table_001.1

→ Part 1 of requirement

test_table

→ table_001.2

→ Part 2 of requirement

test_table

→ table_001.3

→ Part 3 of requirement

test_table

table_002

Specifies part 1

test_table

table_003

Specifies part 2

test_table

TEMPL_POST_SPEC

My specification

example; template

TEMPL_PRE_SPEC

My specification

example; template

TEMPL_SPEC

My specification

example; template

test_001

test a requirement

test_arch_001

Test Arch

test_flow_001

A test case

flow_example

test_req

test me

USER_A

Mr. A

USER_B

Ms. B

USER_C

Expert C

USER_D

Office Dog

VA_004

Variant options

variants; support

xyz_123

My requirement with custom options

You can set all options of a need (incl. needs_fields) as a column. This also includes internal options like docname (Use :layout: debug on a need for a complete list)

If you set :columns:, the current table will not use the value of config parameter needs_table_columns.

Tables with a lot of columns will get a horizontal scrollbar in HTML output.

Interactive style

Example 3

.. needtable::
   :tags: test
   :columns: id;title;tags;status;docname;lineno,is_external,is_need;is_part;content

ID

Title

Tags

Status

Docname

Lineno

Is External

Is Need

Is Part

Content

df_1

my test requirement

test; open

open

dynamic_functions

71

False

True

False

This need has id :ndf:`copy("id")` and status :ndf:`copy("status")`.

R_F4722

My first requirement

requirement; test; awesome

open

filter

903

False

True

False

This is my **first** requirement!! .. note:: You can use any rst code inside it :)

T_C3893

Test for XY

test; user_interface; python27

implemented

filter

923

False

True

False

This test checks :need:`IMPL_01` for :need:`OWN_ID_123` inside a Python 2.7 environment.

Normal style

Example 4

.. needtable::
   :tags: test
   :style: table
   :columns: id;title;tags;status;docname;lineno,is_external,is_need;is_part;content

ID

Title

Tags

Status

Docname

Lineno

Is External

Is Need

Is Part

Content

df_1

my test requirement

test; open

open

dynamic_functions

71

False

True

False

This need has id :ndf:`copy("id")` and status :ndf:`copy("status")`.

R_F4722

My first requirement

requirement; test; awesome

open

filter

903

False

True

False

This is my **first** requirement!! .. note:: You can use any rst code inside it :)

T_C3893

Test for XY

test; user_interface; python27

implemented

filter

923

False

True

False

This test checks :need:`IMPL_01` for :need:`OWN_ID_123` inside a Python 2.7 environment.

colwidths

Added in version 0.7.4.

A comma separated list of lengths or percentages used to define the width of each column.

It has the same meaning as the width options of listtable directive.

Example 5

.. needtable::
   :tags: test
   :columns: id,title,status
   :colwidths: 50,40,10
   :style: table

ID

Title

Status

df_1

my test requirement

open

R_F4722

My first requirement

open

T_C3893

Test for XY

implemented

Custom column titles

You can customize each column title by following this syntax for its definition: OPTION as "My custom title". The characters , or ; are not allowed.

Example 6

.. needtable::
   :tags: test
   :columns: id;title as "Headline"; tags as "Labels"
   :style: table

ID

Headline

Labels

df_1

my test requirement

test; open

R_F4722

My first requirement

requirement; test; awesome

T_C3893

Test for XY

test; user_interface; python27

show_filters

If set, we add the used filter above the table:

Example 7

.. needtable::
   :tags: test
   :columns: id;title;tags
   :show_filters:
   :style: table

ID

Title

Tags

df_1

my test requirement

test; open

R_F4722

My first requirement

requirement; test; awesome

T_C3893

Test for XY

test; user_interface; python27

Used filter: tags(test)

style

Allows you to set a specific style for the current table.

Supported values are:

table

A plain Sphinx table. The rows are exactly what the sort option produced, and nothing is added on top of them.

datatables

The interactive table, and the default. It is the same table, enhanced in the browser by a small script that ships with Sphinx-Needs: the reader can sort a column, search the whole table, page through it and choose how many rows a page holds, switch columns off, copy the table to the clipboard and download it as CSV.

The enhancement is in place: every row and cell stays the element Sphinx-Needs rendered, so style_row classes, the needs_<column> cell classes and the links inside cells all survive sorting and searching, and a reader with JavaScript switched off still gets the whole table.

The count it shows – Showing 1-10 of 42 – counts needs, not rows: a need and its parts are one entry, so that a page never splits a need from its parts. The DataTables style counted rows, so a table with :show_parts: reports a smaller total than DataTables did.

What it deliberately does not do: export to Excel or PDF (the CSV it writes opens in Excel, and the browser’s own print command prints the page), and let the reader drag columns into a different order. Both were features of the DataTables package Sphinx-Needs bundled before this change.

Overrides config parameter needs_table_style if set.

Show example

Example 8

.. needtable::
   :style: table

.. needtable::
   :style: datatables

ID

Title

Status

Outgoing

ACT_ANALYSIS

Analysis issue

ACT_BARKS

Barks for support

ACT_BUG

Find & Report bug

ACT_BUG_ANALYSE

Analyse bug

ACT_CREATE_EX

Create example

ACT_CREATE_EX_C

Create example

ACT_CREATE_EX_EW

Create example

ACT_CREATE_EX_SA

Create example

ACT_CREATE_EX_SW

Create example

ACT_DEPLOY

Deploy release

ACT_INFORM

Informs reporter

ACT_ISSUE

Creates issue

ACT_READ_EX

Read example

ACT_READ_EX_C

Read example

ACT_READ_EX_EW

Read example

ACT_READ_EX_SA

Read example

ACT_READ_EX_SW

Read example

ACT_RELEASE_PLAN

Add solution to release plan

ACT_REVIEW

Reviews solution

ACT_SOLUTION

Provides solution

ACT_TEST

Test release

ACT_TICKET

Create solution ticket

ACT_TICKET_WORK

Work on solution ticket

ACT_UNDERSTAND_EX_SW

Understand example

basic_example

Basic need example

clv_A

Input A

in progress

clv_B

Input B

in progress

clv_C

Input C

closed

COMP_001

Component X

COMP_002

Component Y

COMP_A_B

Variant A or B

COMP_NEEDUML2

NeedUml example need 2

draft

COMP_T_001

COMP_T_001

COMP_T_002

COMP_T_002

COMP_T_003

COMP_T_003

COMP_X

Component X

COMP_Z

Z

CON_REQ_1

Requirement 1

CON_REQ_2

Requirement 2

CON_SPEC_1

Test spec

CON_SPEC_2

Test spec 2

copy_1

copy-example

open

copy_2

copy-example implementation

open

copy_3

test of specification and requirement

copy_4

test of current_need value

DELID123

Second Requirement Need

DELID124

Nested Need without delete option

df_1

my test requirement

open

EX_CARD_PROFILE

A specification with a picture

open

EX_CARD_SUMMARY

A requirement summarised on a card

open

EX_CLEAN

CLEAN layout

open

EX_CLEAN_L

CLEAN_L layout

open

EX_CLEAN_LP

CLEAN_LP layout

open

EX_CLEAN_R

CLEAN_R layout

open

EX_CLEAN_RP

CLEAN_RP layout

open

EX_COMPLETE

COMPLETE layout

open

EX_DEBUG

DEBUG layout

open

EX_FOCUS

FOCUS layout

open

EX_FOCUS_F

FOCUS_F layout

open

EX_FOCUS_L

FOCUS_L layout

open

EX_FOCUS_R

FOCUS_R layout

open

EX_REQ_1

A normal requirement

open

EX_REQ_2

A more complex and highlighted requirement

open

EX_REQ_3

A focused requirement

open

EX_REQ_4

A custom requirement with picture

open

EX_REQ_5

A requirement with a permalink

open

EX_ROW_1

Implemented spec

implemented

EX_ROW_2

Not implemented spec

open

EX_ROW_3

Spec under progress

in progress

EX_STYLE_BLUE

Blue background

EX_STYLE_BLUE_BAR

Blue bar

EX_STYLE_BLUE_BORDER

Blue border

EX_STYLE_CLEAN

Clean style

EX_STYLE_DISCREET

Discreet background

EX_STYLE_DISCREET_BORDER

Discreet border

EX_STYLE_DISCREET_COMBI

Discreet view

EX_STYLE_GREEN

Green background

EX_STYLE_GREEN_BAR

Green bar

EX_STYLE_GREEN_BORDER

Green border

EX_STYLE_ORANGE_BAR

Orange bar

EX_STYLE_RED

Red background

EX_STYLE_RED_BAR

Red bar

EX_STYLE_RED_BORDER

Red border

EX_STYLE_YELLOW

Yellow background

EX_STYLE_YELLOW_BAR

Yellow bar

EX_STYLE_YELLOW_BORDER

Yellow border

EX_STYLE_YELLOW_RED

Yellow background + Red border

EXAMPLE_1035

Error when building multiple latex documents

open

EXAMPLE_1044

Failed to sphinx-build HTML docs for 1.3.0 tag?

closed

EXAMPLE_141

A node can only be in one page, else it will be cut when generate latexpdf

closed

EXAMPLE_166

Fails to build PDF when 'req' directive contains nested directives

closed

EXAMPLE_436

I cannot build the examples from a clean environment

closed

EXAMPLE_796

NotImplementedError: <class 'sphinx.writers.latex.LaTeXTranslator'> departing unknown node type: NeedRef

closed

EXAMPLE_808

Duplicate labels in `.tex` output

open

EXAMPLE_902

Issue with sphinxneeds directives during latexpdf build

closed

EXAMPLE_STRING_LINKS

Use needs_string_links

EXT-FEATURE-A

Feature A

EXT-FEATURE-B

Feature B

done

EXT-REQ-1

Requirement 1

EXT-REQ-2

Requirement 2

extend_test_001

needextend Example 1

open

extend_test_002

needextend Example 2

open

extend_test_003

needextend Example 3

open

extend_test_004

needextend Example 4

open

extend_test_005

needextend Example 5

open

extend_test_006

needextend Example 6

open

extend_test_007

needextend Example 7

late

EXTRA_REQ_001

My requirement

EXTRA_TEST_001

Test of requirements

EXTRACT_FEATURE_1

A feature

F_F25D3

Level 1

FAIL_01

FEATURE_NEEDUML1

NeedUml example need

draft

ID123

User needs to login

open

IMAGE_EXAMPLE

My test spec

open

IMPL_01

Implementation for specification

impl_my_car_1

Build awesome car

INT_001

Test needuml save

INT_A

Interface A

JINJA1D8913

Need with jinja_content enabled

JINJAID123

First Req Need

JINJAID125

Nested Spec Need

open

JINJAID126

First Spec Need

open

LAYOUT_1

My layout requirement 1

LAYOUT_2

My layout requirement 2

LAYOUT_3

My layout requirement 3

LFF_REQ_1

Open requirement

open

→ LFF_REQ_1.p1

→ open part

open

LFF_REQ_2

Another open requirement

open

LFF_SPEC_1

Collector of open needs

open

LFF_SPEC_2

Collector of requirements and their parts

LFM_SPEC_1

login

LFM_SPEC_2

logout

LFM_TEST_1

Session tests

LIST2NEED-001

Feature 1

LIST2NEED-002

Feature 2

LIST2NEED-003

Feature 3

LIST2NEED-REQ-1

Requirement which shall get also need-parts

→ LIST2NEED-REQ-1.1

→ The first need-part

→ LIST2NEED-REQ-1.ANOTHER

→ ANOTHER need-part

MS_BUG_SOLVED

Bug solved

MS_TICKET_CLOSED

Solution ticket closed

my_car_1

Car must be awesome

open

→ my_car_1.1

→ A top speed of 300 km/h

open

→ my_car_1.2

→ An acceleration of 200 m/s² or much much more

open

→ my_car_1.awesome_3

→ a turbo button

open

NEED-002

Another Need example on level 1 with a given ID

NEED-A

Login user

NEED-B

Provide login screen

NEED-C

Create password hash

NEED-D

Recalculate hash and compare

OWN_ID_123

Specification of a requirement

R_17EB4

Set admin e-mail to admin@mycompany.com

R_22EB2

Requirement B

closed

R_262A1

Link example Source

R_2A9D0

Requirement A

open

R_316DE

Collapse is set to False

R_3C95C

Result 4

R_446C7

Group big short

R_50FCC

Level 1 need and more

R_53FBF

Level 1 need with rst

R_565A6

This is a requirement with a very long title that will need to be

R_6F47F

R_96D5E

Result 2

R_A2D07

Collapse is set to True

R_A6A4E

test requirement

R_BAFCF

The first sentence will be the title

R_D0791

Result 3

R_D8F29

This will be my title

R_EA5C4

Level 2

R_ERROR_LOGGING

R_F199E

Level 1 need with newlines

R_F1B63

Need example on level 1

R_F4722

My first requirement

open

R_F7DEB

Result 1

req_arch_001

Requirement arch

req_arch_002

Req Arch second

req_arch_003

Req Arch third

req_arch_004

Req Arch four

draft

req_flow_001

A requirement

REQ_LINK_1

Link example Target

roles_req_1

Sliced Bread

open

roles_req_2

Butter on Bread

S_01A67

Specification B

open

S_38199

And a complex sub-need on level 2 with an image-directive

S_3A83D

result 1: Positive check

progress

S_4137F

result 2: Negative check

S_69FFD

Another Sub-Need on level 2

S_6A582

And a spec need

S_78442

result 3: Positive check thanks of used filter

progress

S_951C8

result 5: Two checks and a joint status

progress closed

S_9ED38

result 4: Positive check thanks of one_hit option

progress

S_B4B62

Sub-Need on level 2 with status option set

open

S_CE0AA

Level 3

S_D70B0

Specification A

closed

SECURITY_REQ

SP_INT

Interfaces

open

spec_flow_001

A specification

→ spec_flow_001.subspec_1

→ A testable part of the specification

→ spec_flow_001.subspec_2

→ Another testable part of the specification

spec_flow_002

Another specification

spec_flow_003

A child specification

STYLE_001

My styled requirement

STYLE_002

Another styled requirement

STYLE_003

Green is my color

STYLE_004

Yellow and blue border

STYLE_005

My automatically styled requirement

implemented

STYLE_006

My automatically styled requirement

open

STYLE_EX_SERVICE

Order service

open

STYLE_EX_STORE

Order store

done

sum_input_1

Do this

sum_input_2

Do that

sum_input_3

Do too much

SYS_ROCKET

System RocketScience

T_001

Unit test 1

closed

T_002

Unit test 2

in progress

T_003

Unit test 3

open

T_004

Unit test 4

open

T_0F2B7

Level 4

T_5CCAA

Test 1

T_C3893

Test for XY

implemented

T_CAR

Our new car

T_CONNECT

Connectivity and Entertainment

T_DIST

Implement distant detection

T_EA5AF

Sub-Need on level 3

T_RADAR

Implement RADAR system

T_SAFE

Safety Features

table_001

Test need with need parts

→ table_001.1

→ Part 1 of requirement

→ table_001.2

→ Part 2 of requirement

→ table_001.3

→ Part 3 of requirement

table_002

Specifies part 1

table_003

Specifies part 2

TEMPL_POST_SPEC

My specification

TEMPL_PRE_SPEC

My specification

TEMPL_SPEC

My specification

open

test_001

test a requirement

test_arch_001

Test Arch

test_flow_001

A test case

test_req

test me

USER_A

Mr. A

USER_B

Ms. B

USER_C

Expert C

USER_D

Office Dog

VA_004

Variant options

disabled

xyz_123

My requirement with custom options

open

ID

Title

Status

Outgoing

ACT_ANALYSIS

Analysis issue

ACT_BARKS

Barks for support

ACT_BUG

Find & Report bug

ACT_BUG_ANALYSE

Analyse bug

ACT_CREATE_EX

Create example

ACT_CREATE_EX_C

Create example

ACT_CREATE_EX_EW

Create example

ACT_CREATE_EX_SA

Create example

ACT_CREATE_EX_SW

Create example

ACT_DEPLOY

Deploy release

ACT_INFORM

Informs reporter

ACT_ISSUE

Creates issue

ACT_READ_EX

Read example

ACT_READ_EX_C

Read example

ACT_READ_EX_EW

Read example

ACT_READ_EX_SA

Read example

ACT_READ_EX_SW

Read example

ACT_RELEASE_PLAN

Add solution to release plan

ACT_REVIEW

Reviews solution

ACT_SOLUTION

Provides solution

ACT_TEST

Test release

ACT_TICKET

Create solution ticket

ACT_TICKET_WORK

Work on solution ticket

ACT_UNDERSTAND_EX_SW

Understand example

basic_example

Basic need example

clv_A

Input A

in progress

clv_B

Input B

in progress

clv_C

Input C

closed

COMP_001

Component X

COMP_002

Component Y

COMP_A_B

Variant A or B

COMP_NEEDUML2

NeedUml example need 2

draft

COMP_T_001

COMP_T_001

COMP_T_002

COMP_T_002

COMP_T_003

COMP_T_003

COMP_X

Component X

COMP_Z

Z

CON_REQ_1

Requirement 1

CON_REQ_2

Requirement 2

CON_SPEC_1

Test spec

CON_SPEC_2

Test spec 2

copy_1

copy-example

open

copy_2

copy-example implementation

open

copy_3

test of specification and requirement

copy_4

test of current_need value

DELID123

Second Requirement Need

DELID124

Nested Need without delete option

df_1

my test requirement

open

EX_CARD_PROFILE

A specification with a picture

open

EX_CARD_SUMMARY

A requirement summarised on a card

open

EX_CLEAN

CLEAN layout

open

EX_CLEAN_L

CLEAN_L layout

open

EX_CLEAN_LP

CLEAN_LP layout

open

EX_CLEAN_R

CLEAN_R layout

open

EX_CLEAN_RP

CLEAN_RP layout

open

EX_COMPLETE

COMPLETE layout

open

EX_DEBUG

DEBUG layout

open

EX_FOCUS

FOCUS layout

open

EX_FOCUS_F

FOCUS_F layout

open

EX_FOCUS_L

FOCUS_L layout

open

EX_FOCUS_R

FOCUS_R layout

open

EX_REQ_1

A normal requirement

open

EX_REQ_2

A more complex and highlighted requirement

open

EX_REQ_3

A focused requirement

open

EX_REQ_4

A custom requirement with picture

open

EX_REQ_5

A requirement with a permalink

open

EX_ROW_1

Implemented spec

implemented

EX_ROW_2

Not implemented spec

open

EX_ROW_3

Spec under progress

in progress

EX_STYLE_BLUE

Blue background

EX_STYLE_BLUE_BAR

Blue bar

EX_STYLE_BLUE_BORDER

Blue border

EX_STYLE_CLEAN

Clean style

EX_STYLE_DISCREET

Discreet background

EX_STYLE_DISCREET_BORDER

Discreet border

EX_STYLE_DISCREET_COMBI

Discreet view

EX_STYLE_GREEN

Green background

EX_STYLE_GREEN_BAR

Green bar

EX_STYLE_GREEN_BORDER

Green border

EX_STYLE_ORANGE_BAR

Orange bar

EX_STYLE_RED

Red background

EX_STYLE_RED_BAR

Red bar

EX_STYLE_RED_BORDER

Red border

EX_STYLE_YELLOW

Yellow background

EX_STYLE_YELLOW_BAR

Yellow bar

EX_STYLE_YELLOW_BORDER

Yellow border

EX_STYLE_YELLOW_RED

Yellow background + Red border

EXAMPLE_1035

Error when building multiple latex documents

open

EXAMPLE_1044

Failed to sphinx-build HTML docs for 1.3.0 tag?

closed

EXAMPLE_141

A node can only be in one page, else it will be cut when generate latexpdf

closed

EXAMPLE_166

Fails to build PDF when 'req' directive contains nested directives

closed

EXAMPLE_436

I cannot build the examples from a clean environment

closed

EXAMPLE_796

NotImplementedError: <class 'sphinx.writers.latex.LaTeXTranslator'> departing unknown node type: NeedRef

closed

EXAMPLE_808

Duplicate labels in `.tex` output

open

EXAMPLE_902

Issue with sphinxneeds directives during latexpdf build

closed

EXAMPLE_STRING_LINKS

Use needs_string_links

EXT-FEATURE-A

Feature A

EXT-FEATURE-B

Feature B

done

EXT-REQ-1

Requirement 1

EXT-REQ-2

Requirement 2

extend_test_001

needextend Example 1

open

extend_test_002

needextend Example 2

open

extend_test_003

needextend Example 3

open

extend_test_004

needextend Example 4

open

extend_test_005

needextend Example 5

open

extend_test_006

needextend Example 6

open

extend_test_007

needextend Example 7

late

EXTRA_REQ_001

My requirement

EXTRA_TEST_001

Test of requirements

EXTRACT_FEATURE_1

A feature

F_F25D3

Level 1

FAIL_01

FEATURE_NEEDUML1

NeedUml example need

draft

ID123

User needs to login

open

IMAGE_EXAMPLE

My test spec

open

IMPL_01

Implementation for specification

impl_my_car_1

Build awesome car

INT_001

Test needuml save

INT_A

Interface A

JINJA1D8913

Need with jinja_content enabled

JINJAID123

First Req Need

JINJAID125

Nested Spec Need

open

JINJAID126

First Spec Need

open

LAYOUT_1

My layout requirement 1

LAYOUT_2

My layout requirement 2

LAYOUT_3

My layout requirement 3

LFF_REQ_1

Open requirement

open

→ LFF_REQ_1.p1

→ open part

open

LFF_REQ_2

Another open requirement

open

LFF_SPEC_1

Collector of open needs

open

LFF_SPEC_2

Collector of requirements and their parts

LFM_SPEC_1

login

LFM_SPEC_2

logout

LFM_TEST_1

Session tests

LIST2NEED-001

Feature 1

LIST2NEED-002

Feature 2

LIST2NEED-003

Feature 3

LIST2NEED-REQ-1

Requirement which shall get also need-parts

→ LIST2NEED-REQ-1.1

→ The first need-part

→ LIST2NEED-REQ-1.ANOTHER

→ ANOTHER need-part

MS_BUG_SOLVED

Bug solved

MS_TICKET_CLOSED

Solution ticket closed

my_car_1

Car must be awesome

open

→ my_car_1.1

→ A top speed of 300 km/h

open

→ my_car_1.2

→ An acceleration of 200 m/s² or much much more

open

→ my_car_1.awesome_3

→ a turbo button

open

NEED-002

Another Need example on level 1 with a given ID

NEED-A

Login user

NEED-B

Provide login screen

NEED-C

Create password hash

NEED-D

Recalculate hash and compare

OWN_ID_123

Specification of a requirement

R_17EB4

Set admin e-mail to admin@mycompany.com

R_22EB2

Requirement B

closed

R_262A1

Link example Source

R_2A9D0

Requirement A

open

R_316DE

Collapse is set to False

R_3C95C

Result 4

R_446C7

Group big short

R_50FCC

Level 1 need and more

R_53FBF

Level 1 need with rst

R_565A6

This is a requirement with a very long title that will need to be

R_6F47F

R_96D5E

Result 2

R_A2D07

Collapse is set to True

R_A6A4E

test requirement

R_BAFCF

The first sentence will be the title

R_D0791

Result 3

R_D8F29

This will be my title

R_EA5C4

Level 2

R_ERROR_LOGGING

R_F199E

Level 1 need with newlines

R_F1B63

Need example on level 1

R_F4722

My first requirement

open

R_F7DEB

Result 1

req_arch_001

Requirement arch

req_arch_002

Req Arch second

req_arch_003

Req Arch third

req_arch_004

Req Arch four

draft

req_flow_001

A requirement

REQ_LINK_1

Link example Target

roles_req_1

Sliced Bread

open

roles_req_2

Butter on Bread

S_01A67

Specification B

open

S_38199

And a complex sub-need on level 2 with an image-directive

S_3A83D

result 1: Positive check

progress

S_4137F

result 2: Negative check

S_69FFD

Another Sub-Need on level 2

S_6A582

And a spec need

S_78442

result 3: Positive check thanks of used filter

progress

S_951C8

result 5: Two checks and a joint status

progress closed

S_9ED38

result 4: Positive check thanks of one_hit option

progress

S_B4B62

Sub-Need on level 2 with status option set

open

S_CE0AA

Level 3

S_D70B0

Specification A

closed

SECURITY_REQ

SP_INT

Interfaces

open

spec_flow_001

A specification

→ spec_flow_001.subspec_1

→ A testable part of the specification

→ spec_flow_001.subspec_2

→ Another testable part of the specification

spec_flow_002

Another specification

spec_flow_003

A child specification

STYLE_001

My styled requirement

STYLE_002

Another styled requirement

STYLE_003

Green is my color

STYLE_004

Yellow and blue border

STYLE_005

My automatically styled requirement

implemented

STYLE_006

My automatically styled requirement

open

STYLE_EX_SERVICE

Order service

open

STYLE_EX_STORE

Order store

done

sum_input_1

Do this

sum_input_2

Do that

sum_input_3

Do too much

SYS_ROCKET

System RocketScience

T_001

Unit test 1

closed

T_002

Unit test 2

in progress

T_003

Unit test 3

open

T_004

Unit test 4

open

T_0F2B7

Level 4

T_5CCAA

Test 1

T_C3893

Test for XY

implemented

T_CAR

Our new car

T_CONNECT

Connectivity and Entertainment

T_DIST

Implement distant detection

T_EA5AF

Sub-Need on level 3

T_RADAR

Implement RADAR system

T_SAFE

Safety Features

table_001

Test need with need parts

→ table_001.1

→ Part 1 of requirement

→ table_001.2

→ Part 2 of requirement

→ table_001.3

→ Part 3 of requirement

table_002

Specifies part 1

table_003

Specifies part 2

TEMPL_POST_SPEC

My specification

TEMPL_PRE_SPEC

My specification

TEMPL_SPEC

My specification

open

test_001

test a requirement

test_arch_001

Test Arch

test_flow_001

A test case

test_req

test me

USER_A

Mr. A

USER_B

Ms. B

USER_C

Expert C

USER_D

Office Dog

VA_004

Variant options

disabled

xyz_123

My requirement with custom options

open

show_parts

Added in version 0.3.6.

Adds an extra table row for each need_part / np found inside a filtered need.

It adds the part rows directly under the related need’s row, and their id and title get a prefix. Each part is listed once: a part the filter matches is listed under its need when its need is a row, and has a row of its own only when its need is not one.

To change the prefix please read needs_part_prefix.

Example 9

.. needtable::
   :tags: test_table
   :filter: is_need
   :show_parts:
   :columns: id;title;outgoing;incoming
   :style: table

ID

Title

Outgoing

Incoming

table_001

Test need with need parts

→ table_001.1

→ Part 1 of requirement

→ table_001.2

→ Part 2 of requirement

→ table_001.3

→ Part 3 of requirement

table_002

Specifies part 1

table_003

Specifies part 2

Show above example’s configuration

Example 10

.. req:: Test need with need parts
   :id: table_001
   :tags: test_table

   :np:`(1) Part 1 of requirement`.

   :np:`(2) Part 2 of requirement`.

   :np:`(3) Part 3 of requirement`.

.. spec:: Specifies part 1
   :id: table_002
   :tags: test_table
   :links: table_001.1

.. spec:: Specifies part 2
   :id: table_003
   :tags: test_table
   :links: table_001.2
Requirement: Test need with need parts table_001
tags: test_table
links incoming: table_002, table_003

Part 1 of requirement 1.

Part 2 of requirement 2.

Part 3 of requirement 3.

Specification: Specifies part 1 table_002
tags: test_table
links outgoing: table_001.1
Specification: Specifies part 2 table_003
tags: test_table
links outgoing: table_001.2

style_row

Added in version 0.4.1.

You can use the style_row option to set a specific class-attribute for the table-row representation and use CSS to select the class-attribute

Also, you can set specific layout for the row.

Example 11

.. needtable::
   :tags: ex_row_color
   :style_row: needs_blue_border

ID

Title

Status

Outgoing

EX_ROW_1

Implemented spec

implemented

EX_ROW_2

Not implemented spec

open

EX_ROW_3

Spec under progress

in progress

Row style based on specific need value

You can use Dynamic functions to derive the value for style_row based on a specific value of the documented need in the row.

Example 12

.. needtable::
   :tags: ex_row_color
   :columns: id, title, status
   :style_row: needs_[[copy("status")]]

ID

Title

Status

EX_ROW_1

Implemented spec

implemented

EX_ROW_2

Not implemented spec

open

EX_ROW_3

Spec under progress

in progress

In this example we set style_row to needs_[[copy("status")]], so the status of each need will be part of the row style.

Note

If style_row contains whitespaces, they get automatically replaced by _ to get a valid css class name.

So a copied status value like in progress will become in_progress.

Show used configuration

needtable

.. needtable::
   :tags: ex_row_color
   :columns: id, title, status
   :style_row: needs_[[copy("status")]]

needs as input

Requirement: Implemented spec EX_ROW_1
status: implemented
tags: ex_row_color
Requirement: Not implemented spec EX_ROW_2
status: open
tags: ex_row_color
Requirement: Spec under progress EX_ROW_3
status: in progress
tags: ex_row_color

inside a provided css file

tr.needs_implemented {
 background-color: palegreen !important;
}

tr.needs_open {
    background-color: palevioletred !important;
}

tr.needs_in_progress {
    background-color: palegoldenrod !important;
}

/* This sets values for the status column */
tr.needs_in_progress td.needs_status p {
    background-color: #1b6082;
    padding: 3px 5px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid #212174;
    color: #ffffff;
}

sort

Added in version 0.4.3.

Option to sort the filtered-results based on a key.

The sort-value must be compatible with the options supported by the Filter string. A key that is not a field of the needs is reported as a needs.filter warning, and the rows are left in the order the filter returned them.

By default, we use id_complete if we don’t set a sort option.

A need whose value is unset (None) comes first, whatever the field’s type, as one with an empty string does. This is the case for every need of a type that does not declare a field declared on need types alone (see needs_types). The other values are grouped, so that values of different types are never compared: booleans, then numbers, then text. Text is compared without regard to case; a list is compared as its values joined with ", ", and any other value as its text. Needs with equal values are ordered by id.

Changed in version 9.1.0: An unset value comes first, and equal values are ordered by id. Before, sorting by a field some needs leave unset stopped the build ('<' not supported between instances of 'NoneType' and 'int'), as did an unknown key; a list was compared item by item, with regard to case; and equal values kept the needs’ own order, which could differ between a fresh and an incremental build.

Example 13

.. needtable::
   :tags: ex_row_color
   :style: table

ID

Title

Status

Outgoing

EX_ROW_1

Implemented spec

implemented

EX_ROW_2

Not implemented spec

open

EX_ROW_3

Spec under progress

in progress

In this case, we set the sort option to status. So EX_ROW_3 is above of EX_ROW_2.

Example 14

.. needtable::
   :tags: ex_row_color
   :style: table
   :sort: status

ID

Title

Status

Outgoing

EX_ROW_1

Implemented spec

implemented

EX_ROW_3

Spec under progress

in progress

EX_ROW_2

Not implemented spec

open

Show used configuration
.. needtable::
   :tags: ex_row_color
   :style: table

.. needtable::
   :tags: ex_row_color
   :style: table
   :sort: status

Note

:sort: decides the order of the rows in both styles. With style datatables it is the order the reader first sees, and the one a third click on a column header goes back to; the two clicks in between sort that column ascending and descending.

Changed in version 9.0.0: Before this change the bundled DataTables package re-sorted every table by its first column as soon as the page loaded, so :sort: was only visible with :style: table.

Note

When the reader sorts a column of the interactive table, two rules decide the order. A number is read with the full stop as its decimal mark; a comma groups digits only in the 1,234,567 shape and is a decimal mark otherwise, and a per-cent sign and any whitespace are ignored – so 1.000 sorts as one. A date written as YYYY-MM-DD is read as UTC; any other spelling is read in the reader’s own timezone, so two spellings of the same day can order differently. Cells with no value sort last, whichever way the column points.

class

Added in version 0.7.4.

You can set additional class-names for a needtable using the class option. Mostly used for HTML output. It supports comma separated values and will add classes to the already set classes by Sphinx-Needs.

custom.css
 table.class_red_border {
     border: 3px solid red;
 }

Example 15

.. needtable::
   :tags: test
   :columns: id,title,status
   :style: table
   :class: class_red_border

ID

Title

Status

df_1

my test requirement

open

R_F4722

My first requirement

open

T_C3893

Test for XY

implemented

max_items

Added in version 8.4.0.

The maximum number of needs to show.

We apply the limit after filtering and after the sort, so the table keeps the first rows it would otherwise have shown, and tells the reader how many needs it is hiding. A truncated view says so in the page and emits a needs.max_items warning, so that a build does not have to be read page by page to find it; a project that caps deliberately can silence the warning with suppress_warnings = ["needs.max_items"].

The limit counts the entries the filter returned, which are needs, and need parts alike where the filter tests them (needs_views_include_parts); with show_parts, a part listed under its need is not an entry of its own. A table that sets show_parts can therefore render more rows than the limit, since the part rows of a kept need are all still expanded.

:max_items: 0 means no limit, also for a project that sets needs_views_max_items. Without the option, the table shows as many needs as that configuration allows.

Example 16

.. needtable::
   :tags: flow_example
   :style: table
   :sort: id
   :max_items: 2

ID

Title

Status

Outgoing

req_flow_001

A requirement

spec_flow_001

A specification

Showing the first 2 of 7 needs; refine the filter or set :max_items: (0 for all).

page_size

Added in version 9.0.0.

How many rows a page of the interactive table holds, for this table alone. Overrides needs_table_page_size, and must be a positive whole number; anything else is reported as a needs.directive warning and ignored.

A need and its parts count as one row here, so that a page never splits a need from its parts. The option has no effect on :style: table.

Example 17

.. needtable::
   :tags: flow_example
   :sort: id
   :page_size: 2

ID

Title

Status

Outgoing

req_flow_001

A requirement

spec_flow_001

A specification

spec_flow_002

Another specification

spec_flow_003

A child specification

→ spec_flow_001.subspec_1

→ A testable part of the specification

→ spec_flow_001.subspec_2

→ Another testable part of the specification

test_flow_001

A test case

common filters