vivliostyle / vfm

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

spec: clarify footnote and postnote(endnote) #128

Open kenhys opened 2 years ago

kenhys commented 2 years ago

Goals

Formalize footnote syntax, not postnote (endnote)

footnote: currently, <span class="footnote">...</span> is used. no formalized syntax as a VFM. postnote(endnote): [^1] .... [^1]: is defined, but it is called as footnote. (confusing)

This issue is created for formalizing footnote syntax.

Prior Art

In GitHub context, footnote is [^1] ... [^1]:.

https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/

It seems that VFM also follows it.

https://vivliostyle.github.io/vfm/#/vfm#footnotes

In GitHub GFM context, even though footnote and endnote are regarded as the same, it is no harm in a practical, but not for VFM.

Discussion

The problems are:

I may be wrong, but @ogwata , @MurakamiShinyu @akabekobeko what do you think?

akabekobeko commented 2 years ago

@kenhys

VFM's Footnotes are based on Pandoc, the resulting HTML is also Pandoc compliant.

If there is a VFM that has the same function and syntax and is already popular, we will follow it as much as possible.

So if need to leave Footnotes as is and distinguish it from Postnote (endnote), I think it's preferable to have a different new feature and syntax.

kenhys commented 2 years ago

Thanks.

It is reasonable to keep compatibility with already popular implementation. (even though a bit confused)

So, I agree with introducing a different new feature and syntax for 脚注 (with theme-techbook footnote and endnote are rendered differently)

https://vivliostyle.org/ja/make-books-with-create-book/#%E8%84%9A%E6%B3%A8 image

akabekobeko commented 2 years ago

@MurakamiShinyu @ogwata VFM 構文における Footnotes の立ち位置や周辺ドキュメント整合性の話ですので、お二人もコメントをお願いします。

MurakamiShinyu commented 2 years ago

私の考えは #33 のコメントに書いている通り、VFMのオプションとして、Inline footnote の構文 ^[ ... ] を(endnote ではない)footnote にできるようするというものです。

https://github.com/vivliostyle/vfm/issues/33#issuecomment-835853084:

Adopting remark-footnotes will be fine.

と書いたのですが、この実装では以下の問題があることに気がつきました。

https://github.com/vivliostyle/vfm/issues/33#issuecomment-836457373:

v1.0 では次のように制限したfootnote/endnoteサポートでどうでしょうか?

  • Inline footnote の構文 ^[ ... ]<span class="footnote"> ... </span> に変換する。(remark-footnotes の inline footnote 機能は使わない)
  • それ以外の footnote 構文 [^xx] ... [^xx]: ... は remark-footnotes を使う。注参照の番号は注番号と一致するように加工する。

しかし、v1.0 で「 ^[ ... ]<span class="footnote"> ... </span> に変換」(endnote ではない footnote として組版される)の実装が難しいということだったので↓

https://github.com/vivliostyle/vfm/issues/33#issuecomment-839751320:

<span class="footnote"…> をサポートするのは VFM 2.0 からでもよいと思います。 VFM 2.0 から、デフォルトでは 1.0 と同じ(インラインも通常構文と同じくリンク)として、オプションでインライン構文を <span class="footnote"…> にするのでどうでしょう。

ogwata commented 2 years ago

footnote(脚注)をサポートして欲しいというご要望と受け取りました(違っていたらご指摘ください)。

footnoteのサポートについては#33で合意されたように、v2.0に先送りされたと認識しています。具体的な記法は議論中ですが、前出@MurakamiShinyu さんの考えは実用的に思え、これが叩き台になりそうです。

話題が逸れるかもしれませんが、私個人としては、後注にしても脚注にしても縦書きに対応していないことが気になっています。

具体的には縦書き時に注番号の上付き数字が縦中横になりません。別Issueに#6がありますが、注番号は特別な記法なしに、縦書きが指定されたら自動的に縦中横になるべきでしょうね。(必要ならIssue作成します)

kenhys commented 2 years ago

footnote(脚注)をサポートして欲しいというご要望と受け取りました(違っていたらご指摘ください)。

はい、そのとおりです。 将来的にサポートされるのを楽しみにしています!

vvakame commented 2 months ago

+1 同人誌の作成時にinline footnoteをデフォルトで使いたくて、footnoteは使う機会がないです。 今は <span class="footnote"> ... </span> を手書きしていますが、面倒だと感じています。

Issueですでに語られている解決法以外の選択肢として、vivliostyle.config.jsのオプションなどでfootnote記法の振る舞いが変えられる仕様でもよい気がしています(とりあえず互換性が壊れずopt-inが可能な仕様として)。 個人的には両者が併用できる必要をあまり感じていないため、上記仕様でも困らないと思っています。