All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.commonmark.ext.front.matter.YamlFrontMatterExtension Maven / Gradle / Ivy

There is a newer version: 0.17.0
Show newest version
package org.commonmark.ext.front.matter;

import org.commonmark.Extension;
import org.commonmark.ext.front.matter.internal.YamlFrontMatterBlockParser;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;

/**
 * Extension for YAML-like metadata.
 * 

* Create it with {@link #create()} and then configure it on the builders * ({@link org.commonmark.parser.Parser.Builder#extensions(Iterable)}, * {@link HtmlRenderer.Builder#extensions(Iterable)}). *

*

* The parsed metadata is turned into {@link YamlFrontMatterNode}. You can access the metadata using {@link YamlFrontMatterVisitor}. *

*/ public class YamlFrontMatterExtension implements Parser.ParserExtension { private YamlFrontMatterExtension() { } @Override public void extend(Parser.Builder parserBuilder) { parserBuilder.customBlockParserFactory(new YamlFrontMatterBlockParser.Factory()); } public static Extension create() { return new YamlFrontMatterExtension(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy