Replies: 1 comment 4 replies
-
I've locally updated the documentation (description of node
IMO this is allowed, because of the "equal to" in the specs.
That would preclude users from using different styles for titles/subtitles, and would have other diasadvantages.
Thanks for mentioning this. PML should always comply with the HTML specs. Hence, we should indeed use the I suggest to do this: For the document title/subtitle, generate the following code:
For the subtitle we could also use a For a chapter title/subtitle, the new code would be:
PML allows to define several subtitles, which are all treated the same way. Hence, a title with two subtitles would be rendered as follows:
Note that a
Subtitles were added after a user requested them.
Done. |
Beta Was this translation helpful? Give feedback.
-
A few consideration on titles and subtitles.
Doc vs Chapters Subtitles
From the documentation it's not clear whether a PML document supports a subtitle or not, whereas it's clear that chapters do support subtitles.
Most lightweight markup syntaxes only support a subtitle for the document main title, not for chapters/sections. The former is definitely needed, since usually any document has a subtitle, but it's great to see that PML also supports chapter/section subtitles because although they are not used as often they are good practice in certain types of documents (a title and subtitle can be seen as a subject and predicate, describing the section contents).
Doc Subtitles
In any case, it's currently possible to use a
[subtitle
node with the document title:which will produce the following HTML:
The problem here is double H1 headers, one after the other.
According to §4.3.11:
I'm not sure this disqualifies having two consecutive H1 headings as being invalid, but the point here is that semantically a subtitle should be of an inferior order to the title. Also, from a mere HTML tag point of view, it doesn't make much sense to have two separate H1 tags here, a simple
<br>
separator would have been just as fine.But my impression, from reading the HTML5 specs, is that subtitles (in general) should be handled via the
hgroup
element instead:From §4.3.11 (bold added):
Other markup tools don't seem to adopt this approach though.
Pandoc, when publishing books as chuncked HTML resorts to classes to handle subtitles:
I'm not sure why this is so, but probably it was in order to preserve functionality of the custom CSS created by the community. In any case, pandoc allows customizing HTML5 templates, so the above could be overridden.
Asciidoctor simply joins the document subtitle with the title, separating them with a default
:
delimiter (which can be customized). Many users complained about this, since in other output formats the document title and subtitle are styled differently (usually the latter is smaller than the former).Either way, it might be worth investigating what the proper semantics are for handling document- and chapter-subtitles, since PML should adopt the best tagging convention in the HTML output. This is something which is best not to postpone, otherwise a later change in the HTML structure would break any existing custom CSS created by the community — something which would backlash on PML, regardless of whether these stylesheets were created for personal use or shared with the FOSS community.
I'm not an expert on HTML5, but I can clearly see that the new HTML incarnation tries to address fine-grain details of documents publishing, especially in view of how HTML/XML today are also used in e-book publishing (e.g. ePub, ePub3, and other HTML based formats). Although some of the new HTML5 tags/semantics are still not widely adopted by many popular tools, there's no reason why PML shouldn't look into them, and adopt them if they are beneficial in terms of rising the quality of the generated documents.
Chapter Subtitles
As for chapter subtitles, the following PML source:
[ch (id=heading2sub) [title Subtitled Heading Level 2] [subtitle I'm The Subtitle]
is rendered as:
again, we can see a doubling of the current heading level, just as with the doc title and subtitle. My guess is that the above considerations also apply here.
I'd love to hear from @pml-lang what the original design goals were when subtitles were implemented into PMLC, and also feedback from other users who might shed some light into the best semantics for handling titles and subtitles in various types of documents.
Beta Was this translation helpful? Give feedback.
All reactions