Skip to content

Convert the FAQ from FML to Markdown - #385

Merged
slachiewicz merged 2 commits into
masterfrom
faq-to-markdown
Aug 10, 2026
Merged

Convert the FAQ from FML to Markdown#385
slachiewicz merged 2 commits into
masterfrom
faq-to-markdown

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Aug 9, 2026

Copy link
Copy Markdown
Member

Part of an estate-wide move of the remaining FAQ pages from FML to Markdown.

Two commits, deliberately

  1. A pure rename, src/site/fml/faq.fml -> src/site/markdown/faq.md, no content change.
  2. The rewrite, written by hand.

Git records a rename plus a rewrite in a single commit as a delete and an add, which stops git log --follow. Splitting them keeps the history. Please merge or rebase rather than squash.

Why by hand

doxia-converter cannot target FML: the questions come out as link-reference syntax rather than headings, the [top] back-links become links to a nonexistent top page, and the contents links lose their # anchors.

Anchors are preserved, and that is the point

This page has been on maven.apache.org for years and is linked from outside. FML derives its anchor from the <faq id=...> attribute, and where that attribute is not a valid XML name DoxiaUtils.encodeId rewrites it at render time. The <a id> elements written here reproduce the anchor the live site serves today, not the raw attribute.

Here that matters: id="Why use antrun and not the Ant program itself?" is served as #Why_use_antrun_and_not_the_Ant_program_itself.3F, and that is the string written into the Markdown.

Anchors use <a id>, not <a name>

maven-site-plugin 3.21.0 strips the name attribute from inline HTML; 3.22.0 keeps it — stripping it would delete every anchor on the page while the build stayed green. Xhtml5BaseParser reads Attribute.ID first and only falls back to NAME, so id is the primary path rather than a workaround, and name on <a> is obsolete in HTML5. Each anchor is on its own line: folding one into heading text suppresses the section's own generated id.

Where the live anchor is byte-identical to what the ### heading generates on its own, no explicit anchor is written — adding one would emit the same id twice, which is invalid HTML and which Doxia warns about. Verified zero Anchor name … used more than once warnings in the site log.

Verification

Built the site with mvn site before and after and compared the set of anchors the generated faq.html actually serves.

before: Why_use_antrun_and_not_the_Ant_program_itself.3F, top, bodyColumn
after:  the same three, plus the heading-derived id

<head> byte-identical, so title and metadata are unchanged. No link target on the page changed. site.xml needs no edit — FML and Markdown both render to faq.html, so the menu entry and the ./faq.html link in index.md keep working.

What is lost

FML generates a [top] back-link after each answer. Those are dropped rather than hand-written. The question becomes an h3 heading instead of a definition term. Nothing else changes.

Drafted with Claude — please verify

Git records a rename plus a rewrite in one commit as a delete and an
add, which stops 'git log --follow'. Splitting the rename out keeps the
history. Please merge or rebase rather than squash.

Generated-by: Claude Opus 5 (1M context)
@slachiewicz slachiewicz added the documentation Improvements or additions to documentation label Aug 9, 2026
doxia-converter cannot target FML usefully - the questions come out as
link-reference syntax rather than headings, the [top] back-links become
links to a nonexistent 'top' page, and the contents links lose their #
anchors. The page is written out by hand instead.

The one anchor on this page is a form Doxia rewrites at render time:
<faq id="Why use antrun and not the Ant program itself?"> is not a valid
XML name, so DoxiaUtils.encodeId serves it as
#Why_use_antrun_and_not_the_Ant_program_itself.3F. The <a id> written
here reproduces that rendered form, not the raw attribute, so the live
deep link still resolves.

No explicit <a id> is written for that anchor, because the h3 the
question becomes already generates exactly that id from the same
encodeId rule - adding one as well would emit the id twice and Doxia
warns about it. The rendered page carries the anchor once, from the
heading.

Verified by building the site before and after and comparing the set of
anchors the generated faq.html actually serves. Every anchor present
before is still present after, and the <head> is byte-identical, so the
title and metadata are unchanged.

site.xml needs no edit: src/site/fml/faq.fml and
src/site/markdown/faq.md both render to faq.html, so the menu entry and
the link from index.md keep working.

FML generates a [top] back-link after each answer; those are dropped
rather than hand-written. The question becomes an h3 heading instead of
a definition term. Nothing else on the page changes.

The anchors are written as <a id="...">, not <a name="...">.
maven-site-plugin 3.21.0 strips the name attribute from inline HTML, which
would silently delete every anchor on the page while the build stays green;
3.22.0 keeps it. Xhtml5BaseParser reads Attribute.ID first and only falls
back to NAME, so id= is the primary path rather than a workaround, and name
on <a> is obsolete in HTML5. Each anchor is kept on its own line: folding one
into the heading text suppresses the section's own generated id.

Generated-by: Claude Opus 5 (1M context)
@slachiewicz
slachiewicz marked this pull request as ready for review August 10, 2026 00:35
@slachiewicz
slachiewicz merged commit 5441176 into master Aug 10, 2026
20 of 21 checks passed
@slachiewicz
slachiewicz deleted the faq-to-markdown branch August 10, 2026 00:35
@github-actions github-actions Bot added this to the 3.2.1 milestone Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant