Menu

#44 Add :figname: option to the figure directive

Default
closed-fixed
nobody
None
5
2025-07-30
2015-03-11
Jellby
No

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.

Discussion

  • Günter Milde

    Günter Milde - 2024-08-30
    • status: open --> open-remind
     
  • Günter Milde

    Günter Milde - 2024-08-30

    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.

     
  • Günter Milde

    Günter Milde - 2025-04-23
    • status: open-remind --> open-fixed
     
  • Günter Milde

    Günter Milde - 2025-04-23

    Commit [r10102] adds a "figname" option to the figure directive.

     

    Related

    Commit: [r10102]

  • Günter Milde

    Günter Milde - 2025-07-30
    • status: open-fixed --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2025-07-30

    The issue is fixed in Docutils 0.22 released 2025-07-29.
    Thank you for reporting.

     

Log in to post a comment.

MongoDB Logo MongoDB