Package org.asciidoctor
Class OptionsBuilder
- java.lang.Object
-
- org.asciidoctor.OptionsBuilder
-
public class OptionsBuilder extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
asMap()
Deprecated.Usebuild()
instead.OptionsBuilder
attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Deprecated.Useattributes(Attributes)
instead.OptionsBuilder
attributes(Attributes attributes)
Sets attributes used for rendering input.OptionsBuilder
attributes(AttributesBuilder attributes)
Deprecated.Useattributes(Attributes)
instead.OptionsBuilder
backend(java.lang.String backend)
Sets backend option.OptionsBuilder
baseDir(java.io.File baseDir)
Sets base dir for working directory.Options
build()
Returns a valid Options instance.OptionsBuilder
catalogAssets(boolean catalogAssets)
If true, tells the parser to capture images and links in the reference table.OptionsBuilder
compact(boolean compact)
Compact the output removing blank lines.OptionsBuilder
destinationDir(java.io.File destinationDir)
Deprecated.UsetoDir(File)
instead.OptionsBuilder
docType(java.lang.String docType)
Sets doctype option.OptionsBuilder
eruby(java.lang.String eruby)
Sets eruby implementation.Options
get()
Deprecated.Usebuild()
instead.OptionsBuilder
headerFooter(boolean headerFooter)
Deprecated.Usestandalone(boolean)
instead.OptionsBuilder
inPlace(boolean inPlace)
Sets in place attribute.OptionsBuilder
mkDirs(boolean mkDirs)
Sets if asciidoctor should create output directory if it does not exist or not.OptionsBuilder
option(java.lang.String option, java.lang.Object value)
Sets a custom or unlisted option.static OptionsBuilder
options()
Deprecated.UseOptions.builder()
instead.OptionsBuilder
parse(boolean parse)
If true, the source is parsed eagerly (i.e., as soon as the source is passed to the load or load_file API).OptionsBuilder
parseHeaderOnly(boolean parseHeaderOnly)
Sets parse header only falg.OptionsBuilder
safe(SafeMode safeMode)
Sets the safe mode.OptionsBuilder
sourceDir(java.io.File srcDir)
Source directory.OptionsBuilder
sourcemap(boolean sourcemap)
Keeps track of the file and line number for each parsed block.OptionsBuilder
standalone(boolean standalone)
Toggle including header and footer into the output.OptionsBuilder
templateCache(boolean templateCache)
Sets if Asciidoctor should use template cache or not.OptionsBuilder
templateDir(java.io.File templateDir)
Deprecated.UsetemplateDirs(File...)
instead.OptionsBuilder
templateDirs(java.io.File... templateDirs)
Sets template directories.OptionsBuilder
templateEngine(java.lang.String templateEngine)
Sets the template engine.OptionsBuilder
toDir(java.io.File directory)
Sets to dir value.OptionsBuilder
toFile(boolean toFile)
Sets to file value.OptionsBuilder
toFile(java.io.File toFile)
Sets to file value.OptionsBuilder
toStream(java.io.OutputStream toStream)
-
-
-
Method Detail
-
options
@Deprecated public static OptionsBuilder options()
Deprecated.UseOptions.builder()
instead.Creates options builder instance.- Returns:
- options builder instance.
-
backend
public OptionsBuilder backend(java.lang.String backend)
Sets backend option.- Parameters:
backend
- value.- Returns:
- this instance.
-
docType
public OptionsBuilder docType(java.lang.String docType)
Sets doctype option.- Parameters:
docType
- value.- Returns:
- this instance.
-
inPlace
public OptionsBuilder inPlace(boolean inPlace)
Sets in place attribute.- Parameters:
inPlace
- value.- Returns:
- this instance.
-
standalone
public OptionsBuilder standalone(boolean standalone)
Toggle including header and footer into the output.- Parameters:
standalone
-true
to generate a standalone output document (which includes the shell around the body content, such as the header and footer). Defaults totrue
when converting a file only, otherwise isfalse
.
-
headerFooter
@Deprecated public OptionsBuilder headerFooter(boolean headerFooter)
Deprecated.Usestandalone(boolean)
instead.Sets header footer attribute.- Parameters:
headerFooter
- value.- Returns:
- this instance.
-
templateDir
@Deprecated public OptionsBuilder templateDir(java.io.File templateDir)
Deprecated.UsetemplateDirs(File...)
instead.Sets template directory.- Parameters:
templateDir
- directory where templates are stored.- Returns:
- this instance.
-
templateDirs
public OptionsBuilder templateDirs(java.io.File... templateDirs)
Sets template directories.- Parameters:
templateDirs
- directories where templates are stored.- Returns:
- this instance.
-
templateEngine
public OptionsBuilder templateEngine(java.lang.String templateEngine)
Sets the template engine.- Parameters:
templateEngine
- used to render the document.- Returns:
- this instance.
-
templateCache
public OptionsBuilder templateCache(boolean templateCache)
Sets if Asciidoctor should use template cache or not.- Parameters:
templateCache
- true if template cache is required, false otherwise.- Returns:
- this instance.
-
attributes
@Deprecated public OptionsBuilder attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Deprecated.Useattributes(Attributes)
instead.Sets attributes used for rendering input.- Parameters:
attributes
- map.- Returns:
- this instance.
-
attributes
public OptionsBuilder attributes(Attributes attributes)
Sets attributes used for rendering input.- Parameters:
attributes
- map.- Returns:
- this instance.
-
attributes
@Deprecated public OptionsBuilder attributes(AttributesBuilder attributes)
Deprecated.Useattributes(Attributes)
instead.Sets attributes used for rendering input.- Parameters:
attributes
- builder.- Returns:
- this instance.
-
toFile
public OptionsBuilder toFile(boolean toFile)
Sets to file value. This toggles writing output to a file or returning output as a string. If writing to a string, the header and footer are omitted from the output by default.- Parameters:
toFile
-true
to write output to a file,false
to write output to a string.- Returns:
- this instance.
-
toFile
public OptionsBuilder toFile(java.io.File toFile)
Sets to file value. This is the destination file name.- Parameters:
toFile
- name of output file.- Returns:
- this instance.
-
toStream
public OptionsBuilder toStream(java.io.OutputStream toStream)
-
toDir
public OptionsBuilder toDir(java.io.File directory)
Sets to dir value. This is the destination directory.- Parameters:
directory
- where output is generated.- Returns:
- this instance.
-
mkDirs
public OptionsBuilder mkDirs(boolean mkDirs)
Sets if asciidoctor should create output directory if it does not exist or not.- Parameters:
mkDirs
- true if directory must be created, false otherwise.- Returns:
- this instance.
-
safe
public OptionsBuilder safe(SafeMode safeMode)
Sets the safe mode.- Parameters:
safeMode
- to run asciidoctor.- Returns:
- this instance.
-
sourcemap
public OptionsBuilder sourcemap(boolean sourcemap)
Keeps track of the file and line number for each parsed block. (Useful for tooling applications where the association between the converted output and the source file is important).- Parameters:
sourcemap
- value.- Returns:
- this instance.
-
eruby
public OptionsBuilder eruby(java.lang.String eruby)
Sets eruby implementation.- Parameters:
eruby
- implementation.- Returns:
- this instance.
-
catalogAssets
public OptionsBuilder catalogAssets(boolean catalogAssets)
If true, tells the parser to capture images and links in the reference table. (Normally only IDs, footnotes and indexterms are included). The reference table is available via the references property on the document AST object. (Experimental).- Parameters:
catalogAssets
- value.- Returns:
- this instance.
-
compact
public OptionsBuilder compact(boolean compact)
Compact the output removing blank lines.- Parameters:
compact
- value.- Returns:
- this instance.
-
parse
public OptionsBuilder parse(boolean parse)
If true, the source is parsed eagerly (i.e., as soon as the source is passed to the load or load_file API). If false, parsing is deferred until the parse method is explicitly invoked.- Parameters:
parse
- value.- Returns:
- this instance.
-
parseHeaderOnly
public OptionsBuilder parseHeaderOnly(boolean parseHeaderOnly)
Sets parse header only falg.- Parameters:
parseHeaderOnly
- value.- Returns:
- this instance.
-
destinationDir
@Deprecated public OptionsBuilder destinationDir(java.io.File destinationDir)
Deprecated.UsetoDir(File)
instead.Destination output directory.- Parameters:
destinationDir
- destination directory.- Returns:
- this instance.
-
sourceDir
public OptionsBuilder sourceDir(java.io.File srcDir)
Source directory. This must be used alongsidedestinationDir(File)
.- Parameters:
srcDir
- source directory.- Returns:
- this instance.
-
option
public OptionsBuilder option(java.lang.String option, java.lang.Object value)
Sets a custom or unlisted option.- Parameters:
option
- name.value
- for given option.- Returns:
- this instance.
-
baseDir
public OptionsBuilder baseDir(java.io.File baseDir)
Sets base dir for working directory.- Parameters:
baseDir
- working directory.- Returns:
- this instance.
-
asMap
@Deprecated public java.util.Map<java.lang.String,java.lang.Object> asMap()
Deprecated.Usebuild()
instead.Gets a map with configured options.- Returns:
- map with all options. By default an empty map is returned.
-
build
public Options build()
Returns a valid Options instance.- Returns:
- options instance.
-
-