Class Attributes

java.lang.Object
org.asciidoctor.Attributes

public class Attributes extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • 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 option SafeMode must be less than SafeMode.SECURE to enable inclusion of content from an URI.
      Parameters:
      allowUriRead - true to enable inclusion of content from an URI
      See Also:
    • setAttributeMissing

      public void setAttributeMissing(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:
    • setAttributeUndefined

      public void setAttributeUndefined(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:
    • setBackend

      public void setBackend(String backend)
      Sets the backend attribute.
      Parameters:
      backend - The name of the backend, e.g. docbook.
    • setTitle

      public void setTitle(String title)
    • setDocType

      public void setDocType(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:
    • setImagesDir

      public void setImagesDir(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:
    • setSourceLanguage

      public void setSourceLanguage(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:
    • setSourceHighlighter

      public void setSourceHighlighter(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:
    • 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

      public void setAppendixCaption(String appendixCaption)
      Defines the prefix added to appendix sections. The default value is Appendix
      Parameters:
      appendixCaption - The string that is prefixed to the section name in the appendix.
      See Also:
    • setMath

      public void setMath(String math)
      Sets the interpreter to use for rendering stems, i.e. equations and formulas.
      Parameters:
      math - The name of the interpreter, i.e. either asciimath or latexmath.
      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

      public void setUntitledLabel(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)
      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(Date localDate)
      Sets date in format yyyy-MM-dd
      Parameters:
      localDate - object.
    • setLocalTime

      public void setLocalTime(Date localTime)
      Sets time in format HH:mm:ss z
      Parameters:
      localTime - object.
    • setDocDate

      public void setDocDate(Date docDate)
      Sets date in format yyyy-MM-dd
      Parameters:
      docDate - object.
    • setDocTime

      public void setDocTime(Date docTime)
      Sets time in format HH:mm:ss z
      Parameters:
      docTime - object.
    • setStyleSheetName

      public void setStyleSheetName(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(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(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(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(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(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(String attributeName, Object attributeValue)
    • setAttributes

      public void setAttributes(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(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(Map<String,Object> attributes)
      Adds all attributes.
      Parameters:
      attributes - to add.
    • toAsciidoctorFlag

      public static String toAsciidoctorFlag(boolean flag)
    • map

      @Deprecated public Map<String,Object> map()
      Deprecated.
      For internal use only.