Skip to content

Convert two site documents from xdoc to Markdown - #576

Merged
slachiewicz merged 2 commits into
masterfrom
docs/site-markdown
Aug 8, 2026
Merged

Convert two site documents from xdoc to Markdown#576
slachiewicz merged 2 commits into
masterfrom
docs/site-markdown

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Part of codehaus-plexus/.github#58. Now unblocked: modello is on parent 26, which excludes **/src/site/markdown/** from Spotless, so no local workaround is needed here.

Two commits — please merge or rebase, don't squash, so git log --follow survives the rename.

Two converted, nine deliberately not

I started out converting all 11 xdoc pages. Nine of them are going back unchanged, and I think that's the right answer rather than a shortfall.

Those pages lean on inline HTML that Markdown genuinely cannot express:

<li><code>public void write( OutputStream output, <i>RootClass</i> root )<br/>
    &#160;&#160;&#160;&#160;throws SAXException, TransformerException</code></li>

There is no Markdown for italic-and-bold inside a code span, or for <br/> inside a list item. doxia-converter produced `_RootClass_` — which renders those underscores literally — and turned each <br/> into a backslash plus a blank line, which closed the list and dumped the rest as plain text.

The only faithful conversion is to paste the same HTML into the .md file. That is strictly more fragile than the xdoc it replaces (flexmark closes a list when it meets a multi-line raw HTML block inside one), for no benefit. So sax, xpp3, stax, jackson, snakeyaml, dom4j, jdom, converters and xdoc stay as they are — verified byte-identical to their pre-rename state.

The two that convert cleanly are the Modello overview and modello-plugin-velocity.

Two converter defects I had to repair

The overview page has a clickable image map, and the converter silently dropped it — <map> and all 20 <area> hotspots gone, leaving a bare <img>. The modello-deps.png architecture diagram would have become a flat picture, with every link to modello-core/, modello-plugin-java/ and the rest lost. Original HTML block restored verbatim.

The velocity page's table came out with each row split over two lines and blank lines between them, so it didn't render as a table at all — the cells appeared as literal |parameters configured in the plugin|. Rebuilt from the original. It also backslash-escaped braces inside code spans, so `${project.basedir}` rendered as `$\{project.basedir\}`.

Neither is visible in the Markdown. Both are obvious in the HTML.

Verified

Built the site before and after, diffed the normalised pages — title, author, visible text and every link target, <head> included:

modello ROOT           IDENTICAL
plugin-velocity        IDENTICAL

The image map is worth stressing: a body-text comparison alone would have passed the version that had lost all 20 hotspots. The [LINK:...] targets in the normaliser are what caught it.

Noticed, not fixed

modello-plugin-velocity has a typo — "rfelative to velocityBasedir". It's in the original xdoc, so I've left it; a format migration shouldn't smuggle in copy edits. Happy to send it separately.

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.
Converts the Modello overview and the modello-plugin-velocity page.

The other nine xdoc pages are deliberately left as they are. They
depend on inline HTML that Markdown cannot express - constructs like
<code><i>my.model.package</i><b>.io.sax.</b><i>ModelName</i></code>,
and <br/> inside list items. Converting them means embedding the same
HTML in a Markdown file, which is more fragile than the xdoc it
replaces, so there is nothing to gain.

Two converter defects needed repairing by hand:

The overview page has a clickable image map over modello-deps.png, and
doxia-converter silently dropped the entire <map> element with all 20
<area> hotspots, keeping only a bare <img>. The original HTML block is
restored verbatim.

The velocity page's table came out with each row split across lines and
blank lines between them, so it did not render as a table at all, and
braces inside code spans were backslash-escaped.

Verified by building the site before and after and diffing the
normalised pages, head included. Both are identical.

Part of codehaus-plexus/.github#58
@slachiewicz
slachiewicz merged commit 99a714c into master Aug 8, 2026
12 checks passed
@slachiewicz
slachiewicz deleted the docs/site-markdown branch August 8, 2026 18:16
@slachiewicz

Copy link
Copy Markdown
Member Author

Update: the "nine pages stay as xdoc" reasoning in this PR is superseded by #578.

I argued here that those nine plugin pages couldn't be converted because they depend on inline HTML Markdown can't express. That was true of a faithful conversion, but it was the wrong conclusion — those <li><code> blocks are method signatures, so the right move is a fenced code block, which drops the <i>/<b> markup rather than trying to reproduce it. Credit to @slachiewicz for the observation.

#578 converts all nine that way, and also fixes three genuine errors that only surfaced from reading the sources closely (a missing read method name on three pages, a wrong package on the StAX delegate, and a jackson-writer heading on the SAX page).

This PR still stands on its own for the two pages it converts — the Modello overview and modello-plugin-velocity — including the image map doxia-converter silently dropped and the table it mangled. Those are unaffected by #578.

The two touch different files, so they can merge in either order.

@slachiewicz slachiewicz added the documentation Documentation and site content label Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation and site content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant