-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOXIASITETOOLS-324] Allow configuration of Doxia parser #126
Conversation
8537db0
to
6964db2
Compare
doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Show resolved
Hide resolved
* @since 2.0.0 | ||
*/ | ||
public ParserConfigurationRetriever getParserConfigurationRetriever() { | ||
if (parserConfigurationRetriever == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I stupid or why not just return the object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this is not supposed to return null ever (will clarify in the javadoc).
...ite-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderingContext.java
Outdated
Show resolved
Hide resolved
...ite-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderingContext.java
Outdated
Show resolved
Hide resolved
doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ParserConfiguration.java
Outdated
Show resolved
Hide resolved
084265d
to
025c2b2
Compare
I'll need a bit more time. I need to review this in tandem with the Maven Site Plugin PR. |
@michael-o Not sure why the build fails now, seems related to #124 but not sure why master is not affected. Maybe we can merge #124 first. Update: This wasn't related, rather the test cases need to be adjusted now that the default is generating anchors for indexable entries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first (incomplete) analysis: I believe that this has at least two design flaws:
- The matching is overengineered. We always operate on parser modules consistently, thus I would expect that a parser config applies on a per-module basis. A map holding the
moduleId
as key and the config as value are enough. - The parser config isn't flexible: Consider someone has its own parsing module or has replaced ours and their parsers have more config properties/options, a plain class with getters and setters in Maven Site Plugin won't be able to populate them. A map would also be appropriate here.
Let me know what you think...
You are probably right, a config mapping per id seems sufficient here.
Right, but changing it would either require to add something like |
Yes
About this, I need to think, but you are heading for that direction. I need more time. Can you make the first one happen as long as I think about the first one? |
ff22655
to
37267c0
Compare
@kwin Can you please double-check tests, they fail for me:
|
I know about the failing tests: #126 (comment) |
Though, #124 has been merged. Should I ignore this for now or do you want to address it first? |
@kwin Can you take care of the failing tests? I want to complete the review this month. |
There is some issues with the tests I have not fully understood yet (duplicate anchors). Therefore putting this PR back to draft modus. @michael-o Have you thought about using reflection or another way of configuring the parser? |
I have a few ideas, but am currently overloaded to dive in deeply. Hoping to complete this month. I think it might be worthwhile to ask @abelsromero as well for Asciidoctor extension. |
Superseded by #140 |
Requires #121