Class YamlFrontMatterVisitor

java.lang.Object
org.commonmark.node.AbstractVisitor
org.commonmark.ext.front.matter.YamlFrontMatterVisitor
All Implemented Interfaces:
Visitor

public class YamlFrontMatterVisitor extends AbstractVisitor
  • Field Details

  • Constructor Details

    • YamlFrontMatterVisitor

      public YamlFrontMatterVisitor()
  • Method Details

    • readData

      public static Map<String,List<String>> readData(Node document)
      Reads the YAML front matter metadata, if the Markdown document has the front matter and the extension uses YamlSubsetParser (default).
      Returns:
      The data stored in YAML front matter or empty map.
    • readRawContent

      public static String readRawContent(Node document)
      Reads the raw content of the front matter, if the Markdown document has the front matter and the extension uses RawContentParser.
      Returns:
      Raw content of the front matter as string or empty string.
    • visit

      public void visit(CustomNode customNode)
      Specified by:
      visit in interface Visitor
      Overrides:
      visit in class AbstractVisitor
    • getData

      public Map<String,List<String>> getData()
      Returns the YAML front matter metadata, if the Markdown document has the front matter and the extension uses YamlSubsetParser (default).
      Returns:
      The data stored in YAML front matter or empty map
    • getRawContent

      public String getRawContent()
      Returns the raw content of the front matter, if the Markdown document has the front matter and the extension uses RawContentParser.
      Returns:
      Raw content of the front matter as string or empty string.
    • isFrontMatterPresent

      public boolean isFrontMatterPresent()