Class YamlFrontMatterVisitor

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

public class YamlFrontMatterVisitor extends org.commonmark.node.AbstractVisitor
  • Constructor Details

    • YamlFrontMatterVisitor

      public YamlFrontMatterVisitor()
  • Method Details

    • readData

      public static Map<String, List<String>> readData(org.commonmark.node.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(org.commonmark.node.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(org.commonmark.node.CustomNode customNode)
      Specified by:
      visit in interface org.commonmark.node.Visitor
      Overrides:
      visit in class org.commonmark.node.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()