-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spec: Auto generate HTML section elements #8
Comments
Generated
|
The original markdown does not defines the order of headings. So many markdown processors accept document which starts with Lv6 heading. It seems this proposal expects high leveled heading wraps lower one, right? If so, we should define the order of headings as a rule. |
@tk0miya Can you elaborate on this and provide some specific example? I'm interested in your concerns. |
For example, this example starts with lv6 heading. My interest is this is valid or invalid and what HTML is converted from this VFM markup if valid.
|
How about this ? ###### Heading 6
# Heading 1 converts to: <section id="heading-6" class="level6">
<h6>Heading 6</h6>
</section>
<section id="heading-1" class="level1">
<h1>Heading 1</h1>
</section> ( I think this is good enough, but I may have missed something) |
Thank you for the comment. It means the low leveled section can stand independently without higher section. Reasonable. BTW, I noticed the section tags have its |
|
Does |
現状の vfm と Pandoc
|
について v1.0 対応とするか v2.0 へ見送るかの意見をお願いします。 |
v2へ見送りましょう。 |
コメントありがとうございます。v2.0 へ送ります。 |
すみません、「v2へ見送りましょう。」と書いたものの、次の、属性については pandoc と同様にできればうれしいです。
というのは、figureについては img の属性が img と figure の両方の出力されるようになった(#47)ので、section と見出し要素についても同様になっているのが整合性があることと、あとからこの動作仕様を変えると、現在の動作を前提に作られたスタイルシートでは問題が起きる可能性があるので、できれば今のうちに変更をしたほうがよいと思うためです。簡単な変更ですむのであればですが。 |
は確かにそうですね。検討します。というわけで一旦 Milestone を v1.0 にしておきます。 |
村上さんの要望のうち
1 を #90 で対応。VFM 1.0-alpha.20 にて反映予定。残件を継続検討する。 |
続けて 2 を #91 で対応。この PR では VFM 1.0-alpha.20 にて反映予定。残件を継続検討する。 |
#92 で 3 に対応。あわせてここまでの変更を反映した VFM 1.0-alpha.20 をリリース。 #92 対応の際に気付いたのだが村上さんが #91 でコミットしてくれた内容は文字列を Vivliostyle 本体としては「Pretteir を利用するがデフォルト設定を採用」だったので VFM も踏襲するべきだろうか。なお Pretteir 標準はたまに変更されることがある。例えば |
4 以外を反映した VFM 1.0.0-alpha.20 をリリース。 |
@MurakamiShinyu |
HTML headings
<h1>
..<h6>
create implicit sections. However, using explicit<section>
elements has an advantage that allows entire sections to be treated differently in CSS.Goals
It will be useful if implicit sections created by headings in markdown are converted to explicit
<section>
elements.Prior Art
Pandoc Option: --section-divs
Example:
is converted to the following HTML by
pandoc -t html5 --section-divs
:Discussion
The conversion with Pandoc Option: --section-divs may have the following issues:
<section>
because this is usually the top level heading of<body>
.<section>
when already wrapped in a section element (with HTML blocks or Fenced blocks) that has same or deeper level of the heading, or when placed in HTML elements other than sectioning elementsarticle
,aside
,nav
, orsection
.Update (2021-01-13): It may need further consideration, but at this point I think it's best to make it compatible with Pandoc's
--section-divs
feature.The text was updated successfully, but these errors were encountered: