You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "michael-o (via GitHub)" <gi...@apache.org> on 2023/02/02 11:36:42 UTC

[GitHub] [maven-doxia-converter] michael-o commented on a diff in pull request #38: DOXIATOOLS-75 improved directory input support

michael-o commented on code in PR #38:
URL: https://github.com/apache/maven-doxia-converter/pull/38#discussion_r1094401251


##########
src/main/java/org/apache/maven/doxia/cli/CLIManager.java:
##########
@@ -159,8 +164,12 @@ private static String getSupportedFormatAndEncoding()
 
     private static String getSupportedFormat()
     {
-        return "\nSupported Formats:\n from: " + join( DefaultConverter.SUPPORTED_FROM_FORMAT, ", " )
-            + " or autodetect" + "\n to:   " + join( DefaultConverter.SUPPORTED_TO_FORMAT, ", " )
+        String fromFormats = EnumSet.allOf( DefaultConverter.ParserFormat.class ).stream()
+                .map( f -> f.toString().toLowerCase() ).collect( Collectors.joining( ", " ) );
+        String toFormats = EnumSet.allOf( DefaultConverter.SinkFormat.class ).stream()
+                .map( f -> f.toString().toLowerCase() ).collect( Collectors.joining( ", " ) );
+        return "\nSupported Formats:\n from: " + fromFormats
+            + " or " + AUTO_FORMAT + "\n to:   " + toFormats
             + "\n";

Review Comment:
   use system LS



##########
src/main/java/org/apache/maven/doxia/DefaultConverter.java:
##########
@@ -125,10 +120,172 @@
 
     private static final String MARKDOWN_SINK = "markdown";
 
-    /** Supported output format, i.e. supported Doxia Sink */
-    public static final String[] SUPPORTED_TO_FORMAT =
-        { APT_SINK, CONFLUENCE_SINK, DOCBOOK_SINK, FO_SINK, ITEXT_SINK, LATEX_SINK, MARKDOWN_SINK, RTF_SINK, TWIKI_SINK,
-            XDOC_SINK, XHTML_SINK, XHTML5_SINK };
+    /**
+     * All supported source formats
+     */
+    public enum ParserFormat
+    {
+        APT( APT_PARSER, "apt" ),
+        CONFLUENCE( CONFLUENCE_PARSER, "confluence" ),
+        DOCBOOK( DOCBOOK_PARSER, "xml", "article" ),
+        FML( FML_PARSER, "fml", "faqs" ),
+        TWIKI( TWIKI_PARSER, "twiki" ),
+        XDOC( XDOC_PARSER, "xml", "document" ),
+        XHTML( XHTML_PARSER, "html", "html" ),
+        XHTML5( XHTML5_PARSER, "html" ), // no autodetect support
+        MARKDOWN( MARKDOWN_PARSER, "md" );

Review Comment:
   Wouldn't it make sense to move Doxia 2.0 first before handling removed format?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org