Class JRubyAsciidoctor
- All Implemented Interfaces:
AutoCloseable,Asciidoctor,AsciidoctorJRuby,LogHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.asciidoctor.jruby.AsciidoctorJRuby
AsciidoctorJRuby.Factory -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMethod that gets the asciidoctor version which is being used..voidclose()voidParse the document read from reader sending the converted result to writer.voidParse the document read from reader sending the converted result to writer.voidconvert(Reader contentReader, Writer rendererWriter, OptionsBuilder options) Parse the document read from reader sending the converted result to writer.Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.<T> TParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.convert(String content, OptionsBuilder options) Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.<T> Tconvert(String content, OptionsBuilder options, Class<T> expectedResult) Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.<T> TParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.String[]Convert all AsciiDoc files found in directoryWalker.String[]convertDirectory(Iterable<File> directoryWalker, Options options) Convert all AsciiDoc files found in directoryWalker.String[]convertDirectory(Iterable<File> directoryWalker, OptionsBuilder options) Convert all AsciiDoc files found in directoryWalker.convertFile(File file, Map<String, Object> options) Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.<T> TParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.convertFile(File file, Options options) Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.convertFile(File file, OptionsBuilder options) Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.<T> TconvertFile(File file, OptionsBuilder options, Class<T> expectedResult) Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.<T> TconvertFile(File file, Options options, Class<T> expectedResult) Parse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.String[]convertFiles(Collection<File> files, Map<String, Object> options) Convert all files from a collection.String[]convertFiles(Collection<File> asciidoctorFiles, Options options) Convert all files from a collection.String[]convertFiles(Collection<File> files, OptionsBuilder options) Convert all files from a collection.static JRubyAsciidoctorcreate()static JRubyAsciidoctorcreate(ClassLoader classloader) static JRubyAsciidoctorcreate(ClassLoader classloader, String gemPath) static JRubyAsciidoctorstatic JRubyAsciidoctorstatic JRubyAsciidoctorCreates an ExtensionGroup that can be used to register and unregister multiples extensions all at once.createGroup(String groupName) Creates an ExtensionGroup that can be used to register and unregister multiples extensions all at once.org.jruby.RubyCreates a registry for registering Java converters.Creates an extension registry ready to be used for registering Java extensions.Loads AsciiDoc content and returns the Document object.Loads AsciiDoc content and returns the Document object.Loads AsciiDoc content from file and returns the Document object.Loads AsciiDoc content from file and returns the Document object.voidProcess a log record.readDocumentHeader(File file) Reads only header parameters instead of all document.readDocumentHeader(Reader contentReader) Reads only header parameters instead of all document.readDocumentHeader(String content) Reads only header parameters instead of all document.voidregisterLogHandler(LogHandler logHandler) Register aLogHandlerto capture Asciidoctor message records.voidrequireLibraries(Collection<String> libraries) Loads the given Ruby gem in requiredLibraries by name.voidrequireLibrary(String... library) Loads the given Ruby gem(s) by name.Creates an Ruby extension registry ready to be used for registering Ruby extension.voidshutdown()This method frees all resources consumed by AsciidoctorJ module.Creates a registry for registering Java syntax highlighter.voidUnregister all registered extensions.voidunregisterLogHandler(LogHandler logHandler) Unregister aLogHandler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.asciidoctor.Asciidoctor
unwrap
-
Field Details
-
rubyGemsPreloader
-
rubyRuntime
protected org.jruby.Ruby rubyRuntime
-
-
Constructor Details
-
JRubyAsciidoctor
public JRubyAsciidoctor()
-
-
Method Details
-
create
-
create
-
create
-
create
-
create
-
create
-
close
public void close()- Specified by:
closein interfaceAsciidoctor- Specified by:
closein interfaceAutoCloseable
-
registerLogHandler
Description copied from interface:AsciidoctorRegister aLogHandlerto capture Asciidoctor message records.- Specified by:
registerLogHandlerin interfaceAsciidoctor- Parameters:
logHandler- handler instance.
-
unregisterLogHandler
Description copied from interface:AsciidoctorUnregister aLogHandler.- Specified by:
unregisterLogHandlerin interfaceAsciidoctor- Parameters:
logHandler- handler instance.
-
getRubyRuntime
public org.jruby.Ruby getRubyRuntime() -
readDocumentHeader
Description copied from interface:AsciidoctorReads only header parameters instead of all document.- Specified by:
readDocumentHeaderin interfaceAsciidoctor- Parameters:
file- to read the attributes.- Returns:
- header.
-
readDocumentHeader
Description copied from interface:AsciidoctorReads only header parameters instead of all document.- Specified by:
readDocumentHeaderin interfaceAsciidoctor- Parameters:
content- where converted content is written. Writer is flushed, but not closed.- Returns:
- header.
-
readDocumentHeader
Description copied from interface:AsciidoctorReads only header parameters instead of all document.- Specified by:
readDocumentHeaderin interfaceAsciidoctor- Parameters:
contentReader- where asciidoc content is read.- Returns:
- header.
-
requireLibrary
Description copied from interface:AsciidoctorLoads the given Ruby gem(s) by name.- Specified by:
requireLibraryin interfaceAsciidoctor
-
requireLibraries
Description copied from interface:AsciidoctorLoads the given Ruby gem in requiredLibraries by name.- Specified by:
requireLibrariesin interfaceAsciidoctor
-
javaExtensionRegistry
Description copied from interface:AsciidoctorCreates an extension registry ready to be used for registering Java extensions.- Specified by:
javaExtensionRegistryin interfaceAsciidoctor- Returns:
- Extension Registry object.
-
rubyExtensionRegistry
Description copied from interface:AsciidoctorCreates an Ruby extension registry ready to be used for registering Ruby extension.- Specified by:
rubyExtensionRegistryin interfaceAsciidoctor- Returns:
- Extension Registry object.
-
javaConverterRegistry
Description copied from interface:AsciidoctorCreates a registry for registering Java converters.- Specified by:
javaConverterRegistryin interfaceAsciidoctor- Returns:
- Converter Registry object.
-
syntaxHighlighterRegistry
Description copied from interface:AsciidoctorCreates a registry for registering Java syntax highlighter.This API is experimental and might change in an incompatible way in a minor version update!
- Specified by:
syntaxHighlighterRegistryin interfaceAsciidoctor- Returns:
- Converter Registry object.
-
unregisterAllExtensions
public void unregisterAllExtensions()Description copied from interface:AsciidoctorUnregister all registered extensions.- Specified by:
unregisterAllExtensionsin interfaceAsciidoctor
-
shutdown
public void shutdown()Description copied from interface:AsciidoctorThis method frees all resources consumed by AsciidoctorJ module. Keep in mind that if this method is called, instance becomes unusable and you should create another instance.- Specified by:
shutdownin interfaceAsciidoctor
-
asciidoctorVersion
Description copied from interface:AsciidoctorMethod that gets the asciidoctor version which is being used..- Specified by:
asciidoctorVersionin interfaceAsciidoctor- Returns:
- Version number.
-
convert
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.Accepts input as String object.
- Specified by:
convertin interfaceAsciidoctor- Parameters:
content- the AsciiDoc source as String.options- a Map of options to control processing (default: {}).- Returns:
- the rendered output String is returned
-
convert
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.Accepts input as String object.
- Specified by:
convertin interfaceAsciidoctor- Parameters:
content- the AsciiDoc source as String.options- a Map of options to control processing (default: {}).expectedResult- the expected return type. UsuallyStringfor HTML based formats. In this caseAsciidoctor.convert(String, Map)is the same.- Returns:
- the rendered output String is returned
-
convert
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.Accepts input as String object.
- Specified by:
convertin interfaceAsciidoctor- Parameters:
content- the AsciiDoc source as String.options- options to control processing (default: empty).- Returns:
- the rendered output String is returned
-
convert
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.Accepts input as String object.
- Specified by:
convertin interfaceAsciidoctor- Parameters:
content- the AsciiDoc source as String.options- options to control processing (default: empty).expectedResult- the expected return type. UsuallyStringfor HTML based formats. In this caseAsciidoctor.convert(String, Options)is the same.- Returns:
- the rendered output String is returned
-
convert
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.Accepts input as String object.
- Specified by:
convertin interfaceAsciidoctor- Parameters:
content- the AsciiDoc source as String.options- a Map of options to control processing (default: {}).- Returns:
- the rendered output String is returned
-
convert
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand convert it to the specified backend format.Accepts input as String object.
- Specified by:
convertin interfaceAsciidoctor- Parameters:
content- the AsciiDoc source as String.options- a Map of options to control processing (default: {}).expectedResult- the expected return type. UsuallyStringfor HTML based formats. In this caseAsciidoctor.convert(String, OptionsBuilder)is the same.- Returns:
- the rendered output String is returned
-
convert
public void convert(Reader contentReader, Writer rendererWriter, Map<String, Object> options) throws IOExceptionDescription copied from interface:AsciidoctorParse the document read from reader sending the converted result to writer.- Specified by:
convertin interfaceAsciidoctor- Parameters:
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: {}).- Throws:
IOException- if an error occurs while writing rendered content, this exception is thrown.
-
convert
public void convert(Reader contentReader, Writer rendererWriter, Options options) throws IOException Description copied from interface:AsciidoctorParse the document read from reader sending the converted result to writer.- Specified by:
convertin interfaceAsciidoctor- Parameters:
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).- Throws:
IOException- if an error occurs while writing rendered content, this exception is thrown.
-
convert
public void convert(Reader contentReader, Writer rendererWriter, OptionsBuilder options) throws IOException Description copied from interface:AsciidoctorParse the document read from reader sending the converted result to writer.- Specified by:
convertin interfaceAsciidoctor- Parameters:
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: {}).- Throws:
IOException- if an error occurs while writing rendered content, this exception is thrown.
-
convertFile
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand 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.
- Specified by:
convertFilein interfaceAsciidoctor- Parameters:
file- an input Asciidoctor file.options- a Map of options to control processing (default: {}).- Returns:
- returns nothing if the rendered output String is written to a file.
-
convertFile
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand 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.
- Specified by:
convertFilein interfaceAsciidoctor- Parameters:
file- an input Asciidoctor file.options- a Map of options to control processing (default: {}).expectedResult- the expected return type. UsuallyStringfor HTML based formats. In this caseAsciidoctor.convertFile(File, Map)is the same.- Returns:
- returns nothing if the rendered output is written to a file.
-
convertFile
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand 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.
- Specified by:
convertFilein interfaceAsciidoctor- Parameters:
file- an input Asciidoctor file.options- options to control processing (default: empty).- Returns:
- returns nothing if the rendered output String is written to a file.
-
convertFile
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand 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.
- Specified by:
convertFilein interfaceAsciidoctor- Parameters:
file- an input Asciidoctor file.options- options to control processing (default: empty).expectedResult- the expected return type. UsuallyStringfor HTML based formats. In this caseAsciidoctor.convertFile(File, Map)is the same.- Returns:
- returns nothing if the rendered output is written to a file.
-
convertFile
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand 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.
- Specified by:
convertFilein interfaceAsciidoctor- Parameters:
file- an input Asciidoctor file.options- a Map of options to control processing (default: {}).- Returns:
- returns nothing if the rendered output String is written to a file.
-
convertFile
Description copied from interface:AsciidoctorParse the AsciiDoc source input into an DocumentDocumentand 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.
- Specified by:
convertFilein interfaceAsciidoctor- Parameters:
file- an input Asciidoctor file.options- a Map of options to control processing (default: {}).expectedResult- the expected return type. UsuallyStringfor HTML based formats. In this caseAsciidoctor.convertFile(File, Map)is the same.- Returns:
- returns nothing if the rendered output is written to a file.
-
convertDirectory
Description copied from interface:AsciidoctorConvert all AsciiDoc files found in directoryWalker. SeeAsciiDocDirectoryWalkerfor reference strategy.- Specified by:
convertDirectoryin interfaceAsciidoctor- Parameters:
directoryWalker- strategy used to retrieve all files to be rendered.options- a Map of options to control processing (default: {}).- Returns:
- returns an array of 0 positions if the rendered output is written to a file.
-
convertDirectory
Description copied from interface:AsciidoctorConvert all AsciiDoc files found in directoryWalker. SeeAsciiDocDirectoryWalkerfor reference strategy.- Specified by:
convertDirectoryin interfaceAsciidoctor- Parameters:
directoryWalker- strategy used to retrieve all files to be rendered.options- options to control processing (default: empty).- Returns:
- returns an array of 0 positions if the rendered output is written to a file.
-
convertDirectory
Description copied from interface:AsciidoctorConvert all AsciiDoc files found in directoryWalker. SeeAsciiDocDirectoryWalkerfor reference strategy.- Specified by:
convertDirectoryin interfaceAsciidoctor- Parameters:
directoryWalker- strategy used to retrieve all files to be rendered.options- a Map of options to control processing (default: {}).- Returns:
- returns an array of 0 positions if the rendered output is written to a file.
-
convertFiles
Description copied from interface:AsciidoctorConvert all files from a collection.- Specified by:
convertFilesin interfaceAsciidoctor- Parameters:
files- to be converted.options- a Map of options to control processing (default: {}).- Returns:
- returns an array of 0 positions if the rendered output is written to a file.
-
convertFiles
Description copied from interface:AsciidoctorConvert all files from a collection.- Specified by:
convertFilesin interfaceAsciidoctor- Parameters:
asciidoctorFiles- to be converted.options- options to control processing (default: empty).- Returns:
- returns an array of 0 positions if the rendered output is written to a file.
-
convertFiles
Description copied from interface:AsciidoctorConvert all files from a collection.- Specified by:
convertFilesin interfaceAsciidoctor- Parameters:
files- to be converted.options- a Map of options to control processing (default: {}).- Returns:
- returns an array of 0 positions if the rendered output is written to a file.
-
load
Description copied from interface:AsciidoctorLoads AsciiDoc content and returns the Document object.- Specified by:
loadin interfaceAsciidoctor- Parameters:
content- to be parsed.options- a Map of options to control processing (default: {}).- Returns:
- Document of given content.
-
load
Description copied from interface:AsciidoctorLoads AsciiDoc content and returns the Document object.- Specified by:
loadin interfaceAsciidoctor- Parameters:
content- to be parsed.options- options to control processing (default: empty).- Returns:
- Document of given content.
-
loadFile
Description copied from interface:AsciidoctorLoads AsciiDoc content from file and returns the Document object.- Specified by:
loadFilein interfaceAsciidoctor- Parameters:
file- to be parsed.options- a Map of options to control processing (default: {}).- Returns:
- Document of given content.
-
loadFile
Description copied from interface:AsciidoctorLoads AsciiDoc content from file and returns the Document object.- Specified by:
loadFilein interfaceAsciidoctor- Parameters:
file- to be parsed.options- options to control processing (default: empty).- Returns:
- Document of given content.
-
createGroup
Description copied from interface:AsciidoctorCreates an ExtensionGroup that can be used to register and unregister multiples extensions all at once.- Specified by:
createGroupin interfaceAsciidoctor- Returns:
- Extension Group instance.
-
createGroup
Description copied from interface:AsciidoctorCreates an ExtensionGroup that can be used to register and unregister multiples extensions all at once.- Specified by:
createGroupin interfaceAsciidoctor- Parameters:
groupName- to assign to the ExtensionGroup.- Returns:
- Extension Group instance.
-
log
Description copied from interface:LogHandlerProcess a log record. This method is called during conversion and will abort completely if an exception is thrown from within.- Specified by:
login interfaceLogHandler
-