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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the YAML front matter metadata, if the Markdown document has the front matter and the extension uses YamlSubsetParser (default).
    Returns the raw content of the front matter, if the Markdown document has the front matter and the extension uses RawContentParser.
    boolean
     
    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).
    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.
    void
    visit(org.commonmark.node.CustomNode customNode)
     

    Methods inherited from class org.commonmark.node.AbstractVisitor

    visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitChildren

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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()