tobiasah / mkdocs-caption

MkDocs plugin to add captions and easy element numbering
MIT License
3 stars 2 forks source link

Add a way to increment index arbitrarily #24

Open sinaatalay opened 4 days ago

sinaatalay commented 4 days 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.