Skip to content

Commit

Permalink
Fixed extra links example (#1016)
Browse files Browse the repository at this point in the history
## PR description
This PR fixes [extra links field
example](https://sphinx-needs.readthedocs.io/en/latest/directives/need.html#extra-links)
in the docs.

## Why is it needed?
Documentation describing [need/req's extra
links](https://sphinx-needs.readthedocs.io/en/latest/directives/need.html#extra-links)
has an incorrect example - `outgoing` dictionary entry is missing:

```
# conf.py
needs_extra_links = [
   {
      "option": "blocks",
      "incoming": "is blocked by",
   },
   {
      "option": "tests",
      "incoming": "is tested by",
      "copy": False,
      "color": "#00AA00"
   }
]
```

When used it causes this error:
```
Extension error (sphinx_needs.directives.need):
Handler <function process_need_nodes at 0x7f5d5123e9e0> for event 'doctree-resolved' threw an exception (exception: 'outgoing')
```
Documentation of `needs_extra_links`
([here](https://sphinx-needs.readthedocs.io/en/latest/configuration.html#needs-extra-links))
states that the `outgoing` field is necessary and the example above is
unnecessarily misleading.
  • Loading branch information
piotr-zyskowski-rai committed Sep 10, 2023
1 parent 795ca19 commit a0ba9b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/directives/need.rst
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,12 @@ By using :ref:`needs_extra_links <needs_extra_links>`, you can use the configure
{
"option": "blocks",
"incoming": "is blocked by",
"outgoing": "blocks"
},
{
"option": "tests",
"incoming": "is tested by",
"outgoing": "tests",
"copy": False,
"color": "#00AA00"
}
Expand Down

0 comments on commit a0ba9b4

Please sign in to comment.