Skip to content

Lead with Markdown in the site and plugin documentation guides - #1633

Open
slachiewicz wants to merge 3 commits into
apache:masterfrom
slachiewicz:lead-with-markdown
Open

Lead with Markdown in the site and plugin documentation guides#1633
slachiewicz wants to merge 3 commits into
apache:masterfrom
slachiewicz:lead-with-markdown

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Sits on top of #1632 — the first two commits here are that PR, since the plugin documentation guide has to be Markdown before its content can be rewritten. Review the last commit only; once #1632 merges this will rebase down to two files.

Two pieces of normative guidance still point new documentation at APT:

guides/mini/guide-site.md lists apt first and calls it the format "like this one" — which stopped being true when that guide itself became Markdown. It now lists markdown first, says plainly that new documentation should use it, and describes APT as a format that predates Maven's Markdown support: still supported, but the Maven project has moved its own documentation off it. Adds a pointer to doxia-converter for anyone converting an existing page.

guides/development/guide-plugin-documentation is the canonical instruction for documenting a plugin, and it gave a full APT template for src/site/apt/index.apt — so an author following it started in APT. It now shows the same page as src/site/markdown/index.md, with the YAML front matter that carries the title, author and date, plus a note about naming the file index.md.vm and keeping headings away from ## if the page needs Velocity.

One thing worth seeing: that guide is itself a Velocity template, and Velocity reads ## as a line comment even inside a fenced code block. The first version of this change silently lost ## Goals Overview and ## Usage from the rendered sample. It is now wrapped in #[[ ]]#. That only showed up because the built page was checked rather than the source.

Verified by building the site: the sample renders all its headings and no #[[ markup leaks into the page.

Kept as its own commit so that git log --follow and git blame still reach each
page's history once the content changes.
Six guides and the fragment one of them parses. Four keep their .vm suffix because
they interpolate a version or a path; guides/index.md.vm and guides/mini/index.md.vm
keep theirs for the #set and #parse directives that build the mini-guide list.

Three things the conversion needed by hand:

* Velocity reads ## as a line comment, so level two headings use a setext underline
  and deeper ones are wrapped in an unparsed block.
* APT writes $\{foo\} for a reference it means to display, and its parser strips
  the backslashes, so the converted page carried a live ${prefix}, ${groupId},
  ${user.home} and friends. Those are now ${esc.d}{foo}.
* mini/index.txt is parsed into a Markdown page, so its APT comments and link
  syntax had to become Markdown too, and it moves with the page that parses it.

Verified by building the site before and after and comparing all 265 generated
pages: 264 are identical in title, author and date metadata, visible text and every
link target. The one difference is that a Markdown table must have a header row
where the APT table had none, so two tables in the Java plugin guide gain an empty
one.
The site guide listed apt first and described it as the format 'like this one',
which stopped being true when that guide became Markdown. It now lists markdown
first, says plainly that new documentation should use it, and describes apt as a
format that predates Maven's Markdown support - still supported, but the Maven
project has moved its own documentation off it - with a pointer to doxia-converter.

The plugin documentation guide gave a full APT template for src/site/apt/index.apt,
so a plugin author following it started in APT. It now shows the same page as
src/site/markdown/index.md, and explains the front matter and the ## trap for
anyone whose page needs Velocity.

The sample is wrapped in an unparsed block: the guide is itself a Velocity
template, and without it Velocity reads the sample's own ## headings as line
comments and deletes them - which it did, until the built page was checked.
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.

1 participant