View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.doxia.module.apt;
20  
21  import org.apache.commons.lang3.StringUtils;
22  import org.apache.maven.doxia.markup.TextMarkup;
23  
24  /**
25   * This interface defines all markups and syntaxes used by the <b>APT</b> format.
26   *
27   * @see <a href="https://maven.apache.org/doxia/references/apt-format.html">https://maven.apache.org/doxia/references/apt-format.html</a>
28   * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
29   * @since 1.0
30   */
31  @SuppressWarnings("checkstyle:interfaceistype")
32  public interface AptMarkup extends TextMarkup {
33      // ----------------------------------------------------------------------
34      // Markup separators
35      // ----------------------------------------------------------------------
36  
37      /** APT backslash markup char: '\\' */
38      char BACKSLASH = '\\';
39  
40      /** APT comment markup char: '~' */
41      char COMMENT = '~';
42  
43      /** APT numbering decimal markup char: '1' */
44      char NUMBERING = '1';
45  
46      /** APT numbering lower alpha markup char: 'a' */
47      char NUMBERING_LOWER_ALPHA_CHAR = 'a';
48  
49      /** APT numbering lower roman markup char: 'i' */
50      char NUMBERING_LOWER_ROMAN_CHAR = 'i';
51  
52      /** APT numbering upper alpha markup char: 'A' */
53      char NUMBERING_UPPER_ALPHA_CHAR = 'A';
54  
55      /** APT numbering upper roman markup char: 'I' */
56      char NUMBERING_UPPER_ROMAN_CHAR = 'I';
57  
58      /** APT page break markup char: '\f' */
59      char PAGE_BREAK = '\f';
60  
61      /** APT percent markup char: '%' */
62      char PERCENT = '%';
63  
64      /** APT tab markup char: '\t' */
65      char TAB = '\t';
66  
67      // ----------------------------------------------------------------------
68      // Markup syntax
69      // ----------------------------------------------------------------------
70  
71      /** Syntax for the anchor end: "}" */
72      String ANCHOR_END_MARKUP = String.valueOf(RIGHT_CURLY_BRACKET);
73  
74      /** Syntax for the anchor start: "{" */
75      String ANCHOR_START_MARKUP = String.valueOf(LEFT_CURLY_BRACKET);
76  
77      /** Syntax for the bold style end: "&gt;&gt;" */
78      String BOLD_END_MARKUP = StringUtils.repeat(String.valueOf(GREATER_THAN), 2);
79  
80      /** Syntax for the bold style start: "&lt;&lt;" */
81      String BOLD_START_MARKUP = StringUtils.repeat(String.valueOf(LESS_THAN), 2);
82  
83      /** Syntax for the verbatim source start: "+------+" */
84      String VERBATIM_SOURCE_START_MARKUP = PLUS + StringUtils.repeat(String.valueOf(MINUS), 6) + PLUS;
85  
86      /** Syntax for the header start: " -----" */
87      String HEADER_START_MARKUP = SPACE + StringUtils.repeat(String.valueOf(MINUS), 5);
88  
89      /** Syntax for the horizontal rule: "========" */
90      String HORIZONTAL_RULE_MARKUP = StringUtils.repeat(String.valueOf(EQUAL), 8);
91  
92      /** Syntax for the italic style end: "&gt;" */
93      String ITALIC_END_MARKUP = String.valueOf(GREATER_THAN);
94  
95      /** Syntax for the italic style start: "&lt;" */
96      String ITALIC_START_MARKUP = String.valueOf(LESS_THAN);
97  
98      /** Syntax for the link end: "}}" */
99      String LINK_END_MARKUP = StringUtils.repeat(String.valueOf(RIGHT_CURLY_BRACKET), 2);
100 
101     /** Syntax for the link start: "{{{" */
102     String LINK_START_1_MARKUP = StringUtils.repeat(String.valueOf(LEFT_CURLY_BRACKET), 3);
103 
104     /** Syntax for the link start: "}" */
105     String LINK_START_2_MARKUP = String.valueOf(RIGHT_CURLY_BRACKET);
106 
107     /** Syntax for the list end: "[]" */
108     String LIST_END_MARKUP = String.valueOf(LEFT_SQUARE_BRACKET) + RIGHT_SQUARE_BRACKET;
109 
110     /** Syntax for the list start: "*" */
111     String LIST_START_MARKUP = String.valueOf(STAR);
112 
113     /** Syntax for the mono-spaced style end: "&gt;&gt;&gt;" */
114     String MONOSPACED_END_MARKUP = StringUtils.repeat(String.valueOf(GREATER_THAN), 3);
115 
116     /** Syntax for the mono-spaced style start: "&lt;&lt;&lt;" */
117     String MONOSPACED_START_MARKUP = StringUtils.repeat(String.valueOf(LESS_THAN), 3);
118 
119     /** Syntax for the verbatim start: "------" */
120     String VERBATIM_START_MARKUP = StringUtils.repeat(String.valueOf(MINUS), 6);
121 
122     /** Syntax for the non breaking space: "\ " */
123     String NON_BREAKING_SPACE_MARKUP = String.valueOf(BACKSLASH) + SPACE;
124 
125     /** Syntax for the page break: "\f" */
126     String PAGE_BREAK_MARKUP = String.valueOf(PAGE_BREAK);
127 
128     /** Syntax for the section title start: "*" */
129     String SECTION_TITLE_START_MARKUP = String.valueOf(STAR);
130 
131     /** Syntax for the table cell start: "|" */
132     String TABLE_CELL_SEPARATOR_MARKUP = String.valueOf(PIPE);
133 
134     /** Syntax for the table column, centered style: "-*" */
135     String TABLE_COL_CENTERED_ALIGNED_MARKUP = StringUtils.repeat(String.valueOf(MINUS), 2) + STAR;
136 
137     /** Syntax for the table column, left style: "-+" */
138     String TABLE_COL_LEFT_ALIGNED_MARKUP = StringUtils.repeat(String.valueOf(MINUS), 2) + PLUS;
139 
140     /** Syntax for the table column, right style: "-:" */
141     String TABLE_COL_RIGHT_ALIGNED_MARKUP = StringUtils.repeat(String.valueOf(MINUS), 2) + COLON;
142 
143     /** Syntax for the table row end: "|" */
144     String TABLE_ROW_SEPARATOR_MARKUP = String.valueOf(PIPE);
145 
146     /** Syntax for the table row start: "*--" */
147     String TABLE_ROW_START_MARKUP = STAR + StringUtils.repeat(String.valueOf(MINUS), 2);
148 
149     /** Syntax for the verbatim source end: "+------+" */
150     String VERBATIM_SOURCE_END_MARKUP = VERBATIM_SOURCE_START_MARKUP;
151 
152     /** Syntax for the verbatim end: "------" */
153     String VERBATIM_END_MARKUP = VERBATIM_START_MARKUP;
154 }