@asciidoctor/core
    Preparing search index...

    Class Document

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    addRole addSubstitution alt append assignCaption attributeLocked authors basebackend captionedTitle content convert counter counterIncrement deleteAttribute docinfo doctitle enabledOptions findBy firstSection generateDataUri generateDataUriFromUri getAlt getAttribute getAttributes getAuthor getAuthors getBackend getBaseDir getBlocks getCallouts getCaption getCaptionedTitle getCatalog getCompatMode getContent getContentModel getContext getConverter getCounters getDocinfo getDoctitle getDoctype getDocument getDocumentTitle getExtensions getFile getFootnotes getHeader getIconUri getId getImages getImageUri getLevel getLineNumber getLinks getLogger getMediaUri getNodeName getNofooter getNoheader getNotitle getOptions getOutfilesuffix getParent getParentDocument getReader getReferences getRefs getReftext getRevdate getRevisionDate getRevisionInfo getRevisionNumber getRevisionRemark getRole getRoles getSafe getSections getSource getSourceLines getSourceLocation getSourcemap getStyle getSubstitutions getSyntaxHighlighter getTitle getXrefText hasAttribute hasBlocks hasDocinfoProcessors hasExtensions hasFootnotes hasHeader hasOption hasReftext hasRevisionInfo hasRole hasRoleAttribute hasSections hasSub hasSubstitution hasTitle iconUri imageUri incrementAndStoreCounter isAttribute isAttributeLocked isBasebackend isBlock isEmbedded isInline isMultipart isNested isNofooter isNoheader isNotitle isParsed isReftext isUri listMarkerKeyword mediaUri nested nextAdjacentBlock normalizeAssetPath normalizeSystemPath normalizeWebPath parse playbackAttributes precomputeReftext precomputeTitle query readAsset readContents register removeAttribute removeRole removeSub removeSubstitution render resolveId restoreAttributes sections setAttribute setCaption setContentModel setContext setConverter setHeaderAttribute setId setLevel setOption setParent setRole setSourcemap setStyle setTitle source sourceLines updateAttributes write xreftext create

    Constructors

    Properties

    _computingTitle: boolean
    attributes: any
    backend: string
    baseDir: string
    blocks: AbstractBlock<string>[]

    Array of AbstractBlock child blocks for this block. Only applies if content model is compound.

    catalog: any
    compatMode: boolean
    contentModel: string

    Describes the type of content this block accepts and how it should be converted. Acceptable values are:

    • compound - this block contains other blocks
    • simple - this block holds a paragraph of prose that receives normal substitutions
    • verbatim - this block holds verbatim text (displayed "as is") that receives verbatim substitutions
    • raw - this block holds unprocessed content passed directly to the output with no substitutions applied
    • empty - this block has no content
    context: string
    defaultSubs: string[]
    doctype: string
    document: Document
    extensions: any
    header: Section
    id: string
    level: number
    nodeName: string
    numeral: string | number
    options: Readonly<{}>
    outfilesuffix: any
    parentDocument: any
    passthroughs: any[]
    pathResolver: any
    reader: Reader
    safe: number
    sourceLocation: Cursor
    sourcemap: any
    style: string
    subs: string[]
    syntaxHighlighter: any

    Accessors

    • get caption(): string

      Get the caption for this block. For admonition blocks, returns the 'textlabel' attribute instead.

      Returns string

    • set caption(val: string): void

      Set the caption for this block.

      Parameters

      • val: string

      Returns void

    • get converter(): any

      Override AbstractNode's getter so Document can own its converter directly.

      Returns any

    • set converter(v: any): void

      Alias for getConverter.

      Parameters

      • v: any

      Returns void

      the converter instance.

    • get file(): string

      Get the source file where this block started.

      Returns string

    • get lineno(): number

      Get the source line number where this block started.

      Returns number

    • get logger(): any

      Provide a default logger. The Logging mixin (logging.js) overrides this getter on the prototype.

      Returns any

    • get number(): string | number

      Returns string | number

      Get/set the numeral of this section as an integer when possible.

    • set number(val: string | number): void

      Parameters

      • val: string | number

      Returns void

    • get references(): any

      Alias catalog as references (backwards compat).

      Returns any

    • get reftext(): string

      Get the value of the reftext attribute with substitutions applied. The result is pre-computed during Document.parse() via precomputeReftext. Falls back to the raw reftext attribute if precomputeReftext() has not been called yet.

      Returns string

      the String reftext or null if not set.

    • get role(): string | string[]

      Alias for getRole.

      Returns string | string[]

    • set role(names: string | string[]): void

      Set the value of the role attribute on this node.

      Accepts a single role name, a space-separated String, or an Array.

      Parameters

      • names: string | string[]

        A single role name, a space-separated String, or an Array.

      Returns void

    • get title(): string

      Get the String title of this block with title substitutions applied. The result is pre-computed during Document.parse() via precomputeTitle(). Falls back to applyHeaderSubs (sync) if precomputeTitle() has not been called yet (e.g. when a title is set via the API after parsing).

      Returns string

      the converted String title, or null if the source title is falsy.

    • set title(val: string): void

      Set the String block title (clears the memoised converted title).

      Parameters

      • val: string

      Returns void

    Methods

    • Add the given role directly to this node.

      Parameters

      • name: string

        The String role name to add.

      Returns boolean

      true if the role was added, false if it was already present.

    • Get the converted alt text for this block image.

      Returns string

      string with XML special character and replacement substitutions applied.

    • Append a child Block, assigning index if it's a section.

      Parameters

      • block: any

      Returns any

      The appended block.

    • Generate and assign a caption to this block if not already assigned. If the block has a title and a caption prefix is available, builds a caption from the prefix and a counter, then stores it.

      Parameters

      • Optionalvalue: string

        The String caption to assign, or null to derive from document attributes.

      • OptionalcaptionContext: string

        The String context used to look up caption attributes.

      Returns void

    • Parameters

      • name: any

      Returns boolean

      Use isAttributeLocked instead.

    • Parameters

      • base: any

      Returns boolean

    • Convert the parsed document to its output format (HTML5 by default).

      If parse() has not been called yet, it is called automatically.

      Parameters

      • Optionalopts: { outdir?: string; outfile?: string; standalone?: boolean }

        Conversion options.

        • Optionaloutdir?: string

          Directory of the output file; stored as the outdir document attribute during conversion.

        • Optionaloutfile?: string

          Path of the output file; stored as the outfile document attribute during conversion.

        • Optionalstandalone?: boolean

          When true, wraps output in a full document shell (html/head/body). Defaults to the standalone option passed at load time (which itself defaults to true).

      Returns Promise<string>

      The converted output string.

      const doc = await Document.create('= Hello\nWorld', {})
      const html = await doc.convert({ standalone: false })
      const html = await doc.convert({ standalone: true })
      
    • Get the named counter and advance it by one step.

      Counters are document-scoped sequences used for automatic numbering (figures, tables, custom labels, …). Each call increments the sequence and returns the new value. Numeric counters increment by 1; alphabetic counters advance through the alphabet ('a''b' → … → 'z').

      When the counter does not yet exist:

      • If seed is a number (or a string that parses as an integer), the counter starts at seed.
      • If seed is a letter ('a''z'), the counter starts at that letter.
      • If seed is null (default), the counter starts at 1.

      Parameters

      • name: string

        Counter name (document-scoped key).

      • Optionalseed: string | number

        Starting value for new counters.

      Returns string | number

      The new counter value after incrementing.

      doc.counter('figure-number')   // → 1
      doc.counter('figure-number') // → 2
      doc.counter('appendix-number', 'A')  // → 'A'
      doc.counter('appendix-number', 'A') // → 'B'
      doc.counter('example-number', 5)   // → 5
      doc.counter('example-number', 5) // → 6
    • Parameters

      • counterName: any
      • block: any

      Returns string | number

      Use incrementAndStoreCounter instead.

    • Delete the specified attribute if not locked.

      Parameters

      • name: string

      Returns boolean

      True if deleted, false if locked.

    • Read the docinfo file(s) for inclusion in the document template.

      Parameters

      • Optionallocation: string

        'head' or 'footer'.

      • Optionalsuffix: string

        File suffix override.

      Returns Promise<string>

      Combined docinfo content.

    • Resolve the primary title for the document.

      Parameters

      • Optionalopts: { partition?: string | boolean; sanitize?: boolean; use_fallback?: boolean }
        • Optionalpartition?: string | boolean

          Return a DocumentTitle instead of a string.

        • Optionalsanitize?: boolean

          Strip XML tags from the title.

        • Optionaluse_fallback?: boolean

          Use 'untitled-label' if no title found.

      Returns string | DocumentTitle

    • Walk the document tree and find all block-level nodes that match the selector and optional filter function.

      The selector is a plain object whose keys narrow the search:

      • context {string} — node context (e.g. 'section', 'listing', 'paragraph', 'image')
      • style {string} — block style (e.g. 'source', 'NOTE')
      • role {string} — a CSS role that must appear in the node's role list
      • id {string} — exact node id; stops traversal after the first match
      • traverseDocuments {boolean} — when true, recurse into AsciiDoc table cells

      The optional filter function receives each candidate node and must return:

      • a truthy value (or true) → include the node
      • 'prune' → include the node but do not recurse into its children
      • 'reject' → skip the node and its children
      • 'stop' → include the node (if it matched) and stop the entire traversal

      Parameters

      • Optionalselector: any

        Selector criteria object, or a filter callback when called as findBy(callback).

      • Optionalfilter: Function

        Per-node filter callback.

      Returns AbstractBlock<string>[]

      array of matching block-level nodes.

      const listings = doc.findBy({ context: 'listing', style: 'source' })
      
      const sections = doc.findBy({ context: 'section' }, (node) => node.level <= 2 || 'prune')
      
      const [block] = doc.findBy({ id: 'my-anchor' })
      
      const images = doc.findBy({ context: 'image', traverseDocuments: true })
      
      const verbatim = doc.findBy((b) => b.contentModel === ContentModel.VERBATIM)
      
    • Generate a data URI that embeds the image at the given local path.

      The image path is cleaned to prevent access outside the jail when the document safe level is SafeMode.SAFE or higher. The image data is read and Base64-encoded. In non-Node environments this method returns an empty data URI with a warning.

      Parameters

      • targetImage: string

        A String path to the target image.

      • OptionalassetDirKey: string

        The String attribute key for the image directory.

      Returns Promise<string>

      a Promise resolving to a String data URI.

    • Read the image data from the specified URI and generate a data URI.

      The image data is fetched and Base64-encoded. The MIME type is taken from the Content-Type response header.

      NOTE: This method is async in JS (the Fetch API is async). When called from imageUri, the caller must await the returned Promise.

      Parameters

      • imageUri: string

        The URI from which to read the image data (http/https/ftp).

      • OptionalcacheUri: boolean

        A Boolean to control caching (not yet supported in JS).

      Returns Promise<string>

      a Promise resolving to a String data URI.

    • Get the value of the specified attribute.

      Looks for the attribute on this node first. If not found and fallbackName is set, and this node is not the Document node, look for that attribute on the Document node. Otherwise, return defaultValue.

      Parameters

      • name: string

        The attribute name to resolve.

      • OptionaldefaultValue: any

        The value to return if the attribute is not found.

      • OptionalfallbackName: string | boolean

        When truthy, also checks the Document's attributes. Pass true to fall back using the same name, or a string to use a different name.

      Returns any

      the attribute value or defaultValue.

      block.getAttribute('language')           // → 'ruby' or null
      
      block.getAttribute('linenums', false)    // → false if not set
      
      block.getAttribute('source-highlighter', null, true)    // → falls back to doc attribute of same name
      block.getAttribute('linenums', null, 'source-linenums') // → falls back to 'source-linenums' on doc
    • Returns string

      The backend name (e.g. 'html5', 'docbook5').

    • Returns string

      The base directory path.

    • Get the AsciiDoc compatibility mode flag.

      Enabling this attribute activates the following syntax changes:

      • single quotes as constrained emphasis formatting marks
      • single backticks parsed as inline literal, formatted as monospace
      • single plus parsed as constrained, monospaced inline formatting
      • double plus parsed as constrained, monospaced inline formatting

      Returns boolean

      True if compat mode is enabled.

    • Parameters

      • Optionallocation: string
      • Optionalsuffix: string

      Returns Promise<string>

    • Returns string

      The document type (e.g. 'article', 'book').

    • Resolve the primary title for the document.

      Searches the following locations in order, returning the first non-empty value:

      • document-level attribute named title
      • header title (the document title)
      • title of the first section
      • document-level attribute named untitled-label (if opts.use_fallback is set)

      If no value can be resolved, null is returned.

      If opts.partition is specified, the value is parsed into a DocumentTitle object. If opts.sanitize is specified, XML elements are removed from the value.

      Parameters

      • Optionalopts: { partition?: boolean; sanitize?: boolean; use_fallback?: boolean }
        • Optionalpartition?: boolean

          Parse the title into a DocumentTitle with main and subtitle parts.

        • Optionalsanitize?: boolean

          Strip XML/HTML elements from the resolved title.

        • Optionaluse_fallback?: boolean

          Fall back to the untitled-label attribute if no title is found.

      Returns string | DocumentTitle

      The resolved title, or null if none found.

    • Returns any

      The level-0 Section (document header).

    • Get the icon URI for the named icon.

      Parameters

      • name: string

        The String icon name.

      Returns Promise<string>

      a Promise resolving to a String URI.

    • Get the image URI for the target image.

      Parameters

      • targetImage: string

        The String target image path or URL.

      • OptionalassetDirKey: string

        The String asset directory attribute key.

      Returns Promise<string>

      a Promise resolving to a String URI.

    • Returns string[]

      The registered links.

    • Get the media URI for the target.

      Parameters

      • target: string

        The String target path or URL.

      • OptionalassetDirKey: string

        The String asset directory attribute key.

      Returns string

      a String URI.

    • Returns boolean

      True if the nofooter attribute is set.

    • Returns boolean

      True if the noheader attribute is set.

    • Returns boolean

      True if the notitle attribute is set.

    • Returns string

      The output file suffix (e.g. '.html').

    • Get the parent node of this node. Always returns undefined for a root Document (Document is its own internal parent).

      Returns undefined

    • Returns any

      The asset catalog (alias for getCatalog).

    • Returns string

      The revision date (alias for getRevisionDate).

    • Returns string

      The revision date.

    • Returns string

      The revision number.

    • Returns string

      The revision remark.

    • Retrieve the String role names for this node as an Array.

      Returns string[]

      the role names as a String Array, empty if the role attribute is absent.

    • Returns number

      The safe mode level as a numeric value. Corresponds to SafeMode: unsafe (0), safe (1), server (10), secure (20).

    • Returns string

      The raw AsciiDoc source.

    • Returns string[]

      The source lines.

    • Returns boolean

      True if sourcemap is enabled.

    • Returns any

      The syntax highlighter instance.

    • Generate cross-reference text (xreftext) used to refer to this block. Uses the explicit reftext if set. For sections or captioned blocks (blocks with both a title and a caption), formats the text according to xrefstyle. Falls back to the title, or null if no title is available.

      Parameters

      • Optionalxrefstyle: string

        Optional String style: 'full', 'short', or 'basic'.

      Returns Promise<string>

      the xreftext, or null.

    • Check if the specified attribute is defined on this node, with optional value match and document-level fallback.

      Parameters

      • name: string

        The attribute name.

      • OptionalexpectedValue: any

        When truthy, also checks that the resolved value equals this.

      • OptionalfallbackName: string | boolean

        When truthy, also checks the Document's attributes. Pass true to use the same name, or a string for a different fallback name.

      Returns boolean

      block.hasAttribute('linenums')                       // → true/false
      
      block.hasAttribute('language', 'ruby')               // → true only when language === 'ruby'
      
      block.hasAttribute('source-highlighter', null, true) // → also checks doc-level attribute
      
    • Parameters

      • Optionallocation: string

        A location for checking docinfo extensions at a given location (head or footer).

      Returns boolean

      True if docinfo processors are registered for the given location.

    • Check if the specified option attribute is enabled on this node. This method checks whether the <name>-option attribute is set.

      Parameters

      • name: string

        The String or Symbol name of the option.

      Returns boolean

      true if the option is enabled, false otherwise.

    • Returns boolean

      True if any revision info is set.

    • Check if the specified role name is present in this node's role list.

      Parameters

      • name: string

        The String role name to find.

      Returns boolean

    • Check if the role attribute is set on this node, optionally matching an exact value.

      Unlike hasRole, which checks for an individual role name within a space-separated list, this method tests the raw role attribute string as a whole.

      Parameters

      • OptionalexpectedValue: string

        When provided, checks that the role attribute equals this string exactly.

      Returns boolean

      node.hasRoleAttribute()         // → true if role attribute is set at all
      node.hasRoleAttribute('lead') // → true only when role === 'lead' (not 'lead primary')
    • Check whether the specified substitution is enabled for this block.

      Parameters

      • name: string

        The String substitution name.

      Returns boolean

    • Construct a reference or data URI to an icon image for the given name.

      If the 'icon' attribute is set on this node the name is ignored and the attribute value is used as the target path. Otherwise the icon path is built from 'iconsdir', the name, and 'icontype' (default: 'png').

      Parameters

      • name: string

        The String name of the icon.

      Returns Promise<string>

      a Promise resolving to a String reference or data URI for the icon image.

    • Construct a URI reference or data URI to the target image.

      If the target image is already a URI it is left untouched (unless data-uri conversion is requested). The image is resolved relative to the directory named by assetDirKey. When data-uri is enabled and the safe level permits, the image is embedded as a Base64 data URI.

      NOTE: When the document has both 'data-uri' and 'allow-uri-read' enabled and the resolved image URL is a remote URI, this method returns a Promise rather than a String. Await the result when that combination may be active.

      Parameters

      • targetImage: string

        A String path to the target image.

      • OptionalassetDirKey: string

        The String attribute key for the image directory.

      Returns Promise<string>

      a Promise resolving to a String reference or data URI.

    • Increment the specified counter and store it in the block's attributes.

      Parameters

      • counterName: string
      • block: any

      Returns string | number

      The new counter value.

    • Check if the attribute is locked (set via attribute overrides).

      Parameters

      • name: string

      Returns boolean

    • Returns boolean

      True if the basebackend attribute is set.

    • Return whether the document has been fully parsed.

      Returns boolean

    • Check whether this node has reftext — either an explicit 'reftext' attribute or a title that can serve as the cross-reference text. Mirrors Ruby's AbstractNode#reftext?

      Returns boolean

    • Get the list marker keyword for the specified list type.

      Parameters

      • OptionallistType: string

        The String list type (default: this.style).

      Returns string

      the single-character String keyword for the list marker.

    • Construct a URI reference to the target media.

      Parameters

      • target: string

        A String reference to the target media.

      • OptionalassetDirKey: string

        The String attribute key for the media directory.

      Returns string

      a String reference for the target media.

    • Returns boolean

      True if this is a nested (child) document.

    • Normalize the asset file or directory to a concrete and rinsed path.

      Delegates to normalizeSystemPath with start set to document.baseDir.

      Parameters

      • assetRef: string

        The String asset reference to normalize.

      • OptionalassetName: string

        The String label for the asset used in messages.

      • Optionalautocorrect: boolean

        A Boolean indicating whether to recover from an illegal path.

      Returns string

      the normalized String path.

    • Resolve and normalize a secure path from the target and start paths.

      Prevents resolving a path outside the jail (defaulting to document.baseDir) when the document safe level is SafeMode.SAFE or higher.

      Parameters

      • target: string

        The String target path.

      • Optionalstart: string

        The String start (parent) path.

      • Optionaljail: string

        The String jail path.

      • Optionalopts: any

        A plain object of options:

        • recover {boolean} - Whether to automatically recover for illegal paths.
        • targetName {string} - Label used in messages for the path being resolved.

      Returns string

      the resolved String path.

      if a jail is specified and the resolved path is outside it.

    • Normalize the web path using the PathResolver.

      Parameters

      • target: string

        The String target path.

      • Optionalstart: string

        The String start (parent) path.

      • OptionalpreserveUriTarget: boolean

        Whether a URI target should be preserved as-is.

      Returns string

      the resolved String path.

    • Parse the AsciiDoc source and populate the document AST.

      This method is idempotent — repeated calls are no-ops once parsing is done. You rarely need to call it directly: prefer Document.create (factory) or the top-level load / loadFile functions, which call parse() for you.

      Call parse() explicitly only when you constructed new Document(...) by hand and need to defer the work, or when you want to supply a replacement data source.

      Parameters

      • Optionaldata: string | string[]

        Optional replacement source lines. When provided, replaces the data that was given to the constructor.

      Returns Promise<Document>

      This Document instance (allows chaining).

      const doc = new Document('= Hello', {})
      await doc.parse()
      console.log(doc.getTitle()) // → 'Hello'
    • Replay attribute assignments from block attributes.

      Parameters

      • blockAttributes: any

      Returns void

    • Pre-compute the reftext with substitutions applied asynchronously. Called during Document.parse() so the synchronous getter works during conversion.

      Returns Promise<void>

    • Pre-compute the converted title asynchronously. Called during Document.parse() so the synchronous getter works during conversion. Re-entrant calls (circular title references) are detected via _computingTitle and silently skipped so that () can return null (→ "[refid]" fallback).

      Returns Promise<void>

    • Read the contents of the file at the specified path.

      This method checks that the file is readable before attempting to read it.

      Parameters

      • path: string

        The String path from which to read the contents.

      • Optionalopts: any

        A plain object of options:

        • warnOnFailure {boolean} - Whether a warning is issued when the file cannot be read (default: false).
        • normalize {boolean} - Whether lines are normalized and coerced to UTF-8 (default: false).
        • label {string} - Label for the file used in warning messages.

      Returns Promise<string>

      a Promise resolving to the file content, or null if not readable.

    • Resolve the URI or system path to the target, then read and return its contents.

      When the resolved path is a URI and allow-uri-read is enabled, the content is fetched via the Fetch API (async). When it is a local path, the file is read via readAsset.

      Parameters

      • target: string

        The URI or local path String from which to read the data.

      • Optionalopts: any

        A plain object of options:

        • label {string} - Label used in warning messages (default: 'asset').
        • normalize {boolean} - Whether the data should be normalized (default: false).
        • start {string} - Relative base path for resolving the target.
        • warnOnFailure {boolean} - Whether warnings are issued on failure (default: true).
        • warnIfEmpty {boolean} - Whether a warning is issued when the target contents are empty (default: false).

      Returns Promise<string>

      a Promise resolving to the content, or null on failure.

    • Register a reference in the document catalog.

      Parameters

      • type: string

        Catalog type ('ids', 'refs', 'footnotes', 'links', 'images', 'callouts').

      • value: any

        The value to register.

      Returns boolean | Inline

    • Delete the specified attribute if not locked.

      Parameters

      • name: string

        The attribute name to remove.

      Returns string

      The previous value, or undefined if not present or locked.

    • Remove the given role directly from this node.

      Parameters

      • name: string

        The String role name to remove.

      Returns boolean

      true if the role was removed, false if it was not present.

    • Find the first registered reference matching the given reftext.

      Parameters

      • text: string

        The reftext to look up.

      Returns string

      The matching ID, or null.

    • Restore attributes to their saved header state.

      Returns void

    • Set the specified attribute if not locked, applying attribute value substitutions.

      Parameters

      • name: string
      • Optionalvalue: string

      Returns string

      The substituted value, or null if the attribute is locked.

    • Update the context of this block, also updating the node name.

      Parameters

      • context: string

        The String context to assign to this block.

      Returns void

    • Set the converter instance for this document.

      Parameters

      • converter: any

        The converter instance.

      Returns void

    • Assign a value to the specified attribute in the document header.

      Parameters

      • name: string
      • Optionalvalue: string
      • Optionaloverwrite: boolean

      Returns boolean

      False if the attribute exists and overwrite is false.

    • Set the specified option on this node by setting the <name>-option attribute.

      Parameters

      • name: string

        The String name of the option.

      Returns void

    • Set the value of the role attribute on this node.

      Accepts a single role name, a space-separated String, an Array, or spread arguments.

      Parameters

      • ...names: (string | string[])[]

        A single role name, a space-separated String, an Array, or multiple role names as spread arguments.

      Returns string

      the value of the role attribute.

    • Parameters

      • val: boolean

      Returns void

    • Update the attributes of this node with the new values.

      Parameters

      • newAttributes: any

        A plain object of additional attributes to assign.

      Returns any

      the updated attributes object on this node.

    • Write converted output to a file path or a writable stream.

      When target is a string, the output is written to that file path using node:fs/promises.writeFile. When target is a writable stream (has a .write() method), the output is written to the stream in two chunks (content + newline). When the converter itself implements write(), that method is called instead.

      Parameters

      • output: string

        The converted output string returned by convert.

      • target: any

        File path or writable stream.

      Returns Promise<void>

      const output = await doc.convert()
      await doc.write(output, 'out/index.html')
      await doc.write(output, process.stdout)
      
    • Alias for getXrefText.

      Parameters

      • Optionalxrefstyle: string

        Optional String style: 'full', 'short', or 'basic'.

      Returns Promise<string>

      the xreftext, or null.

    • Factory — create and fully parse a Document asynchronously.

      Parameters

      • data: string | string[]

        The AsciiDoc source.

      • Optionaloptions: any

        Processing options.

      Returns Promise<Document>

      The parsed Document.