org.asciidoctor.internal
Class JRubyAsciidoctor

java.lang.Object
  extended by org.asciidoctor.internal.JRubyAsciidoctor
All Implemented Interfaces:
Asciidoctor

public class JRubyAsciidoctor
extends Object
implements Asciidoctor


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.asciidoctor.Asciidoctor
Asciidoctor.Factory
 
Field Summary
protected  RubyGemsPreloader rubyGemsPreloader
           
protected  org.jruby.Ruby rubyRuntime
           
 
Method Summary
static Asciidoctor create()
           
static Asciidoctor create(String gemPath)
           
 DocumentHeader readDocumentHeader(File filename)
          Reads only header parameters instead of all document.
 DocumentHeader readDocumentHeader(Reader contentReader)
          Reads only header parameters instead of all document.
 DocumentHeader readDocumentHeader(String content)
          Reads only header parameters instead of all document.
 void render(Reader contentReader, Writer rendererWriter, Map<String,Object> options)
          Parse the document read from reader, and rendered result is sent to writer.
 void render(Reader contentReader, Writer rendererWriter, Options options)
          Parse the document read from reader, and rendered result is sent to writer.
 void render(Reader contentReader, Writer rendererWriter, OptionsBuilder options)
          Parse the document read from reader, and rendered result is sent to writer.
 String render(String content, Map<String,Object> options)
          Parse the AsciiDoc source input into an Document Document and render it to the specified backend format.
 String render(String content, Options options)
          Parse the AsciiDoc source input into an Document Document and render it to the specified backend format.
 String render(String content, OptionsBuilder options)
          Parse the AsciiDoc source input into an Document Document and render it to the specified backend format.
 String[] renderDirectory(File directory, Map<String,Object> options)
          Parse all AsciiDoc files found in given directory and all its subfolders.
 String[] renderDirectory(File directory, Options options)
          Parse all AsciiDoc files found in given directory and all its subfolders.
 String[] renderDirectory(File directory, OptionsBuilder options)
          Parse all AsciiDoc files found in given directory and all its subfolders.
 String renderFile(File filename, Map<String,Object> options)
          Parse the AsciiDoc source input into an Document Document and render it to the specified backend format.
 String renderFile(File filename, Options options)
          Parse the AsciiDoc source input into an Document Document and render it to the specified backend format.
 String renderFile(File filename, OptionsBuilder options)
          Parse the AsciiDoc source input into an Document Document and render it to the specified backend format.
 String[] renderFiles(Collection<File> asciidoctorFiles, Map<String,Object> options)
          Parses all files added inside a collection.
 String[] renderFiles(Collection<File> asciidoctorFiles, Options options)
          Parses all files added inside a collection.
 String[] renderFiles(Collection<File> asciidoctorFiles, OptionsBuilder options)
          Parses all files added inside a collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rubyGemsPreloader

protected RubyGemsPreloader rubyGemsPreloader

rubyRuntime

protected org.jruby.Ruby rubyRuntime
Method Detail

create

public static Asciidoctor create()

create

public static Asciidoctor create(String gemPath)

readDocumentHeader

public DocumentHeader readDocumentHeader(File filename)
Description copied from interface: Asciidoctor
Reads only header parameters instead of all document.

Specified by:
readDocumentHeader in interface Asciidoctor
Parameters:
filename - to read the attributes.
Returns:
header.

readDocumentHeader

public DocumentHeader readDocumentHeader(String content)
Description copied from interface: Asciidoctor
Reads only header parameters instead of all document.

Specified by:
readDocumentHeader in interface Asciidoctor
Parameters:
content - where rendered content is written. Writer is flushed, but not closed.
Returns:
header.

readDocumentHeader

public DocumentHeader readDocumentHeader(Reader contentReader)
Description copied from interface: Asciidoctor
Reads only header parameters instead of all document.

Specified by:
readDocumentHeader in interface Asciidoctor
Parameters:
contentReader - where asciidoc content is read.
Returns:
header.

render

public String render(String content,
                     Map<String,Object> options)
Description copied from interface: Asciidoctor
Parse the AsciiDoc source input into an Document Document and render it to the specified backend format. Accepts input as String object.

Specified by:
render in interface Asciidoctor
Parameters:
content - the AsciiDoc source as String.
options - a Hash of options to control processing (default: {}).
Returns:
the rendered output String is returned

renderFile

public String renderFile(File filename,
                         Map<String,Object> options)
Description copied from interface: Asciidoctor
Parse the AsciiDoc source input into an Document Document and render it to the specified backend format. Accepts input as File path. 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:
renderFile in interface Asciidoctor
Parameters:
filename - an input Asciidoctor file.
options - a Hash of options to control processing (default: {}).
Returns:
returns nothing if the rendered output String is written to a file.

render

public void render(Reader contentReader,
                   Writer rendererWriter,
                   Map<String,Object> options)
            throws IOException
Description copied from interface: Asciidoctor
Parse the document read from reader, and rendered result is sent to writer.

Specified by:
render in interface Asciidoctor
Parameters:
contentReader - where asciidoc content is read.
rendererWriter - where rendered content is written. Writer is flushed, but not closed.
options - a Hash of options to control processing (default: {}).
Throws:
IOException - if an error occurs while writing rendered content, this exception is thrown.

renderFiles

public String[] renderFiles(Collection<File> asciidoctorFiles,
                            Map<String,Object> options)
