Menu

#68 Adding syntax for role parameters

Default
open
nobody
None
5
2025-05-21
2020-01-31
adam
No

Hello Docutils team,

Sometimes I would like to pass options to role functions for adding domain-specific metadata. For example,

For citation page numbers:

As discussed in :cite:[p.99]`knuth1968`, the implementation ...

In a cookbook:

If you like, add some :liquid-ingredient:[20ml, spicyness=7]`Tabasco sauce`. 

As discussed in this Docutils mailing-list thread, AsciiDoc uses a syntax like this:

Click image:icons/play.png[Play, title="Play"] to get the party started.

I like the idea of passing positional and named options in brackets.

Is there a possibility of Docutils supporting this feature?

Related

Feature Requests: #96

Discussion

  • Günter Milde

    Günter Milde - 2023-12-12

    See [#96] for another use case.

     

    Related

    Feature Requests: #96

  • Günter Milde

    Günter Milde - 2025-05-21

    Sphinx uses parentheses in the :abbr: role, for example:

    :abbr:`LIFO (last-in, first-out)` 
    

    +1 looks "natural" in source form
    - 1 used as generic syntax, this would require escaping all opening parentheses in role content.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.