[docutils:feature-requests] #68 Adding syntax for role parameters

Günter Milde via Docutils-develop <[email protected]> Wed, 21 May 2025 07:55:37 -0000
Newsgroups gmane.text.docutils.devel
Message-ID </p/docutils/feature-requests/68/e123600ce628748adc6e251acaad1db4958a8741.feature-requests@docutils.p.sourceforge.net>
Sphinx uses parentheses in the [:abbr: role](https://sphinx--13576.org.readthedocs.build/en/13576/usage/restructuredtext/roles.html#role-abbr), 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.


---

**[feature-requests:#68] Adding syntax for role parameters**

**Status:** open
**Group:** Default
**Created:** Fri Jan 31, 2020 11:28 PM UTC by adam
**Last Updated:** Tue Dec 12, 2023 06:25 PM UTC
**Owner:** nobody


Hello Docutils team,

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

For citation page numbers:

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

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


As discussed in [this Docutils mailing-list thread](https://sourceforge.net/p/docutils/mailman/message/34894112/), AsciiDoc [uses a syntax](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#images) 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? 


---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/docutils/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.