Skip to content

Convert the site documents from APT to Markdown - #22

Merged
slachiewicz merged 2 commits into
sourcefrom
docs/apt-to-markdown
Aug 8, 2026
Merged

Convert the site documents from APT to Markdown#22
slachiewicz merged 2 commits into
sourcefrom
docs/apt-to-markdown

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Part of codehaus-plexus/.github#58. All 65 APT pages. Unblocked by #21, which put this repo on parent 26 — without that, Spotless destroys the front matter.

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

No URL changes. x.apt and x.md both produce x.html. Nothing moved, nothing was deleted. This is almost entirely the retired IoC documentation, which is deep-linked from fifteen years of blog posts and Stack Overflow answers.

Verification

Built the site before and after and diffed every page through the normaliser — title, author and date metadata, visible text, and every link target:

IDENTICAL: 66 of 73
DIFFERING: 7

Internal link checking finds the same five pre-existing broken links as before and no new ones — the ones already listed in #17.

Converter defects found and repaired

doxia-converter 1.3. Every one of these is invisible in the Markdown and only appears in the HTML, which is why the before/after diff is the whole method rather than a formality.

Multiple authors — the worst of them. An APT header may list several authors. The converter emits the first inline and the rest on bare continuation lines:

title: Developer Guide - Table of Contents
author: Michal Maczka
Rahul Thakur
date: 2006-06-17

A parser that stops at the second author loses everything after it — including the date — which then renders as body text. Ten pages were affected. Repeated YAML keys don't work either: the last one silently wins, so two authors became one. They're emitted as a list now, and both <meta name="author"> tags come out.

The rest:

Defect Effect
Front matter without --- fences Page loses title and author entirely
Headings shifted down one level APT section renders <h1>, came out ##
Source indentation preserved Prose became indented code blocks
Ordered lists emitted as 1 Item No period, so it rendered as literal text, not a list
{{{#Anchor}}}[](Anchor) Lost the label and the leading #
Emphasis emitted as ** text ** CommonMark needs no padding; rendered as literal asterisks
Backslashes left in code spans and before ~ ${...} rendered as $\{...\}

The cleanup is scripted, so it's reproducible rather than 65 hand edits.

The seven that differ, and why I'm not chasing them further

None loses content.

  1. index.html — the only difference is -- rendering as an en dash. Flexmark's typography, applied to prose. I'd call it an improvement.
  2. javadoc-tags-reference — Doxia normalises @ in anchor ids, so #@plexus.component became #a.40plexus.component. Self-consistent, so the on-page links work; an external deep link to the old fragment would not. Worth a second opinion — I can pin explicit anchors if you'd rather.
  3. component-configuration — the APT anchors rendered as links with no visible text. The conversion gives them their name as a label. A change, and I think a good one.
  4. building-applications/index — three literal [ ] pairs where APT's definition-list syntax wasn't recognised.
  5. configuration/index — an empty anchor link went from href="#" to href="". Useless either way.
  6. component-descriptor-creator — one table cell merged into its neighbour.
  7. 07_02_from_a_plexus_application — the converter split an inline XML snippet across code spans, producing `jar</packaging` ``. Fixed by hand, as one malformed line did not justify another global rule.

Items 4–6 are cosmetic and confined to the retired guides. Happy to fix them if you disagree — I stopped because the cost of another regex outweighed the benefit on pages nobody edits.

Next

You asked for convert first, improve later. This is the convert half, deliberately faithful — no rewording, no restructuring, no link fixing, so the diff is reviewable as a format change. The improvement pass is a separate PR.

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 across 65 files. Please merge or rebase rather than squash.
65 pages, converted with doxia-converter and then cleaned up. The
converter has several defects that are invisible in the Markdown and
only appear in the generated HTML, so each was found by building the
site before and after and diffing the normalised pages.

Multiple authors were the worst: an APT header may list several, and
the converter emits the first inline after 'author:' and the rest on
bare continuation lines. A parser that stops at the second author loses
everything after it, including the date, which then renders as body
text. Ten pages were affected. Repeated YAML keys do not work either -
the last wins - so multiple authors are emitted as a list.

Other defects repaired: front matter emitted without its fences,
headings shifted down a level, source indentation left in place so
prose became code blocks, APT ordered lists emitted as '1 Item' with no
period so they rendered as literal text, self-referential anchor links
losing both their label and their leading '#', emphasis emitted with
padding so it rendered as literal asterisks, and backslash escapes left
inside code spans and in front of characters that are not markup.

URLs are unchanged: an .apt and a .md of the same name both produce the
same .html.

66 of 73 pages are byte-identical after normalisation, metadata
included. The seven that differ are described in the pull request; none
loses content. Internal link checking finds the same five pre-existing
broken links as before, and no new ones.
@slachiewicz slachiewicz added the documentation Improvements or additions to documentation label Aug 8, 2026
@slachiewicz
slachiewicz merged commit 865768a into source Aug 8, 2026
14 checks passed
@slachiewicz
slachiewicz deleted the docs/apt-to-markdown branch August 8, 2026 20:30
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