Skip to content

need_incoming / need_outgoing/ need_part misuse sphinx reference role #1437

Open
@chrisjsewell

Description

@chrisjsewell

The anatomy of a reference role is that

  • By default, the title == target, e.g. :name:`target`
  • The title can be separated from the title using <>, e.g. :name:`title <target>`
  • The reference can be disabled if the content starts with !, e.g. :name:`!target` or :name:`!title <target>`
  • The < or ! can be escaped with \, e.g. :name:`title \<target>` or :name:`\!target`

Firstly, it is of note that for all need / need_incoming / need_outgoing/ need_part, they are set as sphinx.XRefRole.

For all of these, the disabling of the role with ! works, i.e. a reference/part is not created for these.
It is not clear if this is even intended, nor is it documented.

For the title/target syntax, the need role works as expected.
For need_incoming / need_outgoing/ need_part, though this syntax is parsed, it is not used in an understandable way:
e.g. for :name:`title <target>`,

  • for need_incoming / need_outgoing only the target is used and the title is disregarded
  • for need_part only the title is used and the target is disregarded

Additionally, need_part, splits up id/content like (id) content, but does not account for space in between the ) and start of content


also there is no warning if need_part is not in a need directive, they are just silently ignored

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions