Hello all,
In the context of the Numbered Figures Application, we wish to be able to distinguish between figures containing any content (e.g., an image) from figures containing a single table client side (e.g., using css/javascript).
The main use case is to ba able to customize the numbered prefix of the captions with a contextual label. “Figure X” by default, and “Table X” for the figures containing a table.
Note that the figures and table will have separate counters. See the screenshot below, they each have a counter value of 1.
Figure annotation
Numbered Figures Application depends on XS 14.2+, where nothing is provided to identify figures containing a single table.
I propose to:
- Make an improvement on 14.5RC1+ to annotate the figure tags with some information. What kind of information is to be defined, see below.
- Override the
figure
macro in a newapplication-numbered-content-figures-ui
module for versions lower than 14.5RC1 (this overriding macro will be removed once the extension depends on 14.5RC1+) - Update the figure numbering CSS to adapt the label according to these additional information
Figure with table identification: class vs data attribute
I see two solutions here:
- add a specific class to the figure tag. Note that the
table
class is already used (see the footnotes below), so it’s better to use something else. I propose to usewikigeneratedfigurenumber
which was used by the Numbered Reference Macro - add a data attribute to the figure tag, for instance
data-xwiki-rendering-figure-type
, with valuetable
orfigure
.
I prefer the css based solution that is compatible with legacy use cases of the same kind.
WDYT?
Foonotes:
Table specific css:
.table, table {
width: 100%;
max-width: 100%;
margin-bottom: 20px;
}