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

public interface MarkdownCompiler<T extends MarkdownCompiler<?>>

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 Details

    • append

      default T append(Object object)

      Appends any given object to the end of the document. Checks what type of object was passed and uses the correct method accordingly

      Parameters:
      object - Content to add to the end of the document
      Returns:
      An instance of the MarkdownCompiler used
      Since:
      0.0.14
      See Also:
    • appendMarkdownElement

      T appendMarkdownElement(MarkdownElement element)

      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

      T appendString(String string)

      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

      default T appendBold(Object content)

      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

      default T appendBulletList(Object[] objects)
      Since:
      0.0.15
    • appendBulletList

      default T appendBulletList(String name, Object[] objects)
      Since:
      0.0.15
    • appendBulletList

      default T appendBulletList(List<?> objects)
    • appendBulletList

      default T appendBulletList(Stream<?> stream)
      Since:
      0.0.15
    • appendBulletList

      default T appendBulletList(String name, List<?> objects)
      Since:
      0.0.15
    • appendBulletList

      default T appendBulletList(String name, Stream<?> stream)
      Since:
      0.0.15
    • appendCode

      default T appendCode(Object content)

      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 a MarkdownElement is passed in. If you really want to pass a MarkdownElement in, you can simply just use its toString() 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

      default T appendCodeBlock(Object content)

      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

      default T appendCodeBlock(String language, Object content)

      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 use
      content - The code to display in the code snippet
      Returns:
      This Compiler
      Since:
      0.0.15
    • appendHeader

      default T appendHeader(Object content)
    • appendHeader

      default T appendHeader(int level, Object content)
      Since:
      0.0.15
    • appendImage

      default T appendImage(String src)
      Since:
      0.0.15
    • appendImage

      default T appendImage(String content, String src)
      Since:
      0.0.15
    • appendStrikethrough

      default T appendStrikethrough(Object content)

      Appends content formatted as struck out

      Parameters:
      content - Content to strike out
      Returns:
      This instance of the compiler
      Since:
      0.0.15
    • appendItalic

      default T appendItalic(Object content)

      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

      default T appendLink(Object content, String url)
      Since:
      0.0.15
    • appendLink

      default T appendLink(String url)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(Object[] objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(String name, Object[] objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(int start, Object[] objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(String name, int start, Object[] objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(List<?> objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(Stream<?> stream)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(int start, List<?> objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(int start, Stream<?> stream)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(String name, List<?> objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(String name, Stream<?> stream)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(String name, int start, List<?> objects)
      Since:
      0.0.15
    • appendNumberedList

      default T appendNumberedList(String name, int start, Stream<?> stream)
      Since:
      0.0.15
    • appendTable

      default T appendTable(Object[] headers, Object[][] content)
      Since:
      0.0.15
    • appendTable

      default T appendTable(Object[] headers, Table.Alignment[] alignments, Object[][] content)
      Since:
      0.0.15