0

What's the difference between a target and a reference in reStructured Text?

I'm trying to understand the reST spec and how hyperlinks work in sphinx, which is surprisingly non-intuitive.

Unfortunately, the documentation just says "to be completed" for the target and reference elements:

What's the difference between target and reference elements in .rst files.

(Bonus: why isn't the above documentation complete? Are these elements new to reStructuredText?)

Michael Altfield
  • 2,083
  • 23
  • 39
  • 1
    `target` and `reference` are not keywords that occur in RST files. They are XML elements in the Docutils data structure (the "document tree"). – mzjn Jul 27 '20 at 08:30
  • 3
    See https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#hyperlink-targets and https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#hyperlink-references. In basic terms, a target is where the browser ends up after clicking a reference link. – Steve Piercy Jul 27 '20 at 08:59

0 Answers0