You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As many other HTML templates, radix is using h1 for the title of the article and h2 for the different sections.
Following this, the corresponding expected markdown is something like:
---
title: "title of the article"
---
## Section 1
text
## Section 2
### Sub-section 2.1
text
This use of h2 for level-1 section headers is due to a historical limit of HTML (with not proper <title> or equivalent in the <body>).
However, for LaTeX or Word output, it is expected to use # for the level-1 section headers, which is semantically more correct.
One interest of markdown is the possibility to transform it into different outputs. However, currently, the markup of level-1 sections (## expected for HTML/radix vs # for LaTeX/Word output) is a problem.
Ideally, the markup in the markdown should not depend on the type of output.
A possibility could be for radix articles to expect the following markdown:
---
title: "title of the article"
---
# Section 1
text
# Section 2
## Sub-section 2.1
text
and to use the pandoc option --base-header-level=2 to properly transform # into <h2> keeping the same semantic of # between HTML, LaTeX and Word, while having the appropriate HTML markup.
As Radix is still in the development phase, would it be an appropriate time to discuss the relevance of such behaviour?
The text was updated successfully, but these errors were encountered:
Yes, this would indeed be great (as it would be both semantically better and would enable use of pandoc section numbers). That said, Radix is derived from the Distill framework (https://github.com/distillpub/template) which in turn currently requires H2 for in-document headings.
Using # for sections with --base-header-level=2 pandoc option will correctly turn section titles into <h2> HTML elements, as expected by the Distill framework. The advantage would be to be more correct semantically and to use the same markdown content for producing a Word or PDF document (Note: for these outputs, the pandoc option --base-header-level should be set to 1).
However, it will not resolve the issue of numbering sections discussed in https://github.com/rstudio/radix/issues/56). The problem is that Pandoc apply --number-sections after applying --base-header-level. I have raised that issue on Pandoc's GitHub (jgm/pandoc#5071).
larmarange
changed the title
Using # for section titales with --base-header-level=2 instead of using ## ?
Using # for section titles with --base-header-level=2 instead of using ## ?
Dec 18, 2018
As many other HTML templates, radix is using
h1
for the title of the article andh2
for the different sections.Following this, the corresponding expected markdown is something like:
This use of
h2
for level-1 section headers is due to a historical limit of HTML (with not proper<title>
or equivalent in the<body>
).However, for LaTeX or Word output, it is expected to use
#
for the level-1 section headers, which is semantically more correct.One interest of markdown is the possibility to transform it into different outputs. However, currently, the markup of level-1 sections (
##
expected for HTML/radix vs#
for LaTeX/Word output) is a problem.Ideally, the markup in the markdown should not depend on the type of output.
A possibility could be for radix articles to expect the following markdown:
and to use the pandoc option
--base-header-level=2
to properly transform#
into<h2>
keeping the same semantic of#
between HTML, LaTeX and Word, while having the appropriate HTML markup.As Radix is still in the development phase, would it be an appropriate time to discuss the relevance of such behaviour?
The text was updated successfully, but these errors were encountered: