Re: Link bookmark

Guenter Milde <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
On 2016-04-19, Sergio wrote:
> Sergio <sergio.am.spina <at> gmail.com> writes:


>> I would know what is the way to implement in ReST an internal link bookmark
>> like in the <a> tag in this example:


>     # file: test.htm

>     <html>
>     <body>

>     <p>This text stand for an example of text containing
>     a <a name="B3Pa9-5ZRIx-1">bookmarked target</a> bookmark.</p>

>     <p>So let's go all together to visit the bookmarked target
>     clicking on <a href="#B3Pa9-5ZRIx-1">this link</a>.</p>

>     </body>
>     </html>

...

> Is there a better way ?

This depends on what is the important part of your task and what can be
changed to match the way Docutils structures things.

Do you want convert HTML documents to rST or write rST?


AFAI can see, there is no way to have an *inline* anchor with specified but
invisible name or id (except for a raw HTML role).


The following alternatives exist.

This text stand for an example of text containig
a _`target` bookmark. An inline target must be
uniquely named and mapped to the desired
non-visible string in a separate step.

.. _B3Pa9-5ZRIx-1: target_


.. _B3Pa9-5ZRIx-2:

This paragraph is given the 
id "b3pa9-5zrix-2" (see name conversions).
From the same document, it can be reached under the given spelling.
From other documents, ist is reaced as ``<filename>#b3pa9-5zrix-2``


So let's go all together to visit the targets clicking on 
`this link <B3PA9-5ZRIX-1_>`__ 
or `this link <B3PA9-5ZRIX-2_>`__.

Alternative syntax: visit the targets clicking on 
`this link`__  or `this link`__.

__ B3PA9-5ZRIX-1_
__ B3PA9-5ZRIX-2_


Next alternative: link to of the `tagged paragraph <#b3pa9-5zrix-2>`__ via
its URL.


See also
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-references
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-targets


hope this helps

Günter


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.