vfm icon indicating copy to clipboard operation
vfm copied to clipboard

spec: picture element

Open akabekobeko opened this issue 5 years ago • 2 comments

Goals

A mechanism for changing an image by an output medium is provided. This is converted to an HTML <picture> element.

Markdown:

![alt](main.png "title")(print.png "print")

HTML:

<picture>
  <img src="main.png" alt="alt" title="title">
  <source srcset="print.png" media="print">
</picture>

Prior Art

I searched for CommonMark, GFM and remark but couldn't find them.

Discussion

Careful discussion is needed because no prominent precedent has been found.

akabekobeko avatar Feb 15 '20 08:02 akabekobeko

IMO, ...(print.png media="print") is better. It is similar to special attribute annotation (#9).

![alt](main.png "title")(print.png media="print")

Because it is confusable that "title" in first block is a title, but "print" in second block is a media query. I feel giving its key name as media= is explicit and easy to understand. I agree it is redundant for "markdown like" syntax...

tk0miya avatar Feb 16 '20 03:02 tk0miya

私が提案したものですが、議論途中で止まっているため v2.0 へ見送ります。

記法としては @tk0miya さんの指摘にあるとおり、私の案だと title と紛らわしいため属性を明示するほうがよさそうです。後続の source にあたる括弧において

  • media ぐらいしか指定されないのだから明示されないものは media 扱いするのか? ... @akabekobeko 案
  • media などの属性を明示するか? ... @tk0miya さんの指摘

が課題となるでしょう。

akabekobeko avatar Apr 03 '21 02:04 akabekobeko