On 2016-02-15, Oleksandr Gavenko wrote:
> With text:
> I expect that TOC points to book.html#sec-xxx, but instead it refer to
> book.html#section-level-1:
The manually set anchor/target/id is always applied to the *following*
element. If you write::
.. contents::
.. _sec-xxx:
Section level 1
===============
.. _par-xxx:
This is a paragraph.
you will get a section heading that can be linked to with both names:
...
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#section-level-1" id="id1">Section level 1</a></li>
</ul>
</div>
<div class="section" id="section-level-1">
<span id="sec-xxx"></span><h1><a class="toc-backref" href="#id1">Section level 1</a></h1>
<p id="par-xxx">This is a paragraph.</p>
</div>
</div>
...
> I use Cyrillic RST texts and ``rst2html`` doesn't generate meaningful hashes
> as "section-level-1" is.
There is a TODO item to use a latin transliteration for non-ASCII
characters...
Günter
|