tobiasah / mkdocs-caption

MkDocs plugin to add captions and easy element numbering
MIT License
5 stars 1 forks source link

Add a way to increment index arbitrarily #24

Open sinaatalay opened 4 months ago

sinaatalay commented 4 months ago

One of the problems I encountered was that sometimes, mkdocs-caption cannot handle captioning a figure (or anything else) in edge cases. For example, I used a PDF object as a figure, but since Markdown syntax doesn't accept PDF objects in image syntax, I had to write my own HTML, putting PDF inside figure element with caption element inside.

Instead of supporting all the possible combinations, users should be able to write their own HTML (with figure and caption elements) from time to time. When they do so, there should be a way to notify mkdocs-caption that "I created a figure caption manually; please increment the counter by one."

Currently, if you write your own HTML, the counter doesn't know it, and there is no way to increment it manually.

My proposal:

I think the simplest way to approach this would be allow users to add blank images to their markdown:

![blank]()

This shouldn't render any caption or figure in HTML, but it should increment the counter by one.