public interface Asciidoctor
extends java.lang.AutoCloseable
Modifier and Type | Interface and Description |
---|---|
static class |
Asciidoctor.Factory
Factory for creating a new instance of Asciidoctor interface.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asciidoctorVersion()
Method that gets the asciidoctor version which is being used..
|
default void |
close() |
void |
convert(java.io.Reader contentReader,
java.io.Writer rendererWriter,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
Use
convert(Reader, Writer, Options) instead. |
void |
convert(java.io.Reader contentReader,
java.io.Writer rendererWriter,
Options options)
Parse the document read from reader sending the converted result to
writer.
|
void |
convert(java.io.Reader contentReader,
java.io.Writer rendererWriter,
OptionsBuilder options)
Deprecated.
Use
convert(Reader, Writer, Options) instead. |
java.lang.String |
convert(java.lang.String content,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
User
convert(String, Options) instead. |
<T> T |
convert(java.lang.String content,
java.util.Map<java.lang.String,java.lang.Object> options,
java.lang.Class<T> expectedResult)
Deprecated.
Use
convert(String, Options, Class) instead. |
java.lang.String |
convert(java.lang.String content,
Options options)
Parse the AsciiDoc source input into an Document
Document and
convert it to the specified backend format. |
java.lang.String |
convert(java.lang.String content,
OptionsBuilder options)
Deprecated.
Use
convert(String, Options) instead. |
<T> T |
convert(java.lang.String content,
OptionsBuilder options,
java.lang.Class<T> expectedResult)
Deprecated.
Use
convert(String, Options, Class) instead. |
<T> T |
convert(java.lang.String content,
Options options,
java.lang.Class<T> expectedResult)
Parse the AsciiDoc source input into an Document
Document and
convert it to the specified backend format. |
java.lang.String[] |
convertDirectory(java.lang.Iterable<java.io.File> directoryWalker,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
Use
convertDirectory(Iterable, Options) instead. |
java.lang.String[] |
convertDirectory(java.lang.Iterable<java.io.File> directoryWalker,
Options options)
Convert all AsciiDoc files found in directoryWalker.
|
java.lang.String[] |
convertDirectory(java.lang.Iterable<java.io.File> directoryWalker,
OptionsBuilder options)
Deprecated.
Use
convertDirectory(Iterable, Options) instead. |
java.lang.String |
convertFile(java.io.File file,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
Use
convertFile(File, Options) instead. |
<T> T |
convertFile(java.io.File file,
java.util.Map<java.lang.String,java.lang.Object> options,
java.lang.Class<T> expectedResult)
Deprecated.
User
convertFile(File, Options, Class) instead. |
java.lang.String |
convertFile(java.io.File file,
Options options)
Parse the AsciiDoc source input into an Document
Document and
convert it to the specified backend format. |
java.lang.String |
convertFile(java.io.File file,
OptionsBuilder options)
Deprecated.
Use
convertFile(File, Options) instead. |
<T> T |
convertFile(java.io.File file,
OptionsBuilder options,
java.lang.Class<T> expectedResult)
Deprecated.
User
convertFile(File, Options, Class) instead. |
<T> T |
convertFile(java.io.File file,
Options options,
java.lang.Class<T> expectedResult)
Parse the AsciiDoc source input into an Document
Document and
convert it to the specified backend format. |
java.lang.String[] |
convertFiles(java.util.Collection<java.io.File> files,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
Use
convertFiles(Collection, Options) instead. |
java.lang.String[] |
convertFiles(java.util.Collection<java.io.File> asciidoctorFiles,
Options options)
Convert all files from a collection.
|
java.lang.String[] |
convertFiles(java.util.Collection<java.io.File> files,
OptionsBuilder options)
Deprecated.
Use
convertFiles(Collection, Options) instead. |
ExtensionGroup |
createGroup()
Creates an ExtensionGroup that can be used to register and unregister multiples extensions all at once.
|
ExtensionGroup |
createGroup(java.lang.String groupName)
Creates an ExtensionGroup that can be used to register and unregister multiples extensions all at once.
|
JavaConverterRegistry |
javaConverterRegistry()
Creates a registry for registering Java converters.
|
JavaExtensionRegistry |
javaExtensionRegistry()
Creates an extension registry ready to be used for registering Java extensions.
|
Document |
load(java.lang.String content,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
Use
load(String, Options) instead. |
Document |
load(java.lang.String content,
Options options)
Loads AsciiDoc content and returns the Document object.
|
Document |
loadFile(java.io.File file,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
Use
loadFile(File, Options) instead. |
Document |
loadFile(java.io.File file,
Options options)
Loads AsciiDoc content from file and returns the Document object.
|
DocumentHeader |
readDocumentHeader(java.io.File file)
Deprecated.
Use
loadFile(File, Map) instead. |
DocumentHeader |
readDocumentHeader(java.io.Reader contentReader)
Deprecated.
Use
loadFile(File, Map) instead. |
DocumentHeader |
readDocumentHeader(java.lang.String content)
Deprecated.
Use
load(String, Map) instead. |
void |
registerLogHandler(LogHandler logHandler)
Register a
LogHandler to capture Asciidoctor message records. |
void |
requireLibraries(java.util.Collection<java.lang.String> requiredLibraries)
Loads the given Ruby gem in requiredLibraries by name.
|
void |
requireLibrary(java.lang.String... requiredLibraries)
Loads the given Ruby gem(s) by name.
|
RubyExtensionRegistry |
rubyExtensionRegistry()
Creates an Ruby extension registry ready to be used for registering Ruby extension.
|
void |
shutdown()
This method frees all resources consumed by AsciidoctorJ module.
|
SyntaxHighlighterRegistry |
syntaxHighlighterRegistry()
Creates a registry for registering Java syntax highlighter.
|
void |
unregisterAllExtensions()
Unregister all registered extensions.
|
void |
unregisterLogHandler(LogHandler logHandler)
Unregister a
LogHandler . |
default <T> T |
unwrap(java.lang.Class<T> clazz) |
@Deprecated java.lang.String convert(java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> options)
convert(String, Options)
instead.Document
and
convert it to the specified backend format.
Accepts input as String object.
content
- the AsciiDoc source as String.options
- a Map of options to control processing (default: {}).@Deprecated <T> T convert(java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Class<T> expectedResult)
convert(String, Options, Class)
instead.Document
and
convert it to the specified backend format.
Accepts input as String object.
content
- the AsciiDoc source as String.options
- a Map of options to control processing (default: {}).expectedResult
- the expected return type. Usually String
for HTML based formats.
In this case convert(String, Map)
is the same.java.lang.String convert(java.lang.String content, Options options)
Document
and
convert it to the specified backend format.
Accepts input as String object.
content
- the AsciiDoc source as String.options
- options to control processing (default: empty).<T> T convert(java.lang.String content, Options options, java.lang.Class<T> expectedResult)
Document
and
convert it to the specified backend format.
Accepts input as String object.
content
- the AsciiDoc source as String.options
- options to control processing (default: empty).expectedResult
- the expected return type. Usually String
for HTML based formats.
In this case convert(String, Options)
is the same.@Deprecated java.lang.String convert(java.lang.String content, OptionsBuilder options)
convert(String, Options)
instead.Document
and
convert it to the specified backend format.
Accepts input as String object.
content
- the AsciiDoc source as String.options
- a Map of options to control processing (default: {}).@Deprecated <T> T convert(java.lang.String content, OptionsBuilder options, java.lang.Class<T> expectedResult)
convert(String, Options, Class)
instead.Document
and
convert it to the specified backend format.
Accepts input as String object.
content
- the AsciiDoc source as String.options
- a Map of options to control processing (default: {}).expectedResult
- the expected return type. Usually String
for HTML based formats.
In this case convert(String, OptionsBuilder)
is the same.@Deprecated void convert(java.io.Reader contentReader, java.io.Writer rendererWriter, java.util.Map<java.lang.String,java.lang.Object> options) throws java.io.IOException
convert(Reader, Writer, Options)
instead.contentReader
- where asciidoc content is read.rendererWriter
- where rendered content is written. Writer is flushed, but not
closed.options
- a Map of options to control processing (default: {}).java.io.IOException
- if an error occurs while writing rendered content, this
exception is thrown.void convert(java.io.Reader contentReader, java.io.Writer rendererWriter, Options options) throws java.io.IOException
contentReader
- where asciidoc content is read.rendererWriter
- where rendered content is written. Writer is flushed, but not
closed.options
- options to control processing (default: empty).java.io.IOException
- if an error occurs while writing rendered content, this
exception is thrown.@Deprecated void convert(java.io.Reader contentReader, java.io.Writer rendererWriter, OptionsBuilder options) throws java.io.IOException
convert(Reader, Writer, Options)
instead.contentReader
- where asciidoc content is read.rendererWriter
- where rendered content is written. Writer is flushed, but not
closed.options
- a Map of options to control processing (default: {}).java.io.IOException
- if an error occurs while writing rendered content, this
exception is thrown.@Deprecated java.lang.String convertFile(java.io.File file, java.util.Map<java.lang.String,java.lang.Object> options)
convertFile(File, Options)
instead.Document
and
convert it to the specified backend format.
Accepts input as File.
If the :in_place option is true, and the input is a File, the output is written to a file adjacent to the input file, having an extension that corresponds to the backend format. Otherwise, if the :to_file option is specified, the file is written to that file. If :to_file is not an absolute path, it is resolved relative to :to_dir, if given, otherwise the Document#base_dir. If the target directory does not exist, it will not be created unless the :mkdirs option is set to true. If the file cannot be written because the target directory does not exist, or because it falls outside of the Document#base_dir in safe mode, an IOError is raised.
file
- an input Asciidoctor file.options
- a Map of options to control processing (default: {}).@Deprecated <T> T convertFile(java.io.File file, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Class<T> expectedResult)
convertFile(File, Options, Class)
instead.Document
and
convert it to the specified backend format.
Accepts input as File.
If the :in_place option is true, and the input is a File, the output is written to a file adjacent to the input file, having an extension that corresponds to the backend format. Otherwise, if the :to_file option is specified, the file is written to that file. If :to_file is not an absolute path, it is resolved relative to :to_dir, if given, otherwise the Document#base_dir. If the target directory does not exist, it will not be created unless the :mkdirs option is set to true. If the file cannot be written because the target directory does not exist, or because it falls outside of the Document#base_dir in safe mode, an IOError is raised.
file
- an input Asciidoctor file.options
- a Map of options to control processing (default: {}).expectedResult
- the expected return type. Usually String
for HTML based formats.
In this case convertFile(File, Map)
is the same.java.lang.String convertFile(java.io.File file, Options options)
Document
and
convert it to the specified backend format.
Accepts input as File.
If the :in_place option is true, and the input is a File, the output is written to a file adjacent to the input file, having an extension that corresponds to the backend format. Otherwise, if the :to_file option is specified, the file is written to that file. If :to_file is not an absolute path, it is resolved relative to :to_dir, if given, otherwise the Document#base_dir. If the target directory does not exist, it will not be created unless the :mkdirs option is set to true. If the file cannot be written because the target directory does not exist, or because it falls outside of the Document#base_dir in safe mode, an IOError is raised.
file
- an input Asciidoctor file.options
- options to control processing (default: empty).<T> T convertFile(java.io.File file, Options options, java.lang.Class<T> expectedResult)
Document
and
convert it to the specified backend format.
Accepts input as File.
If the :in_place option is true, and the input is a File, the output is written to a file adjacent to the input file, having an extension that corresponds to the backend format. Otherwise, if the :to_file option is specified, the file is written to that file. If :to_file is not an absolute path, it is resolved relative to :to_dir, if given, otherwise the Document#base_dir. If the target directory does not exist, it will not be created unless the :mkdirs option is set to true. If the file cannot be written because the target directory does not exist, or because it falls outside of the Document#base_dir in safe mode, an IOError is raised.
file
- an input Asciidoctor file.options
- options to control processing (default: empty).expectedResult
- the expected return type. Usually String
for HTML based formats.
In this case convertFile(File, Map)
is the same.@Deprecated java.lang.String convertFile(java.io.File file, OptionsBuilder options)
convertFile(File, Options)
instead.Document
and
convert it to the specified backend format.
Accepts input as File.
If the :in_place option is true, and the input is a File, the output is written to a file adjacent to the input file, having an extension that corresponds to the backend format. Otherwise, if the :to_file option is specified, the file is written to that file. If :to_file is not an absolute path, it is resolved relative to :to_dir, if given, otherwise the Document#base_dir. If the target directory does not exist, it will not be created unless the :mkdirs option is set to true. If the file cannot be written because the target directory does not exist, or because it falls outside of the Document#base_dir in safe mode, an IOError is raised.
file
- an input Asciidoctor file.options
- a Map of options to control processing (default: {}).@Deprecated <T> T convertFile(java.io.File file, OptionsBuilder options, java.lang.Class<T> expectedResult)
convertFile(File, Options, Class)
instead.Document
and
convert it to the specified backend format.
Accepts input as File.
If the :in_place option is true, and the input is a File, the output is written to a file adjacent to the input file, having an extension that corresponds to the backend format. Otherwise, if the :to_file option is specified, the file is written to that file. If :to_file is not an absolute path, it is resolved relative to :to_dir, if given, otherwise the Document#base_dir. If the target directory does not exist, it will not be created unless the :mkdirs option is set to true. If the file cannot be written because the target directory does not exist, or because it falls outside of the Document#base_dir in safe mode, an IOError is raised.
file
- an input Asciidoctor file.options
- a Map of options to control processing (default: {}).expectedResult
- the expected return type. Usually String
for HTML based formats.
In this case convertFile(File, Map)
is the same.@Deprecated java.lang.String[] convertDirectory(java.lang.Iterable<java.io.File> directoryWalker, java.util.Map<java.lang.String,java.lang.Object> options)
convertDirectory(Iterable, Options)
instead.AsciiDocDirectoryWalker
for reference strategy.directoryWalker
- strategy used to retrieve all files to be rendered.options
- a Map of options to control processing (default: {}).java.lang.String[] convertDirectory(java.lang.Iterable<java.io.File> directoryWalker, Options options)
AsciiDocDirectoryWalker
for reference strategy.directoryWalker
- strategy used to retrieve all files to be rendered.options
- options to control processing (default: empty).@Deprecated java.lang.String[] convertDirectory(java.lang.Iterable<java.io.File> directoryWalker, OptionsBuilder options)
convertDirectory(Iterable, Options)
instead.AsciiDocDirectoryWalker
for reference strategy.directoryWalker
- strategy used to retrieve all files to be rendered.options
- a Map of options to control processing (default: {}).@Deprecated java.lang.String[] convertFiles(java.util.Collection<java.io.File> files, java.util.Map<java.lang.String,java.lang.Object> options)
convertFiles(Collection, Options)
instead.files
- to be converted.options
- a Map of options to control processing (default: {}).java.lang.String[] convertFiles(java.util.Collection<java.io.File> asciidoctorFiles, Options options)
asciidoctorFiles
- to be converted.options
- options to control processing (default: empty).@Deprecated java.lang.String[] convertFiles(java.util.Collection<java.io.File> files, OptionsBuilder options)
convertFiles(Collection, Options)
instead.files
- to be converted.options
- a Map of options to control processing (default: {}).void requireLibrary(java.lang.String... requiredLibraries)
requiredLibraries
- void requireLibraries(java.util.Collection<java.lang.String> requiredLibraries)
requiredLibraries
- @Deprecated DocumentHeader readDocumentHeader(java.io.File file)
loadFile(File, Map)
instead.file
- to read the attributes.@Deprecated DocumentHeader readDocumentHeader(java.lang.String content)
load(String, Map)
instead.content
- where converted content is written. Writer is flushed, but not
closed.@Deprecated DocumentHeader readDocumentHeader(java.io.Reader contentReader)
loadFile(File, Map)
instead.contentReader
- where asciidoc content is read.JavaExtensionRegistry javaExtensionRegistry()
RubyExtensionRegistry rubyExtensionRegistry()
JavaConverterRegistry javaConverterRegistry()
SyntaxHighlighterRegistry syntaxHighlighterRegistry()
This API is experimental and might change in an incompatible way in a minor version update!
ExtensionGroup createGroup()
ExtensionGroup createGroup(java.lang.String groupName)
groupName
- to assign to the ExtensionGroup.void unregisterAllExtensions()
void shutdown()
java.lang.String asciidoctorVersion()
@Deprecated Document load(java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> options)
load(String, Options)
instead.content
- to be parsed.options
- a Map of options to control processing (default: {}).Document load(java.lang.String content, Options options)
content
- to be parsed.options
- options to control processing (default: empty).@Deprecated Document loadFile(java.io.File file, java.util.Map<java.lang.String,java.lang.Object> options)
loadFile(File, Options)
instead.file
- to be parsed.options
- a Map of options to control processing (default: {}).Document loadFile(java.io.File file, Options options)
file
- to be parsed.options
- options to control processing (default: empty).void registerLogHandler(LogHandler logHandler)
LogHandler
to capture Asciidoctor message records.logHandler
- handler instance.void unregisterLogHandler(LogHandler logHandler)
LogHandler
.logHandler
- handler instance.default <T> T unwrap(java.lang.Class<T> clazz)
default void close()
close
in interface java.lang.AutoCloseable