Skip to content

Commit a1ad9b5

Browse files
committed
[DOXIA-569] add Markdown sink implementation
1 parent 24f0066 commit a1ad9b5

File tree

23 files changed

+1816
-20
lines changed

23 files changed

+1816
-20
lines changed

doxia-core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<groupId>org.apache.maven.doxia</groupId>
2727
<artifactId>doxia</artifactId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-logging-api/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<artifactId>doxia</artifactId>
2727
<groupId>org.apache.maven.doxia</groupId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-modules/doxia-module-apt/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<artifactId>doxia-modules</artifactId>
2727
<groupId>org.apache.maven.doxia</groupId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-modules/doxia-module-confluence/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ under the License.
2323
<parent>
2424
<artifactId>doxia-modules</artifactId>
2525
<groupId>org.apache.maven.doxia</groupId>
26-
<version>1.11.2-SNAPSHOT</version>
26+
<version>1.12.0-SNAPSHOT</version>
2727
<relativePath>../pom.xml</relativePath>
2828
</parent>
2929

doxia-modules/doxia-module-docbook-simple/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<artifactId>doxia-modules</artifactId>
2727
<groupId>org.apache.maven.doxia</groupId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-modules/doxia-module-fml/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<artifactId>doxia-modules</artifactId>
2727
<groupId>org.apache.maven.doxia</groupId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-modules/doxia-module-fo/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<artifactId>doxia-modules</artifactId>
2727
<groupId>org.apache.maven.doxia</groupId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-modules/doxia-module-itext/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<artifactId>doxia-modules</artifactId>
2727
<groupId>org.apache.maven.doxia</groupId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-modules/doxia-module-latex/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<artifactId>doxia-modules</artifactId>
2727
<groupId>org.apache.maven.doxia</groupId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

doxia-modules/doxia-module-markdown/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ under the License.
2525
<parent>
2626
<groupId>org.apache.maven.doxia</groupId>
2727
<artifactId>doxia-modules</artifactId>
28-
<version>1.11.2-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
package org.apache.maven.doxia.module.markdown;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
import org.apache.maven.doxia.markup.TextMarkup;
23+
import org.codehaus.plexus.util.StringUtils;
24+
25+
/**
26+
* This interface defines all markups and syntaxes used by the <b>Markdown</b> format.
27+
*/
28+
@SuppressWarnings( "checkstyle:interfaceistype" )
29+
public interface MarkdownMarkup
30+
extends TextMarkup
31+
{
32+
// ----------------------------------------------------------------------
33+
// Markup separators
34+
// ----------------------------------------------------------------------
35+
36+
/** backslash markup char: '\\' */
37+
char BACKSLASH = '\\';
38+
39+
String COMMENT_START = "<!-- ";
40+
String COMMENT_END = " -->";
41+
42+
/** numbering decimal markup char: '1' */
43+
char NUMBERING = '1';
44+
45+
/** numbering lower alpha markup char: 'a' */
46+
char NUMBERING_LOWER_ALPHA_CHAR = 'a';
47+
48+
/** numbering lower roman markup char: 'i' */
49+
char NUMBERING_LOWER_ROMAN_CHAR = 'i';
50+
51+
/** numbering upper alpha markup char: 'A' */
52+
char NUMBERING_UPPER_ALPHA_CHAR = 'A';
53+
54+
/** numbering upper roman markup char: 'I' */
55+
char NUMBERING_UPPER_ROMAN_CHAR = 'I';
56+
57+
/** page break markup char: '\f' */
58+
char PAGE_BREAK = '\f';
59+
60+
// ----------------------------------------------------------------------
61+
// Markup syntax
62+
// ----------------------------------------------------------------------
63+
64+
/** Syntax for the anchor end: "\"></a>" */
65+
String ANCHOR_END_MARKUP = "\"></a>";
66+
67+
/** Syntax for the anchor start: "<a name=\"" */
68+
String ANCHOR_START_MARKUP = "<a name=\"";
69+
70+
/** Syntax for the bold style end: "**" */
71+
String BOLD_END_MARKUP = "**";
72+
73+
/** Syntax for the bold style start: "**" */
74+
String BOLD_START_MARKUP = "**";
75+
76+
/** Syntax for the header start: "---" */
77+
String METADATA_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 3 );
78+
79+
/** Syntax for the horizontal rule: "========" */
80+
String HORIZONTAL_RULE_MARKUP = StringUtils.repeat( String.valueOf( EQUAL ), 8 );
81+
82+
/** Syntax for the italic style end: "_" */
83+
String ITALIC_END_MARKUP = "_";
84+
85+
/** Syntax for the italic style start: "_" */
86+
String ITALIC_START_MARKUP = "_";
87+
88+
/** Syntax for the link end: ")" */
89+
String LINK_END_MARKUP = ")";
90+
91+
/** Syntax for the link start: "[" */
92+
String LINK_START_1_MARKUP = "[";
93+
94+
/** Syntax for the link start: "](" */
95+
String LINK_START_2_MARKUP = "](";
96+
97+
/** Syntax for the list start: "-" */
98+
String LIST_START_MARKUP = "-";
99+
100+
/** Syntax for the mono-spaced style end: "`" */
101+
String MONOSPACED_END_MARKUP = "`";
102+
103+
/** Syntax for the mono-spaced style start: "`" */
104+
String MONOSPACED_START_MARKUP = "`";
105+
106+
/** Syntax for the non boxed verbatim start: "```" */
107+
String NON_BOXED_VERBATIM_START_MARKUP = "```";
108+
109+
/** Syntax for the non breaking space: "\ " */
110+
String NON_BREAKING_SPACE_MARKUP = String.valueOf( BACKSLASH ) + SPACE;
111+
112+
/** Syntax for the page break: "\f" */
113+
String PAGE_BREAK_MARKUP = String.valueOf( PAGE_BREAK );
114+
115+
/** Syntax for the section title start: "#" */
116+
String SECTION_TITLE_START_MARKUP = "#";
117+
118+
/** Syntax for the table cell start: "|" */
119+
String TABLE_CELL_SEPARATOR_MARKUP = String.valueOf( PIPE );
120+
121+
/** Syntax for the table column, centered style: "---|" */
122+
String TABLE_COL_DEFAULT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 3 ) + PIPE;
123+
124+
/** Syntax for the table column, left style: "---+" */
125+
String TABLE_COL_LEFT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 3 ) + PLUS;
126+
127+
/** Syntax for the table column, right style: "---:" */
128+
String TABLE_COL_RIGHT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 3 ) + COLON;
129+
130+
/** Syntax for the table row end: "|" */
131+
String TABLE_ROW_SEPARATOR_MARKUP = String.valueOf( PIPE );
132+
133+
/** Syntax for the non boxed verbatim end: "```" */
134+
String NON_BOXED_VERBATIM_END_MARKUP = "```";
135+
}

0 commit comments

Comments
 (0)