Skip to content

[#1275] Fix Release Notes and Getting Started page titles - #1276

Merged
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:issues/1275-doc-page-titles
Nov 6, 2026
Merged

vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:issues/1275-doc-page-titles

Conversation

@vharseko

@vharseko vharseko commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

The Release Notes and Getting Started chapter pages currently appear as AsciiDoc filenames in navigation and default xrefs, and their browser titles are Untitled. Give all four pages proper title metadata while retaining their existing URLs, HTML fragments and combined-book chapter hierarchy.

Use the existing :table-caption!: insertion point in doc-maven-plugin 3.2.2 to promote chapter headings only in the generated Antora output. Keep chapter IDs on headings for the books and emit separate inline anchors under env-site, because the default Antora UI does not render document IDs as HTML anchors.

Add six integration checks in the man-pages profile's verify phase, after Antora generation. They verify the expected document titles with header-only parsing, reject a :title: attribute that could mask a missing document header, and render the page bodies to check all 16 published chapter and subsection fragment IDs. They also preserve both combined books' chapter titles, IDs and levels. Missing generated inputs or a missing test include fail the build.

Document the checks and source conventions in CHECKS.md, including the blank line required after each inline anchor and the different effect of a block anchor on a section's automatic ID.

Fixes #1275.

Validation

Current revision:

  • All 26 documentation-module unit tests and six integration checks passed on Java 11 and Java 27, with no failures, errors or skips.
  • On Java 11, the strengthened integration checks accept the original generated pages and reject each of three generated-input mutations: removing the blank line after the requirements page's inline anchor, replacing it with a block anchor, and replacing the title-promotion attributes with :title:. The first two fail on the missing published subsection ID; the third fails on the title attribute.
  • git diff --check passed.

Earlier validation of the page-title and anchor changes:

  • Reproduced four missing-title failures before the fix and four missing-HTML-anchor failures before preserving the body anchors.
  • Built an Antora 3.1.15 preview and verified browser titles, landing-page/default xref labels, navigation labels and all 16 previously published content fragment IDs, with no duplicate IDs.
  • Rebuilt both PDFs using doc-maven-plugin 3.2.2; checked their rendered contents pages, chapter structure and named destinations.
  • The attribute checker and 600 file xrefs across 72 pages passed.

The current revision changes only the integration test and CHECKS.md; the Antora preview, PDFs, attribute checker and xref scan were not rerun for this update. Validation used focused documentation goals; the full reactor was not rerun. Existing Maven/JRuby/JDK access and deprecation warnings remain. The live documentation site has not been deployed by this change.

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The fix sits where Antora reads the title, and the new IT checks it the same way Antora does.

  • generatedPageHasDocumentTitle parses with parseHeaderOnly(true), so Asciidoctor's section-title fallback cannot hide a missing document header.
  • ifndef::env-site[] keeps the chapter IDs on the == headings for the books, and anchor:<id>[] gives the site the same fragment. A local Antora 3.1.15 build with the site's ui-bundle showed each of the four IDs exactly once per page and no subsection ID changed.
  • failIfNoTests on the test-antora-page-titles execution, so a lost include fails the build instead of skipping the check.

suggestion (non-blocking): AntoraPageTitlesIT pins only the four chapter IDs, so losing a published subsection fragment stays green.

opendj-doc-generated-ref/src/test/java/org/openidentityplatform/opendj/doc/AntoraPageTitlesIT.java:56-64, :79-80

The only body assertion checks the chapter ID. In requirements-and-upgrade.adoc, deleting the blank line after the anchor's endif::[] makes === Java and Installation Environment join the anchor paragraph. Turning anchor:release-requirements[] into [#release-requirements] moves the ID onto that section instead. Either way the published _java_and_installation_environment fragment disappears, and the IT stays green: 6/6 on the blank-line mutant, edited into the generated page and rerun with the CHECKS.md command. The 16 fragment IDs in the PR's validation were checked by hand.

    @DataProvider
    public Object[][] pages() {
        return new Object[][] {
            { "release-notes", "release-5.2.0", "OpenDJ 5.2.0",
              new String[] { "release-5-2-0", "_selected_changes", "_distributions" } },
            { "release-notes", "requirements-and-upgrade", "Requirements and Upgrade Considerations",
              new String[] { "release-requirements", "_java_and_installation_environment", "_plan_an_upgrade",
                             "_compatibility_checks", "_known_issues_and_help" } },
            { "getting-started", "overview", "Directory Concepts", new String[] { "getting-started-overview" } },
            { "getting-started", "first-steps", "Your First Directory",
              new String[] { "getting-started-first-directory", "_prepare_the_environment",
                             "_set_up_and_start_the_server", "_add_a_person", "_search_and_change_the_entry",
                             "_restart_and_remove_the_sample_data", "_next_steps" } }
        };
    }

    @Test(dataProvider = "pages")
    public void generatedPageHasDocumentTitle(String guide, String page, String title, String[] fragments) {
        final File input = new File(buildDirectory, "antora/modules/" + guide + "/pages/" + page + ".adoc");
        assertThat(input).isFile();
        // Antora extracts metadata from the header. A full parse can fall back to a section
        // title and conceal a missing document header, although Antora publishes "Untitled".
        final Document document = asciidoctor.loadFile(input,
                Options.builder().safe(SafeMode.SAFE).attributes(Map.of("env-site", ""))
                        .parseHeaderOnly(true).build());
        assertThat(document.getDoctitle()).as("document title of %s", input).isEqualTo(title);
        final String html = asciidoctor.convertFile(input,
                Options.builder().safe(SafeMode.SAFE).attributes(Map.of("env-site", ""))
                        .standalone(false).toFile(false).build());
        for (final String fragment : fragments) {
            assertThat(html).as("published fragment %s in the rendered body of %s", fragment, input)
                    .contains("id=\"" + fragment + "\"");
        }
    }

Pin: the lists are every ID the env-site render emits at this head, except preamble, which is Asciidoctor's wrapper. A probe on Asciidoctor 2.0.20 (the gem inside asciidoctorj 2.5.11) found that the pin passes on the head pages and fails on both mutants.


suggestion (non-blocking): The doctitle row also passes on a :title: attribute with no document header, a page Antora publishes as "Untitled".

opendj-doc-generated-ref/src/test/java/org/openidentityplatform/opendj/doc/AntoraPageTitlesIT.java:72-75

The row asserts getDoctitle() of a header-only parse, but Antora takes the doctitle only from a page with a header. Replace :table-caption!:, and with it the inserted :leveloffset: -1, by :title: Requirements and Upgrade Considerations. == Requirements and Upgrade Considerations then stays a section. The header-only getDoctitle() returns the title from the attribute, so the row passes: 6/6 on that mutant in the generated page. Antora's loader returns no doctitle for the same input. AsciidoctorJ 2.5.11 Document has no header accessor. Without a title attribute, though, a header-only parse can get its doctitle only from the header.

        assertThat(document.hasAttribute("title"))
                .as("%s takes its title from a :title: attribute, which Antora ignores without a header", input)
                .isFalse();

Pin: add it after line 75. ContentNodeImpl.hasAttribute calls Ruby attr?, which returns false on the four head pages and true on the mutant.


issue (non-blocking): CHECKS.md gives the wrong reason for keeping the inline anchor in its own paragraph.

opendj-doc-generated-ref/CHECKS.md:127

An inline anchor:x[] never sets a section ID. Only a block anchor ([[x]], [#x]) attaches to the next block and replaces its automatic ID. The real failure is a missing blank line: Asciidoctor does not end a paragraph at a section title, so a === heading directly below the anchor joins its paragraph and disappears together with its fragment. This was probed on Asciidoctor 2.0.20 and Asciidoctor.js 2.2.8. As written, the sentence points at the wrong mechanism, and its obvious "fix", a block anchor, causes exactly the ID loss it warns about.

Keep a blank line after the anchor's `endif::[]`: Asciidoctor does not end a paragraph at a
section title, so a heading directly below the anchor joins its paragraph and disappears
together with its fragment ID. Do not turn the anchor into a block anchor (`[[id]]` or
`[#id]`) either: a block anchor attaches to the next block and replaces that section's
automatic ID.

Or: drop the reason and keep only the rule, if the file should stay short.

@vharseko

vharseko commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

@maximthomas Addressed all three suggestions in 2766cbd.

  • Published fragments: AntoraPageTitlesIT now checks all 16 chapter and subsection fragment IDs across the four pages. Both the missing-blank-line mutation and the block-anchor mutation now fail on _java_and_installation_environment.
  • Document header: added an assertion rejecting a :title: attribute after the header-only title check, with a comment explaining the difference from Antora's header requirement. The attribute-only mutation now fails instead of passing the title check.
  • Anchor explanation: corrected CHECKS.md to distinguish a heading swallowed into an inline-anchor paragraph from a block anchor replacing the next section's automatic ID. It also documents the stronger title and fragment checks.

Validation: all 26 documentation-module unit tests and six integration checks passed on Java 11 and Java 27, with no failures, errors or skips. On Java 11, the unchanged generated inputs passed all six integration cases, and each of the three generated-input mutations produced exactly the expected failure. git diff --check passed.

The PR description now reflects the final checks and separates current validation from the earlier Antora preview, PDF builds, attribute check and xref scan, which were not rerun for these test/documentation changes. The full reactor was not rerun, and the live site remains unchanged.

@vharseko
vharseko requested a review from maximthomas November 6, 2026 09:56

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The round-1 gaps are closed, and the test now fails on each of the mutations it was written to catch.

  • AntoraPageTitlesIT checks all 16 published fragments and rejects a :title: attribute (hasAttribute("title")). On JDK 11 it passes 6/6 at this head. It fails on each of three page mutants of requirements-and-upgrade.adoc: the blank line after the anchor removed, a block anchor [[release-requirements]], and :title: in place of :table-caption!:.
  • The env-site split keeps every fragment the pages published before. In an Antora 3.1.15 render with the site UI, each page's HTML id set is the base set, plus preamble on three pages.

@vharseko
vharseko merged commit ad1c27b into OpenIdentityPlatform:master Nov 6, 2026
17 checks passed
@vharseko
vharseko deleted the issues/1275-doc-page-titles branch November 6, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: show release-note page titles instead of source filenames

2 participants