Class CodeBlock


public class CodeBlock extends Structure

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 Details

    • CodeBlock

      public CodeBlock(Object content)

      Creates a code block with the provided content

      Parameters:
      content - Content to put within the code block
      Since:
      0.0.12
    • CodeBlock

      public CodeBlock(String language, Object content)

      Creates a code block with the provided content and a given language

      Parameters:
      language - Name of the language to render in
      content - Content to put in the code block
      Since:
      0.0.12
  • Method Details

    • asString

      public String asString()
      Formats the element to a string
      Specified by:
      asString in class MarkdownElement
      Returns:
      String representation of the formatted item
      Since:
      0.0.12