Interface FrontMatterParser

All Known Implementing Classes:
RawContentParser, YamlSubsetParser

public interface FrontMatterParser
Parses the content of the front matter block between `---` separators. The implementations should add at least 1 child node to YamlFrontMatterBlock to store the result of the parsing.
  • Method Details

    • onNextLine

      void onNextLine(YamlFrontMatterBlock block, org.commonmark.parser.SourceLine line)
    • onEndingSeparator

      FrontMatterParser.SeparatorRole onEndingSeparator(YamlFrontMatterBlock block, org.commonmark.parser.SourceLine separator)
      Notifies about finding the line with the ending separator (`---` or `...`, without initial whitespace). Advanced parsers may be able to determine that the separator is a part of the single-/double-quoted multiline string and return FrontMatterParser.SeparatorRole.CONTENT to include it in the front matter content. In this case, front matter parsing continues until finding another separator. To end the parsing, return FrontMatterParser.SeparatorRole.BLOCK_END.
      Parameters:
      block - Main block node
      separator - `---` or `...`
      Returns:
      Separator role: block end or the part of the front matter content