Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: Generate several latex documents #1208

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ Christian Wappler <[email protected]>
Chris Sewell <[email protected]>

Simon Leiner <[email protected]>

Pierre Fournier <[email protected]>
18 changes: 11 additions & 7 deletions sphinx_needs/roles/need_incoming.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def process_need_incoming(
for index, back_link in enumerate(links_back):
# If need back_link target exists, let's create the reference
if back_link in all_needs:
target_need = all_needs[back_link]
try:
target_need = all_needs[back_link]
if needs_config.show_link_title:
link_text = f'{target_need["title"]}'

Expand Down Expand Up @@ -82,13 +82,17 @@ def process_need_incoming(

node_link_container += new_node_ref

# If we have several links, we add an empty text between them
if index + 1 < len(links_back):
node_link_container += nodes.Text(", ")

except NoUri:
# If the given need id can not be found, we must pass here....
pass
# If the given need id can not be found,
# we make an emphasis to still show the need id
# This allows to show traceability in cross documents cases.
node_link_container += nodes.emphasis(
target_need["id"], target_need["id"]
)

# If we have several links, we add an empty text between them
if index + 1 < len(links_back):
node_link_container += nodes.Text(", ")

else:
logger.warning(
Expand Down
10 changes: 7 additions & 3 deletions sphinx_needs/roles/need_outgoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def process_need_outgoing(
and need_id_main in needs_all_needs
and need_id_part in needs_all_needs[need_id_main]["parts"]
):
target_need = needs_all_needs[need_id_main]
try:
target_need = needs_all_needs[need_id_main]
if need_id_part and need_id_part in target_need["parts"]:
part_content = target_need["parts"][need_id_part]["content"]
target_title = (
Expand Down Expand Up @@ -107,8 +107,12 @@ def process_need_outgoing(
node_link_container += new_node_ref

except NoUri:
# If the given need id can not be found, we must pass here....
pass
# If the given need id can not be found,
# we make an emphasis to still show the need id
# This allows to show traceability in cross documents cases.
node_link_container += nodes.emphasis(
target_need["id"], target_need["id"]
)

else:
# Let's add a normal text here instead of a link.
Expand Down
3 changes: 2 additions & 1 deletion sphinx_needs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from sphinx_needs.config import LinkOptionsType, NeedsSphinxConfig
from sphinx_needs.data import NeedsInfoType, SphinxNeedsData
from sphinx_needs.defaults import NEEDS_PROFILING
from sphinx_needs.errors import NoUri
from sphinx_needs.logging import get_logger

try:
Expand Down Expand Up @@ -195,7 +196,7 @@ def row_col_maker(
if link_part:
ref_col["refuri"] += "." + link_part

except KeyError:
except (KeyError, NoUri):
para_col += text_col
else:
ref_col.append(text_col)
Expand Down