Interface MarkdownCompiler<T extends MarkdownCompiler<?>>
- Type Parameters:
T
- The class type to return in append methods. This should be the class inheriting this interface
- All Known Implementing Classes:
MarkdownBuffer
,MarkdownWriter
Implements methods used within any markdown compiler. Provides many shortcut methods for each markdown element that can be appended
- Since:
- 0.0.14
- Author:
- Thomas Kwashnak
-
Method Summary
Modifier and TypeMethodDescriptiondefault T
Appends any given object to the end of the document.default T
appendBold
(Object content) Displays provided content as bold.default T
appendBulletList
(Object[] objects) default T
appendBulletList
(String name, Object[] objects) default T
appendBulletList
(String name, List<?> objects) default T
appendBulletList
(String name, Stream<?> stream) default T
appendBulletList
(List<?> objects) default T
appendBulletList
(Stream<?> stream) default T
appendCode
(Object content) Displays provided content as short code snippetsdefault T
appendCodeBlock
(Object content) Displays a block of codedefault T
appendCodeBlock
(String language, Object content) Displays a block of code with syntax highlightingdefault T
appendHeader
(int level, Object content) default T
appendHeader
(Object content) default T
appendImage
(String src) default T
appendImage
(String content, String src) default T
appendItalic
(Object content) Appends text to the end of the compiler formatted as italicsdefault T
appendLink
(Object content, String url) default T
appendLink
(String url) appendMarkdownElement
(MarkdownElement element) Appends a markdown element to the end of the document.default T
appendNumberedList
(int start, Object[] objects) default T
appendNumberedList
(int start, List<?> objects) default T
appendNumberedList
(int start, Stream<?> stream) default T
appendNumberedList
(Object[] objects) default T
appendNumberedList
(String name, int start, Object[] objects) default T
appendNumberedList
(String name, int start, List<?> objects) default T
appendNumberedList
(String name, int start, Stream<?> stream) default T
appendNumberedList
(String name, Object[] objects) default T
appendNumberedList
(String name, List<?> objects) default T
appendNumberedList
(String name, Stream<?> stream) default T
appendNumberedList
(List<?> objects) default T
appendNumberedList
(Stream<?> stream) default T
appendStrikethrough
(Object content) Appends content formatted as struck outappendString
(String string) Appends a string to the end of the document.default T
appendTable
(Object[] headers, Object[][] content) default T
appendTable
(Object[] headers, Table.Alignment[] alignments, Object[][] content)
-
Method Details
-
append
Appends any given object to the end of the document. Checks what type of object was passed and uses the correct method accordingly
- If the object provided extends the
MarkdownElement
class, then this method will useappendMarkdownElement(MarkdownElement)
to handle adding the element to the document. - Otherwise, this method will use
appendString(String)
and pass theObject.toString()
result as the string.
- Parameters:
object
- Content to add to the end of the document- Returns:
- An instance of the MarkdownCompiler used
- Since:
- 0.0.14
- See Also:
- If the object provided extends the
-
appendMarkdownElement
Appends a markdown element to the end of the document. Adjusts and manages new lines depending on the requirements set by the Markdown Element
- Parameters:
element
- Markdown Element to add to the end of the document- Returns:
- An instance of the MarkdownCompiler used
- Since:
- 0.0.14
- See Also:
-
appendString
Appends a string to the end of the document.
- Parameters:
string
- String to append to the end of the document- Returns:
- An instance of the MarkdownCompiler used
- Since:
- 0.0.14
-
appendBold
Displays provided content as bold.
Wraps the content provided in
~
- Parameters:
content
- The content to be displayed in bold- Returns:
- This MarkdownCompiler
- Since:
- 0.0.15
-
appendBulletList
- Since:
- 0.0.15
-
appendBulletList
- Since:
- 0.0.15
-
appendBulletList
-
appendBulletList
- Since:
- 0.0.15
-
appendBulletList
- Since:
- 0.0.15
-
appendBulletList
- Since:
- 0.0.15
-
appendCode
Displays provided content as short code snippets
These code snippets are typically displayed in a monospace font and have a grey background
This will throw an
IllegalContentsException
if aMarkdownElement
is passed in. If you really want to pass aMarkdownElement
in, you can simply just use itstoString()
method to convert it to a String first.- Parameters:
content
- The content to display within the code snippet.- Returns:
- This Compiler
- Since:
- 0.0.15
-
appendCodeBlock
Displays a block of code
These code blocks are typically displayed in a monospace font and have a grey background
- Parameters:
content
- The code to display in the code snippet- Returns:
- This Compiler
- Since:
- 0.0.15
-
appendCodeBlock
Displays a block of code with syntax highlighting
These code blocks are typically displayed in a monospaced font and have a grey background. Indentation is also displayed
- Parameters:
language
- The syntax highlighting language to usecontent
- The code to display in the code snippet- Returns:
- This Compiler
- Since:
- 0.0.15
-
appendHeader
-
appendHeader
- Since:
- 0.0.15
-
appendImage
- Since:
- 0.0.15
-
appendImage
- Since:
- 0.0.15
-
appendStrikethrough
Appends content formatted as struck out
- Parameters:
content
- Content to strike out- Returns:
- This instance of the compiler
- Since:
- 0.0.15
-
appendItalic
Appends text to the end of the compiler formatted as italics
- Parameters:
content
- The content you wish to be formatted in italics- Since:
- 0.0.15
-
appendLink
- Since:
- 0.0.15
-
appendLink
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendNumberedList
- Since:
- 0.0.15
-
appendTable
- Since:
- 0.0.15
-
appendTable
- Since:
- 0.0.15
-