Package org.asciidoctor
Class AttributesBuilder
- java.lang.Object
-
- org.asciidoctor.AttributesBuilder
-
public class AttributesBuilder extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AttributesBuilder
allowUriRead(boolean allowUriRead)
Sets allow uri read attribute.AttributesBuilder
appendixCaption(java.lang.String appendixCaption)
Sets appendix-caption label.AttributesBuilder
arguments(java.lang.String attributes)
Sets attributes in string form.AttributesBuilder
arguments(java.lang.String... attributes)
Sets attributes in array form.java.util.Map<java.lang.String,java.lang.Object>
asMap()
Deprecated.Usebuild()
instead.AttributesBuilder
attribute(java.lang.String attributeName)
Sets custom or unlisted attribute to the default value, empty string.AttributesBuilder
attribute(java.lang.String attributeName, java.lang.Object attributeValue)
Sets custom or unlisted attributeAttributesBuilder
attributeMissing(java.lang.String attributeMissing)
Sets attribute missing attribute.static AttributesBuilder
attributes()
Deprecated.UseAttributes.builder()
instead.static AttributesBuilder
attributes(java.lang.String arguments)
Deprecated.UseAttributes.builder()
witharguments(String)
instead.static AttributesBuilder
attributes(java.lang.String[] arguments)
Deprecated.UseAttributes.builder()
witharguments(String...)
instead.AttributesBuilder
attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Adds all attributes.AttributesBuilder
attributeUndefined(java.lang.String attributeUndefined)
Sets attribute undefined attribute.AttributesBuilder
backend(java.lang.String backend)
Sets backend attribue.Attributes
build()
Returns a valid Attributes instance.AttributesBuilder
cacheUri(boolean cacheUri)
Sets cache-uri flag.AttributesBuilder
compatMode(CompatMode compatMode)
Sets compat mode attribute.AttributesBuilder
copyCss(boolean copyCss)
Sets copy css attribute.AttributesBuilder
dataUri(boolean dataUri)
Sets data-uri attribute.AttributesBuilder
docDate(java.util.Date date)
Sets doc date for current document.AttributesBuilder
docTime(java.util.Date time)
Sets doc time for current document.AttributesBuilder
docType(java.lang.String docType)
Sets doc type attribute.AttributesBuilder
experimental(boolean experimental)
Sets experimental attribute.Attributes
get()
Deprecated.Usebuild()
instead.AttributesBuilder
hardbreaks(boolean hardbreaks)
Sets hardbreaks at the end of each line.AttributesBuilder
hiddenUriScheme(boolean hiddenUriScheme)
Sets hide-uri-scheme flag.AttributesBuilder
iconFontCdn(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 setAttributesBuilder
iconFontName(java.lang.String iconFontName)
The name of the stylesheet in the stylesdir to load (.css extension added automatically)AttributesBuilder
iconFontRemote(boolean iconFontRemote)
Enable icon font remote attribute.AttributesBuilder
icons(java.lang.String icons)
Sets which admonition icons to use.AttributesBuilder
iconsDir(java.lang.String iconsDir)
Sets icons directory location.AttributesBuilder
ignoreUndefinedAttributes(boolean ignoreUndefinedAttributes)
Sets ignore undefined flag so lines are kept when they contain a reference to a missing attribute.AttributesBuilder
imagesDir(java.lang.String imagesDir)
Sets image directory.AttributesBuilder
linkAttrs(boolean linkAttrs)
Sets linkattrs attribute.AttributesBuilder
linkCss(boolean linkCss)
Sets link css attribute.AttributesBuilder
localDate(java.util.Date date)
Sets local date for document.AttributesBuilder
localTime(java.util.Date time)
Sets local time for document.AttributesBuilder
math(java.lang.String math)
Sets math default engine.AttributesBuilder
maxIncludeDepth(int maxIncludeDepth)
Sets max include depth attribute.AttributesBuilder
noFooter(boolean noFooter)
Sets nofooter attribute.AttributesBuilder
sectionNumbers(boolean sectionNumbers)
Auto-number section titles in the HTML backend.AttributesBuilder
sectNumLevels(int sectnumlevels)
Sets sect num levels attribute.AttributesBuilder
setAnchors(boolean setAnchors)
Sets setanchor flag.AttributesBuilder
showTitle(boolean showTitle)
Sets showtitle value as an alias for notitle!AttributesBuilder
skipFrontMatter(boolean skipFrontMatter)
Skips front matter.AttributesBuilder
sourceHighlighter(java.lang.String sourceHighlighter)
Sets source highlighter processor.AttributesBuilder
sourceLanguage(java.lang.String sourceLanguage)
Source language attribute.AttributesBuilder
stylesDir(java.lang.String stylesDir)
Sets the styles dir.AttributesBuilder
styleSheetName(java.lang.String styleSheetName)
Sets stylesheet name.AttributesBuilder
tableOfContents(boolean toc)
Sets if table of contents should be rendered or notAttributesBuilder
tableOfContents(Placement placement)
Sets table of contents attribute.AttributesBuilder
tableOfContents2(Placement placement)
Deprecated.AttributesBuilder
title(java.lang.String title)
Sets title of document.AttributesBuilder
unsetStyleSheet()
Unsets stylesheet name so document will be generated without style.AttributesBuilder
untitledLabel(java.lang.String untitledLabel)
Sets the untitled label value.
-
-
-
Method Detail
-
attributes
@Deprecated public static AttributesBuilder attributes()
Deprecated.UseAttributes.builder()
instead.Creates attributes builder.- Returns:
- attributes builder.
-
attributes
@Deprecated public static AttributesBuilder attributes(java.lang.String[] arguments)
Deprecated.UseAttributes.builder()
witharguments(String...)
instead.Creates attributes builder.- Returns:
- attributes builder.
-
attributes
@Deprecated public static AttributesBuilder attributes(java.lang.String arguments)
Deprecated.UseAttributes.builder()
witharguments(String)
instead.Creates attributes builder.- Returns:
- attributes builder.
-
sourceLanguage
public AttributesBuilder sourceLanguage(java.lang.String sourceLanguage)
Source language attribute.- Parameters:
sourceLanguage
- value.- Returns:
- this instance.
-
skipFrontMatter
public AttributesBuilder skipFrontMatter(boolean skipFrontMatter)
Skips front matter.- Parameters:
skipFrontMatter
- value.- Returns:
- this instance.
-
ignoreUndefinedAttributes
public AttributesBuilder ignoreUndefinedAttributes(boolean ignoreUndefinedAttributes)
Sets ignore undefined flag so lines are kept when they contain a reference to a missing attribute.- Parameters:
ignoreUndefinedAttributes
- value.- Returns:
- this instance.
-
maxIncludeDepth
public AttributesBuilder maxIncludeDepth(int maxIncludeDepth)
Sets max include depth attribute.- Parameters:
maxIncludeDepth
- value.- Returns:
- this instance.
-
sectNumLevels
public AttributesBuilder sectNumLevels(int sectnumlevels)
Sets sect num levels attribute.- Parameters:
sectnumlevels
- value.- Returns:
- this instance.
-
attributeMissing
public AttributesBuilder attributeMissing(java.lang.String attributeMissing)
Sets attribute missing attribute. (Possible values skip, drop, drop-line)- Parameters:
attributeMissing
- value.- Returns:
- this instance.
-
attributeUndefined
public AttributesBuilder attributeUndefined(java.lang.String attributeUndefined)
Sets attribute undefined attribute. (Possible values skip, drop, drop-line)- Parameters:
attributeUndefined
- value.- Returns:
- this instance.
-
setAnchors
public AttributesBuilder setAnchors(boolean setAnchors)
Sets setanchor flag.- Parameters:
setAnchors
- value.- Returns:
- this instance.
-
untitledLabel
public AttributesBuilder untitledLabel(java.lang.String untitledLabel)
Sets the untitled label value.- Parameters:
untitledLabel
- value.- Returns:
- this instance.
-
tableOfContents
public AttributesBuilder tableOfContents(Placement placement)
Sets table of contents attribute.- Parameters:
placement
- where toc is rendered.- Returns:
- this instance.
-
tableOfContents2
@Deprecated public AttributesBuilder tableOfContents2(Placement placement)
Deprecated.Sets table of contents 2 attribute.- Parameters:
placement
- where toc is rendered.- Returns:
- this instance.
-
allowUriRead
public AttributesBuilder allowUriRead(boolean allowUriRead)
Sets allow uri read attribute.- Parameters:
allowUriRead
- value.- Returns:
- this instance.
-
backend
public AttributesBuilder backend(java.lang.String backend)
Sets backend attribue.- Parameters:
backend
- value.- Returns:
- this instance.
-
showTitle
public AttributesBuilder showTitle(boolean showTitle)
Sets showtitle value as an alias for notitle!- Parameters:
showTitle
- value.- Returns:
- this instance
-
title
public AttributesBuilder title(java.lang.String title)
Sets title of document.- Parameters:
title
- for document.- Returns:
- this instance.
-
docType
public AttributesBuilder docType(java.lang.String docType)
Sets doc type attribute.- Parameters:
docType
- value.- Returns:
- this instance.
-
imagesDir
public AttributesBuilder imagesDir(java.lang.String imagesDir)
Sets image directory.- Parameters:
imagesDir
- location.- Returns:
- this instance.
-
sourceHighlighter
public AttributesBuilder sourceHighlighter(java.lang.String sourceHighlighter)
Sets source highlighter processor. It should be supported by asciidoctor.- Parameters:
sourceHighlighter
- name of the source highlighting library (e.g., coderay).- Returns:
- this instance.
-
localDate
public AttributesBuilder localDate(java.util.Date date)
Sets local date for document.- Parameters:
date
-- Returns:
- this instance.
-
localTime
public AttributesBuilder localTime(java.util.Date time)
Sets local time for document.- Parameters:
time
-- Returns:
- this instance.
-
docDate
public AttributesBuilder docDate(java.util.Date date)
Sets doc date for current document.- Parameters:
date
-- Returns:
- this instance.
-
docTime
public AttributesBuilder docTime(java.util.Date time)
Sets doc time for current document.- Parameters:
time
-- Returns:
- this instance.
-
tableOfContents
public AttributesBuilder tableOfContents(boolean toc)
Sets if table of contents should be rendered or not- Parameters:
toc
- value- Returns:
- this instance.
-
styleSheetName
public AttributesBuilder styleSheetName(java.lang.String styleSheetName)
Sets stylesheet name.- Parameters:
styleSheetName
- of css file.- Returns:
- this instance.
-
unsetStyleSheet
public AttributesBuilder unsetStyleSheet()
Unsets stylesheet name so document will be generated without style.- Returns:
- this instance.
-
stylesDir
public AttributesBuilder stylesDir(java.lang.String stylesDir)
Sets the styles dir.- Parameters:
stylesDir
- directory.- Returns:
- this instance.
-
linkCss
public AttributesBuilder linkCss(boolean linkCss)
Sets link css attribute.- Parameters:
linkCss
- true if css is linked, false if css is embedded.- Returns:
- this instance.
-
copyCss
public AttributesBuilder copyCss(boolean copyCss)
Sets copy css attribute.- Parameters:
copyCss
- true if css should be copied to the output location, false otherwise.- Returns:
- this instance.
-
icons
public AttributesBuilder icons(java.lang.String icons)
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:
icons
- value.- Returns:
- this instance.
-
iconFontRemote
public AttributesBuilder iconFontRemote(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.- Returns:
- this instance.
-
iconFontCdn
public AttributesBuilder iconFontCdn(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.- Returns:
- this instance.
-
iconFontName
public AttributesBuilder iconFontName(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.- Returns:
- this instance.
-
iconsDir
public AttributesBuilder iconsDir(java.lang.String iconsDir)
Sets icons directory location.- Parameters:
iconsDir
- location.- Returns:
- this instance.
-
dataUri
public AttributesBuilder dataUri(boolean dataUri)
Sets data-uri attribute.- Parameters:
dataUri
- true if images should be embedded, false otherwise.
-
attribute
public AttributesBuilder attribute(java.lang.String attributeName)
Sets custom or unlisted attribute to the default value, empty string.- Parameters:
attributeName
- A flag-only attribute, such as "icons"- Returns:
- this instance.
-
sectionNumbers
public AttributesBuilder sectionNumbers(boolean sectionNumbers)
Auto-number section titles in the HTML backend.- Parameters:
sectionNumbers
- true if numbers should be autonumbered, false otherwise.- Returns:
- this instance.
-
hardbreaks
public AttributesBuilder hardbreaks(boolean hardbreaks)
Sets hardbreaks at the end of each line.- Parameters:
hardbreaks
- true if each line should be added a hardbreak, false otherwise.- Returns:
- this instance.
-
cacheUri
public AttributesBuilder cacheUri(boolean cacheUri)
Sets cache-uri flag.- Parameters:
cacheUri
- true if URI content should be cached, false otherwise.- Returns:
- this instance.
-
hiddenUriScheme
public AttributesBuilder hiddenUriScheme(boolean hiddenUriScheme)
Sets hide-uri-scheme flag.- Parameters:
hiddenUriScheme
- true if URI is hidden, false otherwise.- Returns:
- this instance.
-
appendixCaption
public AttributesBuilder appendixCaption(java.lang.String appendixCaption)
Sets appendix-caption label.- Parameters:
appendixCaption
- value.- Returns:
- this instance.
-
math
public AttributesBuilder math(java.lang.String math)
Sets math default engine.- Parameters:
math
- value.- Returns:
- this instance.
-
linkAttrs
public AttributesBuilder linkAttrs(boolean linkAttrs)
Sets linkattrs attribute.- Parameters:
linkAttrs
- true if Asciidoctor should parse link macro attributes, false otherwise.- Returns:
- this instance.
-
experimental
public AttributesBuilder experimental(boolean experimental)
Sets experimental attribute.- Parameters:
experimental
- true if experimental features should be enabled, false otherwise.
-
noFooter
public AttributesBuilder noFooter(boolean noFooter)
Sets nofooter attribute.- Parameters:
noFooter
- true if footer block should not be shown, false otherwise.- Returns:
- this instance.
-
compatMode
public AttributesBuilder compatMode(CompatMode compatMode)
Sets compat mode attribute.- Parameters:
compatMode
- value.- Returns:
- this instance.
-
attribute
public AttributesBuilder attribute(java.lang.String attributeName, java.lang.Object attributeValue)
Sets custom or unlisted attribute- Parameters:
attributeName
-attributeValue
-- Returns:
- this instance.
-
attributes
public AttributesBuilder attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Adds all attributes.- Parameters:
attributes
- map.- Returns:
- this instance.
-
arguments
public AttributesBuilder arguments(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.- Returns:
- this instance.
-
arguments
public AttributesBuilder arguments(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.- 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.
-
get
@Deprecated public Attributes get()
Deprecated.Usebuild()
instead.
-
build
public Attributes build()
Returns a valid Attributes instance.- Returns:
- attributes instance.
-
-