Class CodeBlock
java.lang.Object
org.tealeaf.javamarkdown.MarkdownElement
org.tealeaf.javamarkdown.types.Structure
org.tealeaf.javamarkdown.elements.CodeBlock
An element that displays its contents within a code block. It can display with syntax highlighting for a specific coding language as long as the markdown renderer supports it
- Since:
- 0.0.12
- Author:
- Thomas Kwashnak
-
Constructor Summary
-
Method Summary
Methods inherited from class org.tealeaf.javamarkdown.types.Structure
checkType, requiresNewlineAfter, requiresNewlineBefore
Methods inherited from class org.tealeaf.javamarkdown.MarkdownElement
asString, toAppendable, toString, toWriter
-
Constructor Details
-
CodeBlock
Creates a code block with the provided content
- Parameters:
content
- Content to put within the code block- Since:
- 0.0.12
-
CodeBlock
Creates a code block with the provided content and a given language
- Parameters:
language
- Name of the language to render incontent
- Content to put in the code block- Since:
- 0.0.12
-
-
Method Details
-
asString
Formats the element to a string- Specified by:
asString
in classMarkdownElement
- Returns:
- String representation of the formatted item
- Since:
- 0.0.12
-