Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Chris G <cl <at> isbd.net>
Subject: Re: How to avoid "Duplicate explicit target name" in this situation?
Newsgroups: gmane.text.docutils.user
Date: Friday 8th February 2008 15:47:03 UTC (over 9 years ago)
On Fri, Feb 08, 2008 at 10:34:46AM -0500, David Goodger wrote:
> >
> > As a result I get two errors like:-
> >
> >     System Message: WARNING/2 (); backlink
> >     Duplicate explicit target name: "1946".
> 
> That's because "`name `_" is equivalent to
> 
>     name_
> 
>     .. _name: url
> 
> If you repeat "`name `_" (same or different URL), you're
> effectively declaring the "name" target multiple times.
> 
OK.


> > Am I missing something obvious or is it not possible to have two links
> > from different places in a reStructuredText document which happen
> > to appear as the same piece of text?
> 
> It's certainly possible:
> 
>     `name `_ and name_ point to the same place.
> 
> Notice that the second time, I didn't include the target definition,
> just the reference.
> 
Ah, thank you, that actually works pretty well as the names used in
the sidebar are pretty obvious and simple so although I can't "see"
them I can still use them.

I suppose it does raise the question of what happens if I change the
sidebar generating code though.


> Another option is:
> 
>     `name `__ and `name `__ still point to the same place.
> 
> This time I used anonymous targets (two underscores), so the target
> "name" wasn't remembered. This might be ideal for you, especially in
> the auto-generated portion of your pages. You can have as many
> anonymous targets as you like, but only one named target of each name.

This is probably the way to go for me as it will be more transparent
for the main manually generated pages.

Thanks for the helpful (and easy to understand) reply!

-- 
Chris Green

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
 
CD: 3ms