Class Engines
- java.lang.Object
-
- org.jbake.parser.Engines
-
public class Engines extends java.lang.ObjectA singleton class giving access to markup engines. Markup engines are loaded based on classpath. New engines may be registered either at runtime (not recommanded) or by putting a descriptor file on classpath (recommanded).
The descriptor file must be found in META-INF directory and named org.jbake.parser.MarkupEngines.properties. The format of the file is easy:
org.jbake.parser.RawMarkupEngine=html
org.jbake.parser.AsciidoctorEngine=ad,adoc,asciidoc
org.jbake.parser.MarkdownEngine=md
where the key is the class of the engine (must extend
MarkupEngineand have a no-arg constructor and the value is a comma-separated list of file extensions that this engine is capable of proceeding.Markup engines are singletons, so are typically used to initialize the underlying renderning engines. They must not store specific information of a currently processed file (use
This class loads the engines only if they are found on classpath. If not, the engine is not registered. This allows JBake to support multiple rendering engines without the explicit need to have them on classpath. This is a better fit for embedding.the parser contextfor that).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ParserEngineget(java.lang.String fileExtension)static java.util.Set<java.lang.String>getRecognizedExtensions()static voidregister(java.lang.String fileExtension, ParserEngine engine)
-
-
-
Method Detail
-
get
public static ParserEngine get(java.lang.String fileExtension)
-
register
public static void register(java.lang.String fileExtension, ParserEngine engine)
-
getRecognizedExtensions
public static java.util.Set<java.lang.String> getRecognizedExtensions()
-
-