Package org.asciidoctor
Class Options
- java.lang.Object
-
- org.asciidoctor.Options
-
public class Options extends java.lang.Object
AsciidoctorJ conversion options.See https://docs.asciidoctor.org/asciidoctor/latest/api/options/ for further details.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTES
static java.lang.String
BACKEND
static java.lang.String
BASEDIR
static java.lang.String
CATALOG_ASSETS
static java.lang.String
COMPACT
static java.lang.String
DOCTYPE
static java.lang.String
ERUBY
static java.lang.String
IN_PLACE
static java.lang.String
MKDIRS
static java.lang.String
PARSE
static java.lang.String
PARSE_HEADER_ONLY
static java.lang.String
SAFE
static java.lang.String
SOURCE
static java.lang.String
SOURCEMAP
static java.lang.String
STANDALONE
static java.lang.String
TEMPLATE_CACHE
static java.lang.String
TEMPLATE_DIRS
static java.lang.String
TEMPLATE_ENGINE
static java.lang.String
TIMINGS
static java.lang.String
TO_DIR
static java.lang.String
TO_FILE
static java.lang.String
TRACE
static java.lang.String
WARNINGS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static OptionsBuilder
builder()
java.util.Map<java.lang.String,java.lang.Object>
map()
Deprecated.For internal use only.void
setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
void
setAttributes(Attributes attributes)
void
setBackend(java.lang.String backend)
void
setBaseDir(java.lang.String baseDir)
void
setCatalogAssets(boolean catalogAssets)
If true, tells the parser to capture images and links in the reference table.void
setCompact(boolean compact)
void
setDocType(java.lang.String docType)
void
setEruby(java.lang.String eruby)
void
setInPlace(boolean inPlace)
void
setMkDirs(boolean mkDirs)
void
setOption(java.lang.String optionName, java.lang.Object optionValue)
void
setParse(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).void
setParseHeaderOnly(boolean parseHeaderOnly)
void
setSafe(SafeMode safeMode)
Safe method calls safeMode.getLevel() to put the required level.void
setSourcemap(boolean sourcemap)
Keeps track of the file and line number for each parsed block.void
setStandalone(boolean standalone)
Toggle including header and footer into the output.void
setTemplateCache(boolean templateCache)
void
setTemplateDirs(java.lang.String... templateDirs)
void
setTemplateEngine(java.lang.String templateEngine)
void
setToDir(java.lang.String toDir)
void
setToFile(boolean toFile)
Toggle writing output to a file.void
setToFile(java.lang.String toFile)
Enable writing output to a file.void
setToStream(java.io.OutputStream toStream)
-
-
-
Field Detail
-
IN_PLACE
public static final java.lang.String IN_PLACE
- See Also:
- Constant Field Values
-
WARNINGS
public static final java.lang.String WARNINGS
- See Also:
- Constant Field Values
-
TIMINGS
public static final java.lang.String TIMINGS
- See Also:
- Constant Field Values
-
ATTRIBUTES
public static final java.lang.String ATTRIBUTES
- See Also:
- Constant Field Values
-
TEMPLATE_DIRS
public static final java.lang.String TEMPLATE_DIRS
- See Also:
- Constant Field Values
-
TEMPLATE_ENGINE
public static final java.lang.String TEMPLATE_ENGINE
- See Also:
- Constant Field Values
-
TO_FILE
public static final java.lang.String TO_FILE
- See Also:
- Constant Field Values
-
TO_DIR
public static final java.lang.String TO_DIR
- See Also:
- Constant Field Values
-
MKDIRS
public static final java.lang.String MKDIRS
- See Also:
- Constant Field Values
-
SAFE
public static final java.lang.String SAFE
- See Also:
- Constant Field Values
-
SOURCEMAP
public static final java.lang.String SOURCEMAP
- See Also:
- Constant Field Values
-
STANDALONE
public static final java.lang.String STANDALONE
- See Also:
- Constant Field Values
-
ERUBY
public static final java.lang.String ERUBY
- See Also:
- Constant Field Values
-
CATALOG_ASSETS
public static final java.lang.String CATALOG_ASSETS
- See Also:
- Constant Field Values
-
COMPACT
public static final java.lang.String COMPACT
- See Also:
- Constant Field Values
-
BACKEND
public static final java.lang.String BACKEND
- See Also:
- Constant Field Values
-
DOCTYPE
public static final java.lang.String DOCTYPE
- See Also:
- Constant Field Values
-
BASEDIR
public static final java.lang.String BASEDIR
- See Also:
- Constant Field Values
-
TRACE
public static final java.lang.String TRACE
- See Also:
- Constant Field Values
-
TEMPLATE_CACHE
public static final java.lang.String TEMPLATE_CACHE
- See Also:
- Constant Field Values
-
SOURCE
public static final java.lang.String SOURCE
- See Also:
- Constant Field Values
-
PARSE
public static final java.lang.String PARSE
- See Also:
- Constant Field Values
-
PARSE_HEADER_ONLY
public static final java.lang.String PARSE_HEADER_ONLY
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static OptionsBuilder builder()
- Returns:
- Empty OptionsBuilder instance.
-
setInPlace
public void setInPlace(boolean inPlace)
-
setAttributes
public void setAttributes(Attributes attributes)
-
setAttributes
public void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
-
setStandalone
public void setStandalone(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
.
-
setTemplateDirs
public void setTemplateDirs(java.lang.String... templateDirs)
-
setTemplateEngine
public void setTemplateEngine(java.lang.String templateEngine)
-
setToFile
public void setToFile(java.lang.String toFile)
Enable writing output to a file. The file includes header and footer by default.- Parameters:
toFile
- The path to the output file. If the path is not absolute, it is interpreted relative to what was set viasetToDir(String)
} orsetBaseDir(String)
}, in that order.
-
setToStream
public void setToStream(java.io.OutputStream toStream)
-
setToFile
public void setToFile(boolean toFile)
Toggle writing output to a file.- Parameters:
toFile
- Iftrue, write output to a file in the same directory as the input file, including header and footer into the output. If
false
, return output as a string without any header or footer. The default header and footer visibility can be overridden usingsetStandalone(boolean)
.
-
setToDir
public void setToDir(java.lang.String toDir)
-
setMkDirs
public void setMkDirs(boolean mkDirs)
-
setSafe
public void setSafe(SafeMode safeMode)
Safe method calls safeMode.getLevel() to put the required level.- Parameters:
safeMode
- enum.
-
setSourcemap
public void setSourcemap(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.
-
setEruby
public void setEruby(java.lang.String eruby)
-
setCatalogAssets
public void setCatalogAssets(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.
-
setCompact
public void setCompact(boolean compact)
-
setBackend
public void setBackend(java.lang.String backend)
-
setDocType
public void setDocType(java.lang.String docType)
-
setBaseDir
public void setBaseDir(java.lang.String baseDir)
-
setTemplateCache
public void setTemplateCache(boolean templateCache)
-
setParse
public void setParse(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.
-
setParseHeaderOnly
public void setParseHeaderOnly(boolean parseHeaderOnly)
-
setOption
public void setOption(java.lang.String optionName, java.lang.Object optionValue)
-
map
@Deprecated public java.util.Map<java.lang.String,java.lang.Object> map()
Deprecated.For internal use only.
-
-