You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Abel Salgado Romero (Jira)" <ji...@apache.org> on 2020/06/28 18:14:00 UTC
[jira] [Commented] (DOXIASITETOOLS-225) Support providing the
source reference to Doxia Parsers
[ https://issues.apache.org/jira/browse/DOXIASITETOOLS-225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147408#comment-17147408 ]
Abel Salgado Romero commented on DOXIASITETOOLS-225:
----------------------------------------------------
While working on the changes on the sitetools side, I found we have several elements we can pass as source reference.
The original idea was a simple string, but thinking it through:
* should it be full path? or relative path?
* split filename and parent path in different fields?
* should we support other sources (e.g. remote URL) as discussed?
I can think of 3 options, (1) expose the metadata using and interface in "doxia-core" and have for now a default implementation that returns the File.
{code:java}
interface SouceMetadata<T> {
T reference
}
{code}
(2) `org.apache.maven.doxia.parser.Parser` generic like
{code:java}
public interface Parser<T> {
void parse(Reader reader, Sink sink, T sourceMetadata) throws ParseException;
}
{code}
(3) combine both.
I preffer the second one, it offers total freedom to what info the parser can obtain. For example, during site generation could be something like a "FileSourceMetadata" containing 2 fields; the relative baseDir and the filename, or directly the File refence. For other types of sources, like remote url, just and URL.
> Support providing the source reference to Doxia Parsers
> -------------------------------------------------------
>
> Key: DOXIASITETOOLS-225
> URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-225
> Project: Maven Doxia Sitetools
> Issue Type: Improvement
> Components: Site renderer
> Affects Versions: 1.9.2
> Reporter: Herve Boutemy
> Priority: Major
>
> Doxia Sitetools part of the work started in DOXIA-614
--
This message was sent by Atlassian Jira
(v8.3.4#803005)