needservice

Added in version 0.6.0.

needservice allows the import of data from external services like GitHub, for example:

.. needservice:: <service>
   :option: ...
   :status: open
   :tags: awesome, nice
   :author: me

   Extra content for each new need

In most cases, the service fetches requested data from an external server and creates a need object for each found data-element in the returned data.

These need objects can then be used and referenced as all other need objects, e.g. by filtering them via needtable.

Hint

For details about available services and their specific configuration please take a look into Services.

Options

Each service can define custom options which may be needed for the service to work correctly. Please take a look into the related service documentation to find out what is needed.

Hint

needservice supports all options available for the need items directive and all custom options defined by needs_extra_options.

For services provided by Sphinx-Needs please take a look into Services.

debug

Set debug to get debug-output of the needservice only. No needs will be created.

Useful to understand the return values of services or to figure out, why a connection can not be established, for example:

.. needservice:: <service>
   :debug:

Content

The content of needservice is used as content for all created need objects.

A service may deviate from this behavior and define its own usage. For example, by awaiting a json-string with a more complex configuration or by just ignoring the content.

Please take a look into the related service documentation for more information.

GitHub Issues Example

This example is using the github-issues service. For details, please take a look into its specific documentation under GitHub services.

The service queries GitHub for issues in the Sphinx-Needs repository that have node and latexpdf in their content.

Tip

Click the small arrow under the need id to see all meta data.

Example 1

.. needservice:: github-issues
   :query: repo:useblocks/sphinx-needs node latexpdf
   :max_content_lines: 4
   :id_prefix: EXAMPLE_
Issue with sphinxneeds directives during latexpdf build (url)
../_images/129397637.png
DirkBodenschatz
user: DirkBodenschatz
created_at: 2023-03-30T12:55:00Z
updated_at: 2023-04-06T21:08:44Z
closed_at: None
service: github-issues
url: Link
type: Issue
status: open
latexpdf build leads to an exception if I use `..
needextract::` is used. The same happens also if `..
needtable::` is used


[...]
Fails to build PDF when 'req' directive contains nested directives (url)
../_images/33452915.png
danieleades
user: danieleades
created_at: 2021-01-08T12:51:32Z
updated_at: 2021-10-20T04:46:28Z
closed_at: None
service: github-issues
url: Link
type: Issue
status: open
I'm finding that while I can build HTML output (`make html`)
the build fails with an extension error when using the PDF
target (`make latexpdf`)


[...]
Duplicate labels in `.tex` output (url)
../_images/18471563.png
tim-nordell-nimbelink
user: tim-nordell-nimbelink
created_at: 2022-11-21T21:32:42Z
updated_at: 2022-12-07T18:39:51Z
closed_at: None
service: github-issues
url: Link
type: Issue
status: open
When building the LaTeX files, it complains about duplicate
labels.  I've created a test case against this over here:
https://github.com/tim-nordell-nimbelink/sphinx-
needs/tree/test_for_duplicate_label.  (No fix currently.)

[...]
Failed to sphinx-build HTML docs for 1.3.0 tag? (url)
../_images/71438617.png
hwhsu1231
user: hwhsu1231
created_at: 2023-10-10T04:48:25Z
updated_at: 2024-02-28T06:19:05Z
closed_at: 2024-02-28T06:19:05Z
service: github-issues
url: Link
type: Issue
status: closed
### Problem Description

Recently, I tried to build sphinx-needs's HTML documentation
locally. However, it failed.

[...]
NotImplementedError: <class 'sphinx.writers.latex.LaTeXTranslator'> departing unknown node type: NeedRef (url)
../_images/72132223.png
Pierre-Gronau-ndaal
user: Pierre-Gronau-ndaal
created_at: 2022-11-17T13:20:55Z
updated_at: 2022-12-14T08:42:26Z
closed_at: 2022-11-21T20:10:18Z
service: github-issues
url: Link
type: Issue
status: closed
Exception occurred:

  File "/usr/local/lib/python3.10/site-
packages/docutils/nodes.py", line 2040, in unknown_departure

[...]
I cannot build the examples from a clean environment (url)
../_images/95444300.png
PhilipPartsch
user: PhilipPartsch
created_at: 2021-12-02T20:10:25Z
updated_at: 2021-12-09T07:20:48Z
closed_at: 2021-12-09T07:20:48Z
service: github-issues
url: Link
type: Issue
status: closed
Hi,

I try to build one of the examples with a new PC.


[...]
A node can only be in one page, else it will be cut when generate latexpdf (url)
../_images/62423175.png
sophiali2008
user: sophiali2008
created_at: 2020-03-24T08:30:43Z
updated_at: 2021-05-07T11:53:02Z
closed_at: 2021-05-07T11:52:34Z
service: github-issues
url: Link
type: Issue
status: closed
tags: bug, help wanted, no_fix
Hello,

I used the extension needs 0.5.3 in my project, it is
perfectly fit in html.

[...]