Description copied from interface: Asciidoctor
Parses all files added inside a collection.

Specified by:
renderFiles in interface Asciidoctor
Parameters:
asciidoctorFiles - to be rendered.
options - a Hash of options to control processing (default: {}).
Returns:
returns an array of 0 positions if the rendered output is written to a file.

renderFiles

public String[] renderFiles(Collection<File> asciidoctorFiles,
                            Options options)
Description copied from interface: Asciidoctor
Parses all files added inside a collection.

Specified by:
renderFiles in interface Asciidoctor
Parameters:
asciidoctorFiles - to be rendered.
options - a Hash of options to control processing (default: {}).
Returns:
returns an array of 0 positions if the rendered output is written to a file.

renderDirectory

public String[] renderDirectory(File directory,
                                Map<String,Object> options)
Description copied from interface: Asciidoctor
Parse all AsciiDoc files found in given directory and all its subfolders. .asc, .asciidoc, .ad or .adoc extensions are valid AsciiDoc files.

Specified by:
renderDirectory in interface Asciidoctor
Parameters:
directory - where it begins the scan of all AsciiDoc files.
options - a Hash of options to control processing (default: {}).
Returns:
returns an array of 0 positions if the rendered output is written to a file.

render

public String render(String content,
                     Options options)
Description copied from interface: Asciidoctor
Parse the AsciiDoc source input into an Document Document and render it to the specified backend format. Accepts input as String object.

Specified by:
render in interface Asciidoctor
Parameters:
content - the AsciiDoc source as String.
options - a Hash of options to control processing (default: {}).
Returns:
the rendered output String is returned

render

public void render(Reader contentReader,
                   Writer rendererWriter,
                   Options options)
            throws IOException
Description copied from interface: Asciidoctor
Parse the document read from reader, and rendered result is sent to writer.

Specified by:
render in interface Asciidoctor
Parameters:
contentReader - where asciidoc content is read.
rendererWriter - where rendered content is written. Writer is flushed, but not closed.
options - a Hash of options to control processing (default: {}).
Throws:
IOException - if an error occurs while writing rendered content, this exception is thrown.

renderFile

public String renderFile(File filename,
                         Options options)
Description copied from interface: Asciidoctor
Parse the AsciiDoc source input into an Document Document and render it to the specified backend format. Accepts input as File path. 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:
renderFile in interface Asciidoctor
Parameters:
filename - an input Asciidoctor file.
options - a Hash of options to control processing (default: {}).
Returns:
returns nothing if the rendered output String is written to a file.

renderDirectory

public String[] renderDirectory(File directory,
                                Options options)
Description copied from interface: Asciidoctor
Parse all AsciiDoc files found in given directory and all its subfolders. .asc, .asciidoc, .ad or .adoc extensions are valid AsciiDoc files.

Specified by:
renderDirectory in interface Asciidoctor
Parameters:
directory - where it begins the scan of all AsciiDoc files.
options - a Hash of options to control processing (default: {}).
Returns:
returns an array of 0 positions if the rendered output is written to a file.

render

public String render(String content,
                     OptionsBuilder options)
Description copied from interface: Asciidoctor
Parse the AsciiDoc source input into an Document Document and render it to the specified backend format. Accepts input as String object.

Specified by:
render in interface Asciidoctor
Parameters:
content - the AsciiDoc source as String.
options - a Hash of options to control processing (default: {}).
Returns:
the rendered output String is returned

render

public void render(Reader contentReader,
                   Writer rendererWriter,
                   OptionsBuilder options)
            throws IOException
Description copied from interface: Asciidoctor
Parse the document read from reader, and rendered result is sent to writer.

Specified by:
render in interface Asciidoctor
Parameters:
contentReader - where asciidoc content is read.
rendererWriter - where rendered content is written. Writer is flushed, but not closed.
options - a Hash of options to control processing (default: {}).
Throws:
IOException - if an error occurs while writing rendered content, this exception is thrown.

renderFile

public String renderFile(File filename,
                         OptionsBuilder options)
Description copied from interface: Asciidoctor
Parse the AsciiDoc source input into an Document Document and render it to the specified backend format. Accepts input as File path. 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:
renderFile in interface Asciidoctor
Parameters:
filename - an input Asciidoctor file.
options - a Hash of options to control processing (default: {}).
Returns:
returns nothing if the rendered output String is written to a file.

renderDirectory

public String[] renderDirectory(File directory,
                                OptionsBuilder options)
Description copied from interface: Asciidoctor
Parse all AsciiDoc files found in given directory and all its subfolders. .asc, .asciidoc, .ad or .adoc extensions are valid AsciiDoc files.

Specified by:
renderDirectory in interface Asciidoctor
Parameters:
directory - where it begins the scan of all AsciiDoc files.
options - a Hash of options to control processing (default: {}).
Returns:
returns an array of 0 positions if the rendered output is written to a file.

renderFiles

public String[] renderFiles(Collection<File> asciidoctorFiles,
                            OptionsBuilder options)
Description copied from interface: Asciidoctor
Parses all files added inside a collection.

Specified by:
renderFiles in interface Asciidoctor
Parameters:
asciidoctorFiles - to be rendered.
options - a Hash of options to control processing (default: {}).
Returns:
returns an array of 0 positions if the rendered output is written to a file.


Copyright © 2013. All Rights Reserved.