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.commons.lang3.StringUtils; 022import org.apache.maven.doxia.markup.TextMarkup; 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 = StringUtils.repeat(String.valueOf(SPACE), 4); 043 // ---------------------------------------------------------------------- 044 // Markup syntax 045 // ---------------------------------------------------------------------- 046 047 /** Syntax for the anchor end: "\"></a>" */ 048 String ANCHOR_END_MARKUP = "\"></a>"; 049 050 /** Syntax for the anchor start: "<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 = StringUtils.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 link end: ")" */ 072 String LINK_END_MARKUP = ")"; 073 074 /** Syntax for the link start: "[" */ 075 String LINK_START_1_MARKUP = "["; 076 077 /** Syntax for the link start: "](" */ 078 String LINK_START_2_MARKUP = "]("; 079 080 /** Syntax for the ordered list item: '1. ' */ 081 String LIST_ORDERED_ITEM_START_MARKUP = "1. "; 082 083 /** Syntax for the unordered list item: "- " */ 084 String LIST_UNORDERED_ITEM_START_MARKUP = "- "; 085 086 /** Syntax for the mono-spaced style end: "`" */ 087 String MONOSPACED_END_MARKUP = "`"; 088 089 /** Syntax for the mono-spaced style start: "`" */ 090 String MONOSPACED_START_MARKUP = "`"; 091 092 /** Syntax for the verbatim start: "```" */ 093 String VERBATIM_START_MARKUP = "```"; 094 095 /** Syntax for the verbatim end: "```" */ 096 String VERBATIM_END_MARKUP = "```"; 097 098 /** Syntax for the blockquote start: "> " */ 099 String BLOCKQUOTE_START_MARKUP = "> "; 100 101 /** Syntax for the non breaking space: entity from HTML */ 102 String NON_BREAKING_SPACE_MARKUP = " "; 103 104 /** Syntax for the section title start: "#" */ 105 String SECTION_TITLE_START_MARKUP = "#"; 106 107 /* Table markup according to https://github.github.com/gfm/#tables-extension- */ 108 /** Syntax for the table cell start: "|" */ 109 String TABLE_CELL_SEPARATOR_MARKUP = String.valueOf(PIPE); 110 111 /** Syntax for the table column, left alignment (default): "---" */ 112 String TABLE_COL_LEFT_ALIGNED_MARKUP = StringUtils.repeat(String.valueOf(MINUS), 3); 113 114 /** Syntax for the table column, right alignment: "---:" */ 115 String TABLE_COL_RIGHT_ALIGNED_MARKUP = StringUtils.repeat(String.valueOf(MINUS), 3) + COLON; 116 117 /** Syntax for the table column, center alignment: ":---:" */ 118 String TABLE_COL_CENTER_ALIGNED_MARKUP = COLON + StringUtils.repeat(String.valueOf(MINUS), 3) + COLON; 119 120 /** Syntax for the table row prefix (the other separators in the same row are regular {@link #TABLE_CELL_SEPARATOR_MARKUP} characters) */ 121 String TABLE_ROW_PREFIX = String.valueOf(PIPE); 122}