Package org.asciidoctor
Class Attributes
- java.lang.Object
-
- org.asciidoctor.Attributes
-
public class Attributes extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALLOW_URI_READ
static java.lang.String
APPENDIX_CAPTION
static java.lang.String
ATTRIBUTE_MISSING
static java.lang.String
ATTRIBUTE_UNDEFINED
static java.lang.String
BACKEND
static java.lang.String
CACHE_URI
static java.lang.String
COMPAT_MODE
static java.lang.String
COPY_CSS
static java.lang.String
DATA_URI
static java.lang.String
DOCDATE
static java.lang.String
DOCTIME
static java.lang.String
DOCTYPE
static java.lang.String
EXPERIMENTAL
static java.lang.String
FONT_ICONS
static java.lang.String
HARDBREAKS
static java.lang.String
HIDE_URI_SCHEME
static java.lang.String
ICONFONT_CDN
static java.lang.String
ICONFONT_NAME
static java.lang.String
ICONFONT_REMOTE
static java.lang.String
ICONS
static java.lang.String
ICONS_DIR
static java.lang.String
IGNORE_UNDEFINED
static java.lang.String
IMAGE_ICONS
static java.lang.String
IMAGESDIR
static java.lang.String
LINK_ATTRS
static java.lang.String
LINK_CSS
static java.lang.String
LOCALDATE
static java.lang.String
LOCALTIME
static java.lang.String
MATH
static java.lang.String
MAX_INCLUDE_DEPTH
static java.lang.String
NO_FOOTER
static java.lang.String
NOT_STYLESHEET_NAME
static java.lang.String
NOTITLE
static java.lang.String
SECT_NUM_LEVELS
static java.lang.String
SECTION_NUMBERS
static java.lang.String
SET_ANCHORS
static java.lang.String
SHOW_TITLE
static java.lang.String
SKIP_FRONT_MATTER
static java.lang.String
SOURCE_HIGHLIGHTER
static java.lang.String
SOURCE_LANGUAGE
static java.lang.String
STYLES_DIR
static java.lang.String
STYLESHEET_NAME
static java.lang.String
TITLE
static java.lang.String
TOC
static java.lang.String
TOC_2
static java.lang.String
TOC_LEVELS
static java.lang.String
TOC_POSITION
static java.lang.String
UNTITLED_LABEL
-
Constructor Summary
Constructors Constructor Description Attributes()
Deprecated.Usebuilder()
instead.Attributes(java.lang.String attributes)
Deprecated.Usebuilder()
instead.Attributes(java.lang.String[] attributes)
Deprecated.Usebuilder()
instead.Attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Deprecated.Usebuilder()
instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static AttributesBuilder
builder()
java.util.Map<java.lang.String,java.lang.Object>
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(java.lang.String appendixCaption)
Defines the prefix added to appendix sections.void
setAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
void
setAttributeMissing(java.lang.String attributeMissing)
Define how to handle missing attribute references.void
setAttributes(java.lang.String attributes)
Sets attributes in string form.void
setAttributes(java.lang.String... attributes)
Sets attributes in array form.void
setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Adds all attributes.void
setAttributeUndefined(java.lang.String attributeUndefined)
Define how to handle expressions that undefine an attribute.void
setBackend(java.lang.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(java.util.Date docDate)
Sets date in format yyyy-MM-ddvoid
setDocTime(java.util.Date docTime)
Sets time in format HH:mm:ss zvoid
setDocType(java.lang.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(java.net.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(java.lang.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
setIcons(java.lang.String iconsName)
Sets which admonition icons to use.void
setIconsDir(java.lang.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(java.lang.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(java.util.Date localDate)
Sets date in format yyyy-MM-ddvoid
setLocalTime(java.util.Date localTime)
Sets time in format HH:mm:ss zvoid
setMath(java.lang.String math)
Sets the interpreter to use for rendering stems, i.e.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(java.lang.String sourceHighlighter)
Sets the source highlighter to use for rendering source blocks.void
setSourceLanguage(java.lang.String sourceLanguage)
Globally sets the source language attribute when rendering source blocks.void
setStylesDir(java.lang.String stylesDir)
Sets the styles dir.void
setStyleSheetName(java.lang.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
setTitle(java.lang.String title)
void
setTocLevels(int levels)
Sets the amount of levels which should be shown in the toc.void
setUntitledLabel(java.lang.String untitledLabel)
Sets the untitled label value.static java.lang.String
toAsciidoctorFlag(boolean flag)
void
unsetStyleSheet()
Unsets stylesheet name so document will be generated without style.
-
-
-
Field Detail
-
TOC
public static final java.lang.String TOC
- See Also:
- Constant Field Values
-
TOC_POSITION
public static final java.lang.String TOC_POSITION
- See Also:
- Constant Field Values
-
TOC_LEVELS
public static final java.lang.String TOC_LEVELS
- See Also:
- Constant Field Values
-
TOC_2
public static final java.lang.String TOC_2
- See Also:
- Constant Field Values
-
BACKEND
public static final java.lang.String BACKEND
- See Also:
- Constant Field Values
-
TITLE
public static final java.lang.String TITLE
- See Also:
- Constant Field Values
-
DOCTYPE
public static final java.lang.String DOCTYPE
- See Also:
- Constant Field Values
-
IMAGESDIR
public static final java.lang.String IMAGESDIR
- See Also:
- Constant Field Values
-
SOURCE_HIGHLIGHTER
public static final java.lang.String SOURCE_HIGHLIGHTER
- See Also:
- Constant Field Values
-
SOURCE_LANGUAGE
public static final java.lang.String SOURCE_LANGUAGE
- See Also:
- Constant Field Values
-
LOCALDATE
public static final java.lang.String LOCALDATE
- See Also:
- Constant Field Values
-
LOCALTIME
public static final java.lang.String LOCALTIME
- See Also:
- Constant Field Values
-
DOCDATE
public static final java.lang.String DOCDATE
- See Also:
- Constant Field Values
-
DOCTIME
public static final java.lang.String DOCTIME
- See Also:
- Constant Field Values
-
STYLESHEET_NAME
public static final java.lang.String STYLESHEET_NAME
- See Also:
- Constant Field Values
-
STYLES_DIR
public static final java.lang.String STYLES_DIR
- See Also:
- Constant Field Values
-
NOT_STYLESHEET_NAME
public static final java.lang.String NOT_STYLESHEET_NAME
- See Also:
- Constant Field Values
-
LINK_CSS
public static final java.lang.String LINK_CSS
- See Also:
- Constant Field Values
-
COPY_CSS
public static final java.lang.String COPY_CSS
- See Also:
- Constant Field Values
-
ICONS
public static final java.lang.String ICONS
- See Also:
- Constant Field Values
-
ICONFONT_REMOTE
public static final java.lang.String ICONFONT_REMOTE
- See Also:
- Constant Field Values
-
ICONFONT_CDN
public static final java.lang.String ICONFONT_CDN
- See Also:
- Constant Field Values
-
ICONFONT_NAME
public static final java.lang.String ICONFONT_NAME
- See Also:
- Constant Field Values
-
ICONS_DIR
public static final java.lang.String ICONS_DIR
- See Also:
- Constant Field Values
-
DATA_URI
public static final java.lang.String DATA_URI
- See Also:
- Constant Field Values
-
SECTION_NUMBERS
public static final java.lang.String SECTION_NUMBERS
- See Also:
- Constant Field Values
-
IMAGE_ICONS
public static final java.lang.String IMAGE_ICONS
- See Also:
- Constant Field Values
-
FONT_ICONS
public static final java.lang.String FONT_ICONS
- See Also:
- Constant Field Values
-
LINK_ATTRS
public static final java.lang.String LINK_ATTRS
- See Also:
- Constant Field Values
-
EXPERIMENTAL
public static final java.lang.String EXPERIMENTAL
- See Also:
- Constant Field Values
-
SHOW_TITLE
public static final java.lang.String SHOW_TITLE
- See Also:
- Constant Field Values
-
NOTITLE
public static final java.lang.String NOTITLE
- See Also:
- Constant Field Values
-
ALLOW_URI_READ
public static final java.lang.String ALLOW_URI_READ
- See Also:
- Constant Field Values
-
IGNORE_UNDEFINED
public static final java.lang.String IGNORE_UNDEFINED
- See Also:
- Constant Field Values
-
UNTITLED_LABEL
public static final java.lang.String UNTITLED_LABEL
- See Also:
- Constant Field Values
-
SET_ANCHORS
public static final java.lang.String SET_ANCHORS
- See Also:
- Constant Field Values
-
SKIP_FRONT_MATTER
public static final java.lang.String SKIP_FRONT_MATTER
- See Also:
- Constant Field Values
-
MAX_INCLUDE_DEPTH
public static final java.lang.String MAX_INCLUDE_DEPTH
- See Also:
- Constant Field Values
-
ATTRIBUTE_MISSING
public static final java.lang.String ATTRIBUTE_MISSING
- See Also:
- Constant Field Values
-
ATTRIBUTE_UNDEFINED
public static final java.lang.String ATTRIBUTE_UNDEFINED
- See Also:
- Constant Field Values
-
NO_FOOTER
public static final java.lang.String NO_FOOTER
- See Also:
- Constant Field Values
-
HARDBREAKS
public static final java.lang.String HARDBREAKS
- See Also:
- Constant Field Values
-
SECT_NUM_LEVELS
public static final java.lang.String SECT_NUM_LEVELS
- See Also:
- Constant Field Values
-
CACHE_URI
public static final java.lang.String CACHE_URI
- See Also:
- Constant Field Values
-
MATH
public static final java.lang.String MATH
- See Also:
- Constant Field Values
-
APPENDIX_CAPTION
public static final java.lang.String APPENDIX_CAPTION
- See Also:
- Constant Field Values
-
HIDE_URI_SCHEME
public static final java.lang.String HIDE_URI_SCHEME
- See Also:
- Constant Field Values
-
COMPAT_MODE
public static final java.lang.String COMPAT_MODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Attributes
@Deprecated public Attributes()
Deprecated.Usebuilder()
instead.
-
Attributes
@Deprecated public Attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Deprecated.Usebuilder()
instead.
-
Attributes
@Deprecated public Attributes(java.lang.String[] attributes)
Deprecated.Usebuilder()
instead.
-
Attributes
@Deprecated public Attributes(java.lang.String attributes)
Deprecated.Usebuilder()
instead.
-
-
Method Detail
-
builder
public static AttributesBuilder 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:
- Asciidoctor User Manual
-
setAttributeMissing
public void setAttributeMissing(java.lang.String attributeMissing)
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:
- Asciidoctor User Manual
-
setAttributeUndefined
public void setAttributeUndefined(java.lang.String attributeUndefined)
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:
- Asciidoctor User Manual
-
setBackend
public void setBackend(java.lang.String backend)
Sets the backend attribute.- Parameters:
backend
- The name of the backend, e.g.docbook
.
-
setTitle
public void setTitle(java.lang.String title)
-
setDocType
public void setDocType(java.lang.String docType)
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:
- Asciidoctor User Manual
-
setImagesDir
public void setImagesDir(java.lang.String imagesDir)
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:
- Asciidoctor User Manual
-
setSourceLanguage
public void setSourceLanguage(java.lang.String sourceLanguage)
Globally sets the source language attribute when rendering source blocks.- Parameters:
sourceLanguage
- The default source language to use, e.g.Java
.- See Also:
- Asciidoctor User Manual
-
setSourceHighlighter
public void setSourceHighlighter(java.lang.String sourceHighlighter)
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:
- Asciidoctor User Manual
-
setMaxIncludeDepth
public void setMaxIncludeDepth(int maxIncludeDepth)
Defines how many documents can be recursively included.- Parameters:
maxIncludeDepth
- A positive integer.- See Also:
- Track include depth and enforce maximum depth #581
-
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:
- Asciidoctor User Manual
-
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:
- Asciidoctor User Manual
-
setHideUriScheme
public void setHideUriScheme(boolean hideUriScheme)
Enables or disables rendering of the URI scheme when rendering URLs.- Parameters:
hideUriScheme
-- See Also:
- Asciidoctor User Manual
-
setAppendixCaption
public void setAppendixCaption(java.lang.String appendixCaption)
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:
- Asciidoctor User Manual
-
setMath
public void setMath(java.lang.String math)
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:
- Asciidoctor User Manual
-
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
public void setUntitledLabel(java.lang.String untitledLabel)
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 public void setTableOfContents2(Placement placement)
Deprecated.Sets table of contents 2 attribute.- Parameters:
placement
- where toc is rendered.
-
setTableOfContents
public void setTableOfContents(Placement placement)
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
public void setLocalDate(java.util.Date localDate)
Sets date in format yyyy-MM-dd- Parameters:
localDate
- object.
-
setLocalTime
public void setLocalTime(java.util.Date localTime)
Sets time in format HH:mm:ss z- Parameters:
localTime
- object.
-
setDocDate
public void setDocDate(java.util.Date docDate)
Sets date in format yyyy-MM-dd- Parameters:
docDate
- object.
-
setDocTime
public void setDocTime(java.util.Date docTime)
Sets time in format HH:mm:ss z- Parameters:
docTime
- object.
-
setStyleSheetName
public void setStyleSheetName(java.lang.String styleSheetName)
Sets stylesheet name.- Parameters:
styleSheetName
- of css file.
-
unsetStyleSheet
public void unsetStyleSheet()
Unsets stylesheet name so document will be generated without style.
-
setStylesDir
public void setStylesDir(java.lang.String stylesDir)
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
public void setIcons(java.lang.String iconsName)
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
public void setIconFontCdn(java.net.URI cdnUri)
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
public void setIconFontName(java.lang.String iconFontName)
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
public void setIconsDir(java.lang.String iconsDir)
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.
-
setNoFooter
public void setNoFooter(boolean noFooter)
Sets nofooter attribute.- Parameters:
noFooter
- true if the footer block should not be shown, false otherwise.
-
setCompatMode
public void setCompatMode(CompatMode compatMode)
Sets compat-mode attribute.- Parameters:
compatMode
- value.
-
setAttribute
public void setAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
-
setAttributes
public void setAttributes(java.lang.String attributes)
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
public void setAttributes(java.lang.String... attributes)
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
public void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Adds all attributes.- Parameters:
attributes
- to add.
-
toAsciidoctorFlag
public static java.lang.String toAsciidoctorFlag(boolean flag)
-
map
@Deprecated public java.util.Map<java.lang.String,java.lang.Object> map()
Deprecated.For internal use only.
-
-