Skip to content

Document the configuration of Doxia parsers in the site guide - #1809

Open
slachiewicz wants to merge 2 commits into
apache:masterfrom
slachiewicz:configuring-parsers
Open

slachiewicz wants to merge 2 commits into
apache:masterfrom
slachiewicz:configuring-parsers

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Adds a "Configuring Parsers" section to the site guide for the parserConfigurations parameter that apache/maven-site-plugin#1346 (MSITE-1000) adds in Maven Site Plugin 3.23.0, which links here. Merge it once 3.23.0 is released.

The regex: advice comes from a CI failure on that PR: on macOS the regex path matcher compiles with Pattern.CANON_EQ, and Java 8 rejects [/\\] followed by an escaped character under that flag.

@slachiewicz slachiewicz added the documentation Improvements or additions to documentation label Nov 4, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 4, 2026 13:04

## Configuring Parsers

The Maven Site Plugin renders every source file with the [Doxia](/doxia/) parser for its format. Since version 3.23.0 of the Maven Site Plugin, the [`parserConfigurations`](/plugins/maven-site-plugin/site-mojo.html#parserConfigurations) parameter sets properties of these parsers, for all files of a format or only for files at a given path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to read the sentence "The Maven Site Plugin renders every source file with the Doxia parser for its format." before I realized what it was saying. I suggest something like

The Maven Site Plugin converts every source file to HTML using the Doxia parser for the source file's format (markdown, xdoc, apt and so on).

</plugin>
```

In this example, comments in Markdown files below a `drafts` directory and in all XDoc files end up in the generated HTML. Other Markdown files keep the default of the Maven Site Plugin and drop their comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

below --> inside

A pattern starts with `glob:` or `regex:` and is matched against the absolute path of the source file:

- A `glob:` pattern separates directories with `/` on every platform.
- A `regex:` pattern sees the platform's own separator, `\` on Windows. To work on every platform, accept both with an alternation, such as `regex:.*(/|\\)drafts(/|\\).*\.md`. Avoid a character class such as `[/\\]` followed by an escaped character: on macOS with Java 8 such a pattern fails to compile.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels wrong. There should be one syntax that works across platforms. Maybe an additional layer of indirection is needed here so the regex doesn't apply directly to platform dependent paths

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it works now..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is the problem in doxia or somewhere else? where does this need to be improved?

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.

2 participants