001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.maven.doxia.module.markdown;
020
021import org.apache.maven.doxia.markup.TextMarkup;
022import org.apache.maven.doxia.util.DoxiaStringUtils;
023
024/**
025 * This interface defines all markups and syntaxes used by the <b>Markdown</b> format.
026 */
027@SuppressWarnings("checkstyle:interfaceistype")
028public interface MarkdownMarkup extends TextMarkup {
029    // ----------------------------------------------------------------------
030    // Markup separators
031    // ----------------------------------------------------------------------
032
033    /** backslash markup char: '\\' */
034    char BACKSLASH = '\\';
035
036    String COMMENT_START = "<!-- ";
037    String COMMENT_END = " -->";
038
039    String BLANK_LINE = EOL + EOL;
040
041    /** indentation e.g. for paragraphs inside lists */
042    String INDENT = DoxiaStringUtils.repeat(String.valueOf(SPACE), 4);
043    // ----------------------------------------------------------------------
044    // Markup syntax
045    // ----------------------------------------------------------------------
046
047    /** Syntax for the anchor end: "\"&gt;&lt;/a&gt;" */
048    String ANCHOR_END_MARKUP = "\"></a>";
049
050    /** Syntax for the anchor start: "&lt;a id=\"" */
051    String ANCHOR_START_MARKUP = "<a id=\"";
052
053    /** Syntax for the bold style end: "**" */
054    String BOLD_END_MARKUP = "**";
055
056    /** Syntax for the bold style start: "**" */
057    String BOLD_START_MARKUP = "**";
058
059    /** Syntax for the header start: "---" */
060    String METADATA_MARKUP = DoxiaStringUtils.repeat(String.valueOf(MINUS), 3);
061
062    /** Syntax for the horizontal rule: "***" */
063    String HORIZONTAL_RULE_MARKUP = "***";
064
065    /** Syntax for the italic style end: "_" */
066    String ITALIC_END_MARKUP = "_";
067
068    /** Syntax for the italic style start: "_" */
069    String ITALIC_START_MARKUP = "_";
070
071    /** Syntax for the strikethrough style end: "~~", https://github.github.com/gfm/#strikethrough-extension- */
072    String STRIKETHROUGH_END_MARKUP = "~~";
073
074    /** Syntax for the strikethrough style start: "~~", https://github.github.com/gfm/#strikethrough-extension- */
075    String STRIKETHROUGH_START_MARKUP = "~~";
076
077    /** Syntax for the link end: ")" */
078    String LINK_END_MARKUP = ")";
079
080    /** Syntax for the link start: "[" */
081    String LINK_START_1_MARKUP = "[";
082
083    /** Syntax for the link start: "](" */
084    String LINK_START_2_MARKUP = "](";
085
086    /** Syntax for the ordered list item: '1. ' */
087    String LIST_ORDERED_ITEM_START_MARKUP = "1. ";
088
089    /** Syntax for the unordered list item: "- " */
090    String LIST_UNORDERED_ITEM_START_MARKUP = "- ";
091
092    /** Syntax for the mono-spaced style end: "`" */
093    String MONOSPACED_END_MARKUP = "`";
094
095    /** Syntax for the mono-spaced style start: "`" */
096    String MONOSPACED_START_MARKUP = "`";
097
098    /** Syntax for the verbatim start: "```" */
099    String VERBATIM_START_MARKUP = "```";
100
101    /** Syntax for the verbatim end: "```" */
102    String VERBATIM_END_MARKUP = "```";
103
104    /** Syntax for the blockquote start: "&gt; " */
105    String BLOCKQUOTE_START_MARKUP = "> ";
106
107    /** Syntax for the non breaking space: entity from HTML */
108    String NON_BREAKING_SPACE_MARKUP = "&nbsp;";
109
110    /** Syntax for the section title start: "#" */
111    String SECTION_TITLE_START_MARKUP = "#";
112
113    /* Table markup according to https://github.github.com/gfm/#tables-extension- */
114    /** Syntax for the table cell start: "|" */
115    String TABLE_CELL_SEPARATOR_MARKUP = String.valueOf(PIPE);
116
117    /** Syntax for the table column, default alignment (default): "---" */
118    String TABLE_COL_DEFAULT_ALIGNED_MARKUP = DoxiaStringUtils.repeat(String.valueOf(MINUS), 3);
119
120    /** Syntax for the table column, left alignment (default): ":---" */
121    String TABLE_COL_LEFT_ALIGNED_MARKUP = COLON + DoxiaStringUtils.repeat(String.valueOf(MINUS), 3);
122
123    /** Syntax for the table column, right alignment: "---:" */
124    String TABLE_COL_RIGHT_ALIGNED_MARKUP = DoxiaStringUtils.repeat(String.valueOf(MINUS), 3) + COLON;
125
126    /** Syntax for the table column, center alignment: ":---:" */
127    String TABLE_COL_CENTER_ALIGNED_MARKUP = COLON + DoxiaStringUtils.repeat(String.valueOf(MINUS), 3) + COLON;
128
129    /** Syntax for the table row prefix (the other separators in the same row are regular {@link #TABLE_CELL_SEPARATOR_MARKUP} characters) */
130    String TABLE_ROW_PREFIX = String.valueOf(PIPE);
131}