Skip to content

Configure Doxia parsers per document - #1346

Open
slachiewicz wants to merge 9 commits into
apache:masterfrom
slachiewicz:carry-msite-1000
Open

slachiewicz wants to merge 9 commits into
apache:masterfrom
slachiewicz:carry-msite-1000

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Carries #177 by @kwin onto the 3.x line: his commit as authored, then our commits on top. Adds the parserConfigurations parameter to site:site, site:run and site:auto-refresh, which configures a Doxia parser per parser id and, optionally, per file pattern (glob: or regex:, matched against the absolute path). The first matching configuration wins.

On top of the carried commit:

  • Wiring for the 3.x mojos, including site:auto-refresh. The configurator now stays open for as long as site:run serves pages.
  • The parser id check in ParserConfigurationKey.matches was inverted, so a configuration applied to every parser except the one it named.
  • The <patterns> element is no longer passed to the parser, which rejected it as an unknown property.
  • Parser instances are shared between files, and the renderer resets emitComments and emitAnchorsForIndexableEntries only for files without a matching configuration. The configurator now resets both to the Site Plugin defaults before applying a configuration; any other property a configuration does not set keeps the value left by the previous file of the same parser id, which the parameter documentation states.
  • Unit tests and the MSITE-1000 IT. The user documentation goes to the site guide, Document the configuration of Doxia parsers in the site guide maven-site#1809; the plugin site links to it, and the parameter documentation keeps the details.

Not included: a * wildcard parser id, which was left out in the #177 review.

Please merge with "Rebase and merge" to keep Konrad as the author of his commit.

Fixes #1121


To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following:

@slachiewicz slachiewicz added the enhancement New feature or request label Nov 3, 2026
kwin and others added 7 commits November 4, 2026 12:08
This leverages PlexusConfigurator under the hood
Wire the configurator into site:auto-refresh, keep it open for the
lifetime of site:run and site:auto-refresh instead of closing it before
the rendered contexts are used, declare plexus-classworlds, and set
@SInCE to 3.23.0.
The id comparison was inverted, so a configuration applied to every
parser except the one it named. The patterns element is consumed by the
configurator and must not be handed to the parser, which rejects it as
an unknown property.
Configures markdown for a directory pattern and xdoc for all files and
checks in the rendered pages that only the matching files change.
Rewrite the parameter javadoc to the element layout the plugin accepts,
and add a short example page.
A regex: pattern sees the platform's separator, so the test failed on Windows. The docs now say so.
On macOS the regex PathMatcher compiles with Pattern.CANON_EQ, and JDK 8 cannot parse [/\\] followed by an escaped character under that flag (Unclosed character class). An alternation matches either separator everywhere.
The user documentation lives in the site guide; the parameter documentation keeps the details.
…uration

Doxia shares one parser instance between files, so a property set for an earlier file stayed set for the next file of the same parser id. emitComments and emitAnchorsForIndexableEntries now start from the Site Plugin defaults for every configured file; the parameter documentation says other properties persist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MSITE-1000] Allow parametrisation of Doxia parser per file

2 participants