Package org.asciidoctor
Class Attributes
java.lang.Object
org.asciidoctor.Attributes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Attributes
(String attributes) Deprecated.Usebuilder()
instead.Attributes
(String[] attributes) Deprecated.Usebuilder()
instead.Attributes
(Map<String, Object> attributes) Deprecated.Usebuilder()
instead. -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributesBuilder
builder()
map()
Deprecated.For internal use only.void
setAllowUriRead
(boolean allowUriRead) Allow Asciidoctor to read content from an URI.void
setAnchors
(boolean setAnchors) Sets setanchor flag.void
setAppendixCaption
(String appendixCaption) Defines the prefix added to appendix sections.void
setAttribute
(String attributeName, Object attributeValue) void
setAttributeMissing
(String attributeMissing) Define how to handle missing attribute references.void
setAttributes
(String attributes) Sets attributes in string form.void
setAttributes
(String... attributes) Sets attributes in array form.void
setAttributes
(Map<String, Object> attributes) Adds all attributes.void
setAttributeUndefined
(String attributeUndefined) Define how to handle expressions that undefine an attribute.void
setBackend
(String backend) Sets the backend attribute.void
setCacheUri
(boolean cacheUri) Enables or disables caching of content read from URIsvoid
setCompatMode
(CompatMode compatMode) Sets compat-mode attribute.void
setCopyCss
(boolean copyCss) Sets copy css attribute.void
setDataUri
(boolean dataUri) Sets data-uri attribute.void
setDocDate
(Date docDate) Sets date in format yyyy-MM-ddvoid
setDocTime
(Date docTime) Sets time in format HH:mm:ss zvoid
setDocType
(String docType) Sets the document type, which defines how a document and what parts are rendered.void
setExperimental
(boolean experimental) Sets experimental attribute.void
setHardbreaks
(boolean hardbreaks) Enables or disables preserving of line breaks in a paragraph.void
setHideUriScheme
(boolean hideUriScheme) Enables or disables rendering of the URI scheme when rendering URLs.void
setIconFontCdn
(URI cdnUri) The URI prefix of the icon font; looks for minified CSS file based on iconfont-name value; used when iconfont-remote is setvoid
setIconFontName
(String iconFontName) The name of the stylesheet in the stylesdir to load (.css extension added automatically)void
setIconFontRemote
(boolean iconFontRemote) Enable icon font remote attribute.void
Sets which admonition icons to use.void
setIconsDir
(String iconsDir) Sets icons directory.void
setIgnoreUndefinedAttributes
(boolean ignoreUndefinedAttributes) Sets ignore undefined flag so lines are kept when they contain a reference to a missing attribute.void
setImagesDir
(String imagesDir) Sets the directory to which images are resolved if the image target is a relative path.void
setLinkAttrs
(boolean linkAttrs) Sets linkattrs attribute.void
setLinkCss
(boolean linkCss) Sets link css attribute.void
setLocalDate
(Date localDate) Sets date in format yyyy-MM-ddvoid
setLocalTime
(Date localTime) Sets time in format HH:mm:ss zvoid
Sets the interpreter to use for rendering stems, i.e. equations and formulas.void
setMaxIncludeDepth
(int maxIncludeDepth) Defines how many documents can be recursively included.void
setNoFooter
(boolean noFooter) Sets nofooter attribute.void
setSectionNumbers
(boolean sectionNumbers) auto-number section titles in the HTML backendvoid
setSectNumLevels
(int sectNumLevels) Sets the depth of section numbering.void
setShowTitle
(boolean showTitle) Sets showtitle value as an alias for notitle!void
setSkipFrontMatter
(boolean skipFrontMatter) Skips front matter.void
setSourceHighlighter
(String sourceHighlighter) Sets the source highlighter to use for rendering source blocks.void
setSourceLanguage
(String sourceLanguage) Globally sets the source language attribute when rendering source blocks.void
setStylesDir
(String stylesDir) Sets the styles dir.void
setStyleSheetName
(String styleSheetName) Sets stylesheet name.void
setTableOfContents
(boolean toc) Sets if a table of contents should be rendered or not.void
setTableOfContents
(Placement placement) Sets if a table of contents should be rendered or not.void
setTableOfContents2
(Placement placement) Deprecated.void
void
setTocLevels
(int levels) Sets the amount of levels which should be shown in the toc.void
setUntitledLabel
(String untitledLabel) Sets the untitled label value.static String
toAsciidoctorFlag
(boolean flag) void
Unsets stylesheet name so document will be generated without style.
-
Field Details
-
TOC
- See Also:
-
TOC_POSITION
- See Also:
-
TOC_LEVELS
- See Also:
-
TOC_2
- See Also:
-
BACKEND
- See Also:
-
TITLE
- See Also:
-
DOCTYPE
- See Also:
-
IMAGESDIR
- See Also:
-
SOURCE_HIGHLIGHTER
- See Also:
-
SOURCE_LANGUAGE
- See Also:
-
LOCALDATE
- See Also:
-
LOCALTIME
- See Also:
-
DOCDATE
- See Also:
-
DOCTIME
- See Also:
-
STYLESHEET_NAME
- See Also:
-
STYLES_DIR
- See Also:
-
NOT_STYLESHEET_NAME
- See Also:
-
LINK_CSS
- See Also:
-
COPY_CSS
- See Also:
-
ICONS
- See Also:
-
ICONFONT_REMOTE
- See Also:
-
ICONFONT_CDN
- See Also:
-
ICONFONT_NAME
- See Also:
-
ICONS_DIR
- See Also:
-
DATA_URI
- See Also:
-
SECTION_NUMBERS
- See Also:
-
IMAGE_ICONS
- See Also:
-
FONT_ICONS
- See Also:
-
LINK_ATTRS
- See Also:
-
EXPERIMENTAL
- See Also:
-
SHOW_TITLE
- See Also:
-
NOTITLE
- See Also:
-
ALLOW_URI_READ
- See Also:
-
IGNORE_UNDEFINED
- See Also:
-
UNTITLED_LABEL
- See Also:
-
SET_ANCHORS
- See Also:
-
SKIP_FRONT_MATTER
- See Also:
-
MAX_INCLUDE_DEPTH
- See Also:
-
ATTRIBUTE_MISSING
- See Also:
-
ATTRIBUTE_UNDEFINED
- See Also:
-
NO_FOOTER
- See Also:
-
HARDBREAKS
- See Also:
-
SECT_NUM_LEVELS
- See Also:
-
CACHE_URI
- See Also:
-
MATH
- See Also:
-
APPENDIX_CAPTION
- See Also:
-
HIDE_URI_SCHEME
- See Also:
-
COMPAT_MODE
- See Also:
-
-
Constructor Details
-
Method Details
-
builder
- Returns:
- Empty AttributesBuilder instance.
-
setAllowUriRead
public void setAllowUriRead(boolean allowUriRead) Allow Asciidoctor to read content from an URI. Additionally the optionSafeMode
must be less thanSafeMode.SECURE
to enable inclusion of content from an URI.- Parameters:
allowUriRead
-true
to enable inclusion of content from an URI- See Also:
-
setAttributeMissing
Define how to handle missing attribute references. Possible values are:skip
leave the reference in place (default setting) drop
drop the reference, but not the line drop-line
drop the line on which the reference occurs (compliant behavior) warn
print a warning about the missing attribute - Parameters:
attributeMissing
- One of the constants shown in the table above.- See Also:
-
setAttributeUndefined
Define how to handle expressions that undefine an attribute. Possible values are:drop
substitute the expression with an empty string after processing it drop-line
drop the line that contains this expression (default setting and compliant behavior) - Parameters:
attributeUndefined
- One of the constants shown in the table above.- See Also:
-
setBackend
Sets the backend attribute.- Parameters:
backend
- The name of the backend, e.g.docbook
.
-
setTitle
-
setDocType
Sets the document type, which defines how a document and what parts are rendered. Possible values are:article
book
inline
manpage
- Parameters:
docType
- One of the constants mentioned above.- See Also:
-
setImagesDir
Sets the directory to which images are resolved if the image target is a relative path.- Parameters:
imagesDir
- The name of the directory.- See Also:
-
setSourceLanguage
Globally sets the source language attribute when rendering source blocks.- Parameters:
sourceLanguage
- The default source language to use, e.g.Java
.- See Also:
-
setSourceHighlighter
Sets the source highlighter to use for rendering source blocks. Possible values are:- coderay
- highlightjs
- prettify
- Parameters:
sourceHighlighter
- One of the constants mentioned above.- See Also:
-
setMaxIncludeDepth
public void setMaxIncludeDepth(int maxIncludeDepth) Defines how many documents can be recursively included.- Parameters:
maxIncludeDepth
- A positive integer.- See Also:
-
setSectNumLevels
public void setSectNumLevels(int sectNumLevels) Sets the depth of section numbering. That is if set to 1 only the top level section will be assigned a number. Default is 3.- Parameters:
sectNumLevels
- A positive integer.
-
setHardbreaks
public void setHardbreaks(boolean hardbreaks) Enables or disables preserving of line breaks in a paragraph.- Parameters:
hardbreaks
-true
to enable preserving of line breaks in paragraphs- See Also:
-
setCacheUri
public void setCacheUri(boolean cacheUri) Enables or disables caching of content read from URIs- Parameters:
cacheUri
-true
to enable caching of content read from URIs- See Also:
-
setHideUriScheme
public void setHideUriScheme(boolean hideUriScheme) Enables or disables rendering of the URI scheme when rendering URLs.- Parameters:
hideUriScheme
-- See Also:
-
setAppendixCaption
Defines the prefix added to appendix sections. The default value isAppendix
- Parameters:
appendixCaption
- The string that is prefixed to the section name in the appendix.- See Also:
-
setMath
Sets the interpreter to use for rendering stems, i.e. equations and formulas.- Parameters:
math
- The name of the interpreter, i.e. eitherasciimath
orlatexmath
.- See Also:
-
setSkipFrontMatter
public void setSkipFrontMatter(boolean skipFrontMatter) Skips front matter.- Parameters:
skipFrontMatter
- value.
-
setAnchors
public void setAnchors(boolean setAnchors) Sets setanchor flag.- Parameters:
setAnchors
- value.
-
setUntitledLabel
Sets the untitled label value.- Parameters:
untitledLabel
- value.
-
setIgnoreUndefinedAttributes
public void setIgnoreUndefinedAttributes(boolean ignoreUndefinedAttributes) Sets ignore undefined flag so lines are kept when they contain a reference to a missing attribute.- Parameters:
ignoreUndefinedAttributes
- value.
-
setTableOfContents2
Deprecated.Sets table of contents 2 attribute.- Parameters:
placement
- where toc is rendered.
-
setTableOfContents
Sets if a table of contents should be rendered or not.- Parameters:
placement
- position of toc.
-
setTocLevels
public void setTocLevels(int levels) Sets the amount of levels which should be shown in the toc.- Parameters:
levels
- number of levels which should be shown in the toc.
-
setShowTitle
public void setShowTitle(boolean showTitle) Sets showtitle value as an alias for notitle!- Parameters:
showTitle
- value.
-
setTableOfContents
public void setTableOfContents(boolean toc) Sets if a table of contents should be rendered or not.- Parameters:
toc
- value.
-
setLocalDate
Sets date in format yyyy-MM-dd- Parameters:
localDate
- object.
-
setLocalTime
Sets time in format HH:mm:ss z- Parameters:
localTime
- object.
-
setDocDate
Sets date in format yyyy-MM-dd- Parameters:
docDate
- object.
-
setDocTime
Sets time in format HH:mm:ss z- Parameters:
docTime
- object.
-
setStyleSheetName
Sets stylesheet name.- Parameters:
styleSheetName
- of css file.
-
unsetStyleSheet
public void unsetStyleSheet()Unsets stylesheet name so document will be generated without style. -
setStylesDir
Sets the styles dir.- Parameters:
stylesDir
- directory.
-
setLinkCss
public void setLinkCss(boolean linkCss) Sets link css attribute.- Parameters:
linkCss
- true if css is linked, false if css is embedded.
-
setCopyCss
public void setCopyCss(boolean copyCss) Sets copy css attribute.- Parameters:
copyCss
- true if css should be copied to the output location, false otherwise.
-
setIcons
Sets which admonition icons to use. Attributes.IMAGE_ICONS constant can be used to use the original icons with images or Attributes.FONT_ICONS for font icons (font-awesome).- Parameters:
iconsName
- value.
-
setIconFontRemote
public void setIconFontRemote(boolean iconFontRemote) Enable icon font remote attribute. If enabled, will use the iconfont-cdn value to load the icon font URI; if disabled, will use the iconfont-name value to locate the icon font CSS file- Parameters:
iconFontRemote
- true if attribute enabled false otherwise.
-
setIconFontCdn
The URI prefix of the icon font; looks for minified CSS file based on iconfont-name value; used when iconfont-remote is set- Parameters:
cdnUri
- uri where css is stored.
-
setIconFontName
The name of the stylesheet in the stylesdir to load (.css extension added automatically)- Parameters:
iconFontName
- stylesheet name without .css extension.
-
setDataUri
public void setDataUri(boolean dataUri) Sets data-uri attribute.- Parameters:
dataUri
- true if images should be embedded, false otherwise.
-
setIconsDir
Sets icons directory.- Parameters:
iconsDir
-
-
setSectionNumbers
public void setSectionNumbers(boolean sectionNumbers) auto-number section titles in the HTML backend- Parameters:
sectionNumbers
-
-
setLinkAttrs
public void setLinkAttrs(boolean linkAttrs) Sets linkattrs attribute.- Parameters:
linkAttrs
- true if Asciidoctor should parse link macro attributes, false otherwise.
-
setExperimental
public void setExperimental(boolean experimental) Sets experimental attribute.- Parameters:
experimental
- true if experimental features should be enabled, false otherwise.
-
setCompatMode
Sets compat-mode attribute.- Parameters:
compatMode
- value.
-
setAttribute
-
setAttributes
Sets attributes in string form. An example of a valid string would be: 'toc numbered source-highlighter=coderay' where you are adding three attributes: toc, numbered and source-highlighter with value coderay.- Parameters:
attributes
- in string format.
-
setAttributes
Sets attributes in array form. An example of a valid array would be: '['toc', 'numbered']' where you are adding three attributes: toc and numbered.- Parameters:
attributes
- in array format.
-
setAttributes
Adds all attributes.- Parameters:
attributes
- to add.
-
toAsciidoctorFlag
-
map
Deprecated.For internal use only.
-
builder()
instead.