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.OptionsBuilderattributes(java.util.Map<java.lang.String,java.lang.Object> attributes)Deprecated.Useattributes(Attributes)instead.OptionsBuilderattributes(Attributes attributes)Sets attributes used for rendering input.OptionsBuilderattributes(AttributesBuilder attributes)Deprecated.Useattributes(Attributes)instead.OptionsBuilderbackend(java.lang.String backend)Sets backend option.OptionsBuilderbaseDir(java.io.File baseDir)Sets base dir for working directory.Optionsbuild()Returns a valid Options instance.OptionsBuildercatalogAssets(boolean catalogAssets)If true, tells the parser to capture images and links in the reference table.OptionsBuildercompact(boolean compact)Compact the output removing blank lines.OptionsBuilderdestinationDir(java.io.File destinationDir)Deprecated.UsetoDir(File)instead.OptionsBuilderdocType(java.lang.String docType)Sets doctype option.OptionsBuildereruby(java.lang.String eruby)Sets eruby implementation.Optionsget()Deprecated.Usebuild()instead.OptionsBuilderheaderFooter(boolean headerFooter)Deprecated.Usestandalone(boolean)instead.OptionsBuilderinPlace(boolean inPlace)Sets in place attribute.OptionsBuildermkDirs(boolean mkDirs)Sets if asciidoctor should create output directory if it does not exist or not.OptionsBuilderoption(java.lang.String option, java.lang.Object value)Sets a custom or unlisted option.static OptionsBuilderoptions()Deprecated.UseOptions.builder()instead.OptionsBuilderparse(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).OptionsBuilderparseHeaderOnly(boolean parseHeaderOnly)Sets parse header only falg.OptionsBuildersafe(SafeMode safeMode)Sets the safe mode.OptionsBuildersourceDir(java.io.File srcDir)Source directory.OptionsBuildersourcemap(boolean sourcemap)Keeps track of the file and line number for each parsed block.OptionsBuilderstandalone(boolean standalone)Toggle including header and footer into the output.OptionsBuildertemplateCache(boolean templateCache)Sets if Asciidoctor should use template cache or not.OptionsBuildertemplateDir(java.io.File templateDir)Deprecated.UsetemplateDirs(File...)instead.OptionsBuildertemplateDirs(java.io.File... templateDirs)Sets template directories.OptionsBuildertemplateEngine(java.lang.String templateEngine)Sets the template engine.OptionsBuildertoDir(java.io.File directory)Sets to dir value.OptionsBuildertoFile(boolean toFile)Sets to file value.OptionsBuildertoFile(java.io.File toFile)Sets to file value.OptionsBuildertoStream(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-trueto generate a standalone output document (which includes the shell around the body content, such as the header and footer). Defaults totruewhen 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-trueto write output to a file,falseto 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.
-
-