alangrainger / obsidian-image-captions

Add captions to images with inline Markdown and link support. The caption format is compatible with the CommonMark spec and other Markdown applications.
GNU General Public License v3.0
95 stars 7 forks source link

[Feature Request] Auto Numbering, Image Description #4

Closed HeekangPark closed 1 year ago

HeekangPark commented 1 year ago

Thank you for making a great plugin!

I hope the plugin supports "auto numbering" and "image description" features as well.

"auto numbering" feature

I hope the plugin can automatically put the number with some prefix for all images' captions in the note(ex. "Fig 01. xxxx", "Fig 02. yyyy", ... ).

"image description" feature

I hope the plugin can add additional figcaption so that I can use the original figcaption as the image title and the added one as the image description.

alangrainger commented 1 year ago

Thanks for the suggestions.

For Auto-numbering, there isn't any scope with this plugin for defining the actual caption text. Sounds like you could do this with some custom JS or Templater. This plugin is just for presenting the provided text, whatever it may be.

For Image description, my understanding from the HTML spec is that there should only be one figcaption element inside a figure. Can you provide a link to a spec showing multiple figcaptions?

HeekangPark commented 1 year ago

To be honest, I've never thought about the figcaption's HTML spec. It seems like you are right — a <figure> should have only one <figcaption>. But I've found that by somehow web browsers allow to use multiple figcaptions. Here's a small demonstration with CodePen: https://codepen.io/HeekangPark/pen/YzjmLJy

alangrainger commented 1 year ago

In that case it's probably out of scope for this plugin. This is purely intended to take the standard Markdown image caption text and correctly format it as a caption in the image. I won't be adding extra non-standard features like title + a separate description.