Re: Inline, verbatim anchors?
Guenter Milde via Docutils-users <[email protected]> Mon, 28 Oct 2019 16:11:31 -0000 (UTC)
| Newsgroups | gmane.text.docutils.user |
|---|---|
| Message-ID | <[email protected]> |
On 2019-10-08, Guenter Milde via Docutils-users wrote:
> On 2019-10-07, Matthew Woehlke wrote:
>> On 07/10/2019 14.11, Guenter Milde via Docutils-users wrote:
>>> On 2019-10-07, Matthew Woehlke wrote:
>>>> What I want, ideally, is a role that takes its text and generates an
>>>> anchor from its text (i.e. sets the 'id' on its node to its contents),
>>>> *and also emits the text*.
>>> You may be looking for `inline internal targets`__.
>>> __ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-internal-targets
>> Huh. Okay, that *sort of* works, but is there any way to style the text?
> Unfortunately, inline markup nesting is not supported.
> This is a long standing feature request.
> http://docutils.sourceforge.net/docs/dev/todo.html#nested-inline-markup
Another option would be to extend `custom interpreted text roles`_ to roles
based on hyperlink targets and hyperlink references.
__ http://docutils.sourceforge.net/docs/ref/rst/directives.html#custom-interpreted-text-roles
Concept:
Two special roles :hyperlink-reference: and :hyperlink-target: are
defined (similar to the `:raw:`__ role).
__ http://docutils.sourceforge.net/docs/ref/rst/roles.html#raw
Then, the rSText::
.. role:: emph-link(hyperlink-target)
:emph-link:`here`
would create a target with class argument::
<target ids="target" names="target" classes="emph-link">
target
that could be styled accordingly.
Maybe we could also allow a combination of hyperlink syntax and role syntax
like::
This is an _`important target`:emphasis: and a very :strong:`bold link`_.
This makes use of the fact that the `interpreted text`__ role can be
specified on either side.
__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#interpreted-text
Günter
Günter
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.