Login  Register

Re: Is a blank line mandatory between a section title and its content?

Posted by mojavelinux on Jan 29, 2021; 10:19pm
URL: https://discuss.asciidoctor.org/Is-a-blank-line-mandatory-between-a-section-title-and-its-content-tp8471p8475.html

On Thu, Jan 28, 2021 at 3:28 AM Sylvain Leroux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
mojavelinux wrote
A section title is self-terminating [...]
That also explains why a section's title can't have a continuation (`+`) and MUST be on the same line as the `==` token.

Section titles have never supported a continuation, so it's more than it just being restricted to a single line. That's suggesting something that just isn't AsciiDoc.

> I noticed this is the case for level 0 sections (otherwise, the text is
taken as the author name--something which is explained in the docs).

You are confusing a level-0 section title with a document header (document
title + metadata). The document header contains a level-0 section that is
the doctitle. (https://docs.asciidoctor.org/asciidoc/latest/document/header/)
But all other level-0 section titles in a multipart book are parsed just
like all the other section titles.
Indeed, this was not clear in my mind. As far as I remember, I never used level-0 sections in my own documents.

level-0 sections are parts in a multi-part book. I agree it's a lesser used feature because not many documents have this structure.

So, to check my understanding here:
= Some title
The above document fragment could be parsed:

* either as a document header, if it's at the start of the document
* or, as a level-0 section if it's found anywhere else.

Again, you're framing this incorrectly. A document has an optional document header. A document header may contain a doctitle, which looks exactly like a level-0 section title. And it doesn't have to be on the first line of the document. It can be anywhere in the document header. See https://docs.asciidoctor.org/asciidoc/latest/document/header/

Once you have passed the document header, any level-0 section is a part. But that is only permitted if the doctype is book. You cannot have a level-0 section title in an article. By adding at least one level-0 section to a book, it implicitly becomes a multi-part book.

Best Regards,

-Dan

--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux