You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2023/01/09 08:26:57 UTC

[maven-doxia-converter] 01/01: [DOXIATOOLS-74] add Markdown

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch DOXIATOOLS-74
in repository https://gitbox.apache.org/repos/asf/maven-doxia-converter.git

commit 8abdca5f9a8a88a82693f172bdb453c31917b04c
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sun Dec 4 18:14:19 2022 +0100

    [DOXIATOOLS-74] add Markdown
---
 pom.xml                                                    |  7 ++++++-
 src/main/java/org/apache/maven/doxia/DefaultConverter.java | 12 ++++++++----
 src/site/apt/index.apt                                     |  6 +++---
 src/site/apt/usage.apt.vm                                  | 12 ++++++------
 4 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/pom.xml b/pom.xml
index 960d526..c22fdc4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,7 +57,7 @@ under the License.
   </distributionManagement>
 
   <properties>
-    <doxiaVersion>1.11.1</doxiaVersion>
+    <doxiaVersion>1.12.0-SNAPSHOT</doxiaVersion>
     <javaVersion>8</javaVersion>
     <project.build.outputTimestamp>2020-03-14T00:00:00Z</project.build.outputTimestamp>
   </properties>
@@ -164,6 +164,11 @@ under the License.
       <artifactId>doxia-module-xhtml5</artifactId>
       <version>${doxiaVersion}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-module-markdown</artifactId>
+      <version>${doxiaVersion}</version>
+    </dependency>
     <!-- Misc -->
     <dependency>
       <groupId>commons-cli</groupId>
diff --git a/src/main/java/org/apache/maven/doxia/DefaultConverter.java b/src/main/java/org/apache/maven/doxia/DefaultConverter.java
index e6b7223..04f76b2 100644
--- a/src/main/java/org/apache/maven/doxia/DefaultConverter.java
+++ b/src/main/java/org/apache/maven/doxia/DefaultConverter.java
@@ -94,10 +94,12 @@ public class DefaultConverter
 
     private static final String XHTML5_PARSER = "xhtml5";
 
+    private static final String MARKDOWN_PARSER = "markdown";
+
     /** Supported input format, i.e. supported Doxia parser */
     public static final String[] SUPPORTED_FROM_FORMAT =
-        { APT_PARSER, CONFLUENCE_PARSER, DOCBOOK_PARSER, FML_PARSER, TWIKI_PARSER, XDOC_PARSER, XHTML_PARSER,
-                XHTML5_PARSER};
+        { APT_PARSER, CONFLUENCE_PARSER, DOCBOOK_PARSER, FML_PARSER, MARKDOWN_PARSER, TWIKI_PARSER,
+            XDOC_PARSER, XHTML_PARSER, XHTML5_PARSER };
 
     private static final String APT_SINK = "apt";
 
@@ -121,10 +123,12 @@ public class DefaultConverter
 
     private static final String XHTML5_SINK = "xhtml5";
 
+    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, RTF_SINK, TWIKI_SINK, XDOC_SINK,
-            XHTML_SINK, XHTML5_SINK };
+        { APT_SINK, CONFLUENCE_SINK, DOCBOOK_SINK, FO_SINK, ITEXT_SINK, LATEX_SINK, MARKDOWN_SINK, RTF_SINK, TWIKI_SINK,
+            XDOC_SINK, XHTML_SINK, XHTML5_SINK };
 
     /** Flag to format the generated files, actually only for XML based sinks. */
     private boolean formatOutput;
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index dd9aeae..9c0e43b 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -33,9 +33,9 @@ Doxia Converter
 
   Currently, the supported Doxia formats are:
 
-    * input format: apt, confluence, docbook, fml, twiki, xdoc, xhtml, xhtml5 or autodetect
+    * input format: <<<apt>>>, <<<confluence>>>, <<<docbook>>>, <<<fml>>>, <<<markdown>>>, <<<twiki>>>, <<<xdoc>>>, <<<xhtml>>>, <<<xhtml5>>> or <<<autodetect>>>
 
-    * output format: apt, confluence, docbook, fo, itext, latex, rtf, twiki, xdoc, xhtml, xhtml5
+    * output format: <<<apt>>>, <<<confluence>>>, <<<docbook>>>, <<<fo>>>, <<<itext>>>, <<<latex>>>, <<<markdown>>>, <<<rtf>>>, <<<twiki>>>, <<<xdoc>>>, <<<xhtml>>>, <<<xhtml5>>>
 
     []
 
@@ -44,5 +44,5 @@ Doxia Converter
 * Usage
 
   Doxia Converter can be conveniently used from the command-line,
-  or embedded in a java application.
+  or embedded in a Java application.
   Instructions on how to use the Doxia Converter can be found {{{./usage.html}here}}.
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index 1153e78..c3f1bef 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -34,7 +34,7 @@ Usage
 
 * Command Line Help
 
-+-----+
+-------
 # java -jar target/doxia-converter-${project.version}-jar-with-dependencies.jar -h
 
 usage: doxia-converter [options] -in <arg> [-from <arg>] [-inEncoding <arg>] -out
@@ -61,19 +61,19 @@ Supported Encoding:
 UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, Shift_JIS, ISO-2022-JP, ISO-2022-CN, ISO-2022-KR, GB18030, EUC-JP, EUC-KR, Big5,
 ISO-8859-1, ISO-8859-2, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8-I, ISO-8859-8, windows-1251, windows-1256, KOI8-R,
 ISO-8859-9, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr
-+-----+
+-------
 
  <<Note>>: The input parameters (i.e. encoding and format) can be autodetected.
 
 * Command Line Execution
 
-+-----+
+-------
 # java -jar target/doxia-converter-${project.version}-jar-with-dependencies.jar \
     -in /path/to/xhtml.file \
     -from xhtml \
     -out /path/to/outputdir \
     -to apt
-+-----+
+-------
 
   <<Note>>: The <<<from>>> parameter can be empty. In that case, Doxia converter tries to autodetect the <<<from>>>
   input from the <<<in>>> file parameter.
@@ -106,7 +106,7 @@ catch ( ConverterException e )
 
 * Ant Usage
 
-+---
++-----+
  <target name="doxia-convert">
      <java
          jar="./lib/doxia-converter-${project.version}-jar-with-dependencies.jar"
@@ -163,4 +163,4 @@ catch ( ConverterException e )
      <antcall target="doc.rtf" />
      <antcall target="doc.latex" />
  </target>
-+---
\ No newline at end of file
++-----+