I'm trying to find a way to make the labels I give my sections to be used 
instead of the anchor names that Sphinx automatically gives to sections and 
uses in the TOC.

For example, if I write some reST:

.._my-label:

My Section
==========

Some text

sphinx gives me HTML that looks like:

<div class="section" id="my-section">
<span id="my-label"></span>
<h1>
  "My Section"
  <a class="headerlink" href="#my-section" title="Permalink to this 
headline">ΒΆ</a>
</h1>

The net effect is that there are now two possible ways to link to this 
section, via `#my-label` and the auto-link `#my-section`.

I'd prefer the `#my-label` anchor since it's independent of any editing to 
the section title. (And yet the other style is the one that Sphinx 
encourages users to permalink to).

Ideally I'd like to have it so that whenever I give a section an explicit 
label, Sphinx will use my explicit link.

Is there are way to achieve this out-of-the-box with a Sphinx 
configuration? Or can I do it with a Sphinx extension that plugs into the 
HTML build process? If it's the former, I'd love for an expert to point me 
broadly to the build step that I should probably hook into.

Thanks,
Jonathan Sick

Software Developer
Large Synoptic Survey Telescope
github.com/jonathansick

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to