Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Duplicate implicit target name": how to use a subtitle name more than once?

How do I use the same subsection title in multiple sections of sphinx/rst?

I didn't think this was an odd use case. I just want to iterate through the same subsection titles for each section.

############
TITLE OF ALL
############

-------
CHAPTER
-------

SENARIO ONE
===========

Description
-----------

SENARIO TWO
===========

Description
-----------

Generates this error:

design_spec.rst:19: (INFO/1) Duplicate implicit target name: "description"

Surely I'm not expected to come up with unique subsection titles throughout the whole document. What did I miss?

It's complaining about the implicit target name generated by the titles not being unique. What can I do about that?

like image 812
John Mee Avatar asked Sep 27 '16 06:09

John Mee


1 Answers

You can avoid the info if you define an explicit target name for the second (and third ...) section "Description" like this:

...

Description
-----------

SENARIO TWO
===========

.. _description2:

Description
-----------

...

This additionally gives you the benefit of having a known anchor if you want to jump there (like mypage#description2).

Don't miss the blank line between _description and the following section title.

like image 151
Humbalan Avatar answered Oct 16 '22 08:10

Humbalan