0

I have a package documented on ReadTheDocs. I want to include the release notes for the newest release of my software both on the landing page and the dedicated release notes page (with the older versions’ notes)

Therefore I have my release-new.rst:

Version 0.7.4
=============
…

Version 0.7.3
=============
…

and .. include:: it both in index.rst and release-notes.rst.

The problem arises when I want to add reference targets:

.. _v0.7.4:

Version 0.7.4
=============
…

The code for this target obviously gets included in both files, which means that docutils correctly complains about a duplicate reference target.

How can I include the file twice, but only have the reference targets in one of the documents? Is there a custom include directive alternative or a different way to define my reference?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
flying sheep
  • 8,475
  • 5
  • 56
  • 73
  • There is no such feature. IMO this is a misuse of the purpose of an index. Nonetheless, if you must misuse it, then you can break your release-new.rst into several includes (`v0.7.4.rst`) and maintain two sets of unique targets followed by the include call, e.g., ``.. _index-v0.7.4:\n\n.. include:: v0.7.4` and ``.. _release-notes-v0.7.4:\n\n.. include:: v0.7.4`. – Steve Piercy Aug 15 '20 at 04:17
  • How is this a misuse? The main page version would simply display the information without being in the index. – flying sheep Aug 15 '20 at 07:21
  • Look up the definition of "index". – Steve Piercy Aug 16 '20 at 02:17

0 Answers0