As suggested in https://sourceforge.net/p/docutils/bugs/274/, I fill a feature request for a :figname: option to figure, so I can add a name to a figure and not to the image inside.
The rST syntax for internal hyperlink targets applies a "name/label" to the following element.
It can be used to name a figure element:
.. _figure-label: .. figure:: myfile.png :name: imagelabel Figure caption.
creates the HTML snippet:
<figure id="figure-label"> <img alt="myfile.png" id="imagelabel" src="myfile.png" /> <figcaption> <p>Figure caption.</p> </figcaption> </figure>
A "figname" directive option would provide an alternative way to name a figure element:
-1 There should be one-- and preferably only one --obvious way to do it. +1 consistent with the "name" and "figclass" directive options.
So, the jury is still out what is the better choice. Input welcome.
Commit [r10102] adds a "figname" option to the figure directive.
Commit: [r10102]
The issue is fixed in Docutils 0.22 released 2025-07-29. Thank you for reporting.
Log in to post a comment.
The rST syntax for internal hyperlink targets applies a "name/label" to the following element.
It can be used to name a figure element:
creates the HTML snippet:
A "figname" directive option would provide an alternative way to name a figure element:
-1 There should be one-- and preferably only one --obvious way to do it.
+1 consistent with the "name" and "figclass" directive options.
So, the jury is still out what is the better choice. Input welcome.
Commit [r10102] adds a "figname" option to the figure directive.
Related
Commit: [r10102]
The issue is fixed in Docutils 0.22 released 2025-07-29.
Thank you for reporting.