Skip to content

Commit

Permalink
👌 Improve warning for needextract incompatibility with external needs (…
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Oct 10, 2024
1 parent fa2f32c commit 067009e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sphinx_needs/directives/needextract.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,11 @@ def _build_needextract(
env = app.env

if (need_node := SphinxNeedsData(env).get_need_node(need_data["id"])) is None:
log_warning(
LOGGER,
f"Content for requested need {need_data['id']!r} not found.",
"needextract",
location=extract_node,
)
if need_data["is_external"]:
message = f"External needs cannot be used as targets by needextract (ID {need_data['id']!r})."
else:
message = f"Content for requested need {need_data['id']!r} not found."
log_warning(LOGGER, message, "needextract", location=extract_node)
return None

dummy_need = nodes.container()
Expand Down

0 comments on commit 067009e

Please sign in to comment.