Give every chapter page a level-0 title - #171
Merged
Merged
Conversation
The Antora site titled 17 of its 18 pages "Untitled" -- in the browser
tab, and anywhere else the UI prints the page title. Antora takes a
page's title from its level-0 `= Title` line, and these pages opened with
a level-1 `==` heading instead. install-tools.adoc was the one page with a
level-0 title, and the only one that showed a real title on the live site.
Not a regression: the chapters used `==` before the migration too, because
they were written as sections of one master document. MIGRATION.md Step 7
requires the level-0 title; this repo never met it.
Pages: every heading moves up one level (`==` -> `=`, `===` -> `==`, ...),
so each page opens with one `= Title` and its sections keep their relative
depth. Lines inside listing, literal and fenced blocks are untouched --
the script asserted that per file, which matters for a_few_basics.adoc,
whose fenced example of AsciiDoc heading syntax contains `= Title head`.
Assembler: every include gains leveloffset=+1, which turns each page's
level-0 title back into a chapter. The [preface] (copyright) and
[bibliography] (bibliography) style lines move from the top of those pages
into the assembler, ahead of the include, so each page starts with a bare
title and the style still lands on the same heading in the PDF. The
template already does this for contributors.
vale.adoc is the exception. It had three peer `==` sections, and a page
can have only one level-0 title, so only its first heading was promoted:
"AsciiDoc style for Vale" and "RISC-V style for Vale" now sit under "Vale
at RISC-V". On the site that page is unchanged apart from gaining its
title. In the PDF those two stop being chapters: 15 chapters become 13,
chapters 11-15 renumber to 9-13, and the PDF is one page shorter.
index.adoc is deliberately left alone. It is the cover page, with the logo
above the heading, and the shared UI renders an <h1> from the page title
unconditionally (partials/article.hbs has no notitle escape). Titling it
means putting the heading above the logo -- a cover-layout decision that
belongs to docs-spec-template, whose index.adoc has the same problem.
Guide text: the "When adding a new chapter" steps in antora-structure.adoc
and the chapter-file paragraph in author-quickstart.adoc now say to start
each chapter with a level-0 title and include it with leveloffset=+1.
Neither was mentioned before, so an author following this guide got a
green build and an "Untitled" page. Also fixes `include:` -> `include::`.
Verified against a baseline build of main:
* Antora: untitled pages 17 -> 1 (index.html); log unchanged at one
pre-existing graphviz warning and no errors.
* Standalone HTML: the rendered body text differs only in the new guide
sentences; the heading outline differs only in the Vale subtree.
* PDF: builds with no asciidoctor warnings before or after; front
matter, TOC, lists and index all present.
* nav.adoc is unchanged, so the central playbook's line-keyed chapter
numbering is unaffected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Bill Traynor <wmat@riscv.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Antora site titles 17 of its 18 pages "Untitled" — in the browser tab and
anywhere else the UI prints a page title. This gives them real titles, and updates
the guide so template users don't hit the same problem.
Cause
Antora takes a page's title from its level-0
= Titleline. These pages opened witha level-1
==heading instead. The live site proves it:install-tools.adocwas theone page with
= Install Asciidoctor..., and the only one with a real title.Not a regression. The chapters used
==before the migration too, because they werewritten as sections of one master document.
MIGRATION.mdStep 7 requires the level-0title; this repo never met it, and nothing checks for it.
What changes
Pages. Every heading moves up one level (
==→=,===→==, …), so eachpage opens with one
= Titleand its sections keep their relative depth. Lines insidelisting, literal and fenced blocks are untouched — asserted per file, which matters for
a_few_basics.adoc, whose fenced example of heading syntax contains= Title head.Assembler. Every include gains
leveloffset=+1, turning each page's level-0 titleback into a chapter. The
[preface]and[bibliography]style lines move from the topof
copyright.adocandbibliography.adocinto the assembler, ahead of the include, soeach page starts with a bare title. The template already does this for
contributors.Guide text. The "When adding a new chapter" steps in
antora-structure.adocand thechapter-file paragraph in
author-quickstart.adocnow say to start each chapter with alevel-0 title and include it with
leveloffset=+1. Neither was mentioned before, so anauthor following this guide got a green build and an "Untitled" page. Also fixes an
include:→include::typo.Please review:
vale.adocchanges the PDFvale.adochad three peer==sections, and a page can have only one level-0 title. Onlyits first heading was promoted, so "AsciiDoc style for Vale" and "RISC-V style for Vale"
now sit under "Vale at RISC-V".
renumber to 9–13, and the PDF is one page shorter (75 → 74).
The alternative is splitting
vale.adocinto three pages.Deliberately not changed:
index.adocIt's the cover, with the logo above the heading. The shared UI renders an
<h1>from thepage title unconditionally —
partials/article.hbshas nonotitleescape — so titling itputs the heading above the logo. That's a cover-layout decision for
docs-spec-template,whose
index.adochas the same problem — raised upstream as riscv/docs-spec-template#155, along with a CI check that would catch pages like these.Verification
Compared against a baseline build of
main:index.html)so shifting the headings and adding
leveloffset=+1reproduces the document exactly.Follow-up: nav order
A commit putting the title page, copyright and contributors first in the nav arrived on
this branch after this PR merged, so it isn't part of it. It's #172.
Relationship to #170
Independent — no files in common. The
home/index.html404 on the header logo andbreadcrumb is still present on this branch; #170 fixes that.
🤖 Generated with Claude Code