pandoc
pandoc copied to clipboard
Implement figure numbering for HTML output
This is a first attempt at implementing a --number-figures option for HTML output (https://github.com/jgm/pandoc/issues/615). This is a first step towards allowing figure references within a document (#813).
There are a few questions that remain outstanding,
- How should other writers (especially the LaTeX writer, which already implements figure numbering) treat this option
- What form should the figure number take (e.g. a global counter for the entire document, as this implements, or just within the current (sub?)section
- How should the figure number be rendered? Currently it's placed in a
<span class="figure-number"> - How much control over the above should the user be given?
- Should we support numerical offsets like we do with section numbers?
- Needs to be extended for table numbering once the above issues have been sorted
There is currently work being done to replace the current representation of figures with a new block level element. There is currently discussion about how is best to do this here. This probably won't break your changes too much but should be something to keep in mind.
@mpickering, thanks for the heads up! Many of the issues discussed in that thread are quite relevant to other work I've been interested in doing (e.g. adding anchors)
What should happen with this? If there are no objections this should be ready to go.
I'm reluctant to merge this at this point, because I want to think more about a good general strategy for dealing with figures, numbering, and cross-referencing.