vivliostyle / vfm

⬇️ Open and extendable Markdown syntax and toolchain.
https://vivliostyle.github.io/vfm/#/vfm
Other
71 stars 12 forks source link

spec: picture element #19

Open akabekobeko opened 4 years ago

akabekobeko commented 4 years ago

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.

tk0miya commented 4 years ago

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...

akabekobeko commented 3 years ago

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

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

が課題となるでしょう。