Re: Inline, verbatim anchors?
Guenter Milde via Docutils-users <[email protected]> Wed, 30 Oct 2019 14:22:53 -0000 (UTC)
| Newsgroups | gmane.text.docutils.user |
|---|---|
| Message-ID | <[email protected]> |
On 2019-10-28, Matthew Woehlke wrote: > On 28/10/2019 12.11, Guenter Milde via Docutils-users wrote: >> 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: >>>>> 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. > Yes, something like that could possibly work, especially as user roles > can also have custom classes added. The problem currently is, as you > note, there is no way to create a user role that also turns its text > into an anchor. Your suggested :hyperlink-target: would fix that. > Do you think a patch along those lines would be considered? Yes, a patch would be welcome. > (BTW, what *is* the patch process? I came across a "move to github" > thread that talked about doing so as a way of making it easier to > submit patches...) This is explained in the Docutils Policies http://docutils.sourceforge.net/docs/dev/policies.html#how-to-get-a-new-feature-into-docutils Patches against a git mirror are accepted, too. >> 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`_. > While that looks technically plausible, I suspect the implementation > would be much more difficult. (I have some experience with sphinx > hacking, so I'm not entirely unfamiliar with the internals. I feel > confident I could bash out a patch along the lines of your first idea > pretty quickly. The second...?) Actually, I prefer the first approach. > BTW, I wonder why nested markup is such an issue? I've implemented that > before for my own custom extensions, and it wasn't hard. As you told in the follow up, the devil is in the details. The issue is not pressing for main developers and there are many points to consider to get it right. We would need a volunteer with long-term commitment. Thanks, 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.