Skip to content
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: Switch to control auto-sectioning #155

Closed
MurakamiShinyu opened this issue Sep 6, 2022 · 1 comment · Fixed by #172
Closed

spec: Switch to control auto-sectioning #155

MurakamiShinyu opened this issue Sep 6, 2022 · 1 comment · Fixed by #172
Labels
spec Spec related thing

Comments

@MurakamiShinyu
Copy link
Member

MurakamiShinyu commented Sep 6, 2022

Update 2022-10-01 開発者会議 での討論の結果、 見出し記法の ## 見出し ## の終わりの ## (先頭の ## と同じ数)がある場合に自動section囲みをしないことにすることで、section囲みにするかしないかを切り替えられるようにするという案(by @nosuke23)を採用することに決定。

よって、以下の最初の提案(自動section囲みにする見出しを制限するvfmのオプション設定、デフォルトは h1 を除外)は取り下げ。


vfmでは文書内の最初の見出しが、文書のタイトル(HTMLのtitle要素)になる。それなのに、その最初の見出しは自動的にsectionで囲まれる。つまり最初のsectionの見出しとなる。

最初の見出しでもsection囲みにするのはpandocのsection-divsの仕様を踏襲したためだが、見直すべきかもしれない。
最初の見出し(通常h1要素)はHTMLのbody要素の直下に生成され、その次の見出し(通常h2要素)からsection囲みになるほうが、HTML文書構造として自然ではないか。

自動section囲みにする見出しを制限するオプションがあるとよいかもしれない。
例えば、 --section-headings=h2-h4 という指定で h2, h3, h4 だけを自動section囲みにする。値 all ですべて(現在と同じ)、値 none でsection囲みなし。デフォルトは h1 を除外した h2-h6 とするのが適切だろう。

関連issue:

@MurakamiShinyu MurakamiShinyu added the spec Spec related thing label Sep 6, 2022
@MurakamiShinyu MurakamiShinyu changed the title spec: Options to control auto-sectioning spec: Switch to control auto-sectioning Oct 1, 2022
@MurakamiShinyu
Copy link
Member Author

Update 2022-10-01 開発者会議 での討論の結果、 見出し記法の ## 見出し ## の終わりの ## (先頭の ## と同じ数)がある場合に自動section囲みをしないことにすることで、section囲みにするかしないかを切り替えられるようにするという案(by @nosuke23)を採用することに決定。

MurakamiShinyu added a commit that referenced this issue Oct 11, 2023
…shes

This add the following heading auto-sectioning rule:

- Do not sectionize if the heading line starts with `#`s and ends with equal or greater number of `#`s.
  - `### Not Sectionize ###` (enclosed by equal number of `#`s) -- not sectionize
  - `### Sectionize ##` (insufficient number of closing `#`s) -- sectionize

resolves #155
akabekobeko pushed a commit that referenced this issue Oct 12, 2023
…shes (#172)

This add the following heading auto-sectioning rule:

- Do not sectionize if the heading line starts with `#`s and ends with equal or greater number of `#`s.
  - `### Not Sectionize ###` (enclosed by equal number of `#`s) -- not sectionize
  - `### Sectionize ##` (insufficient number of closing `#`s) -- sectionize

resolves #155
MurakamiShinyu added a commit that referenced this issue Oct 13, 2023
This adds the following rule on sectionization:

- A line with only `#`s can be used to end the section whose depth matches the number of the `#`s.
  - e.g., the section starting with `### Heading 3` can end with `###`.

(related to #155, thanks @nosuke23 for the suggestion)
akabekobeko pushed a commit that referenced this issue Oct 13, 2023
This adds the following rule on sectionization:

- A line with only `#`s can be used to end the section whose depth matches the number of the `#`s.
  - e.g., the section starting with `### Heading 3` can end with `###`.

(related to #155, thanks @nosuke23 for the suggestion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Spec related thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant