{"_id":"@asciidoc-js/adast","name":"@asciidoc-js/adast","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@asciidoc-js/adast","version":"1.0.0","description":"AsciiDoc Abstract Syntax Tree format","keywords":["unist","adast","asciidoc","ast","syntax-tree"],"homepage":"https://github.com/asciidoc-js/adast#readme","bugs":{"url":"https://github.com/asciidoc-js/adast/issues"},"repository":{"type":"git","url":"git+https://github.com/asciidoc-js/adast.git"},"license":"MIT","author":{"name":"Pablo Angelani","email":"pablo.angelani@gmail.com","url":"https://www.linkedin.com/in/pabloangelani/"},"type":"module","exports":{".":{"types":"./index.d.ts"}},"main":"index.js","types":"./index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"dependencies":{"@types/unist":"^3.0.0"},"devDependencies":{"typescript":"^5.0.0"},"gitHead":"344cf303d591d5b54c7fb9d5cdb9b1ec2edc6187","_id":"@asciidoc-js/adast@1.0.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-RrtHtsmOY9pyj3XkM15vXqZrM6UUzaFe9Ttnm7sxL5jKnw1LJkrTenznFhPg4UCYYRrE6B258/Icm/vK35r1cg==","shasum":"78dc790dfbde2dd7e19a1239bb4644b34ef88365","tarball":"https://registry.npmjs.org/@asciidoc-js/adast/-/adast-1.0.0.tgz","fileCount":4,"unpackedSize":59068,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDoabN1PjW1Etl/9pbmol5zlN6RyouZT+Sa0VK4opXgVAiBpqB9O3folEZXhaykWO0FQ0eLWSKs1pBxNwIaOoHq9zQ=="}]},"_npmUser":{"name":"pablo.angelani","email":"pablo.angelani@gmail.com"},"directories":{},"maintainers":[{"name":"pablo.angelani","email":"pablo.angelani@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adast_1.0.0_1775341625109_0.8403365014658832"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-04T22:27:04.668Z","1.0.0":"2026-04-04T22:27:05.253Z","modified":"2026-04-04T22:27:05.490Z"},"maintainers":[{"name":"pablo.angelani","email":"pablo.angelani@gmail.com"}],"description":"AsciiDoc Abstract Syntax Tree format","homepage":"https://github.com/asciidoc-js/adast#readme","keywords":["unist","adast","asciidoc","ast","syntax-tree"],"repository":{"type":"git","url":"git+https://github.com/asciidoc-js/adast.git"},"author":{"name":"Pablo Angelani","email":"pablo.angelani@gmail.com","url":"https://www.linkedin.com/in/pabloangelani/"},"bugs":{"url":"https://github.com/asciidoc-js/adast/issues"},"license":"MIT","readme":"# ADAST\n\n**AsciiDoc Abstract Syntax Tree** format.\n\n---\n\n## Contents\n\n- [Introduction](#introduction)\n- [Where this specification fits](#where-this-specification-fits)\n- [Types](#types)\n- [Nodes (abstract)](#nodes-abstract)\n- [Nodes (root)](#nodes-root)\n- [Nodes (sections)](#nodes-sections)\n- [Nodes (compound blocks)](#nodes-compound-blocks)\n- [Nodes (leaf blocks)](#nodes-leaf-blocks)\n- [Nodes (void blocks)](#nodes-void-blocks)\n- [Nodes (lists)](#nodes-lists)\n- [Nodes (table)](#nodes-table)\n- [Nodes (inline — parent)](#nodes-inline--parent)\n- [Nodes (inline — literal)](#nodes-inline--literal)\n- [Nodes (inline — void)](#nodes-inline--void)\n- [Content model](#content-model)\n- [Glossary](#glossary)\n- [Mapping to Asciidoctor](#mapping-to-asciidoctor)\n- [References](#references)\n\n## Introduction\n\nThis document defines a format for representing [AsciiDoc][] documents as\n[abstract syntax trees][unist]. Development of adast started in 2025.\nThis spec is written in a [Web IDL][webidl]-like grammar.\n\n### Where this specification fits\n\nadast extends [unist][], a format for syntax trees, to benefit from its\n[ecosystem of utilities][unist-utilities].\n\nadast relates to [mdast][] (Markdown) and [hast][] (HTML) as a sibling\nspecification — all three extend unist but represent different source\nlanguages. Converters between the formats (e.g., adast-to-mdast) can live\nin separate packages.\n\nAn adast tree is typically produced by parsing an AsciiDoc document with a\ntool such as [Asciidoctor][] and can be serialized back\nto AsciiDoc source, converted to hast for HTML rendering, or processed by any\nunist utility.\n\n## Types\n\nTypeScript types for adast nodes are published as the\n[`adast`](https://www.npmjs.com/package/@asciidoc-js/adast) npm package:\n\n```sh\nnpm install --save-dev @asciidoc-js/adast\n```\n\n```ts\nimport type {Document, Paragraph, Section} from '@asciidoc-js/adast'\n```\n\n## Nodes (abstract)\n\nadast inherits the abstract node types from [unist][]:\n\n### `Node`\n\n```idl\ninterface Node {\n  type: string\n  data: Data?\n  position: Position?\n}\n```\n\nThe **type** field is a non-empty string that identifies the node variant.\n\nThe **data** field is an optional object for storing implementation-specific\ninformation that does not need to be in the AST.\n\nThe **position** field is an optional object indicating where the node\noriginates in the source document.\n\n### `Parent`\n\n```idl\ninterface Parent <: Node {\n  children: [Node]\n}\n```\n\nA node that contains other nodes.\n\n### `Literal`\n\n```idl\ninterface Literal <: Node {\n  value: string\n}\n```\n\nA node that contains a text value.\n\n### `Attributes`\n\n```idl\ndictionary Attributes {\n  [name: string]: string | number | boolean | null\n}\n```\n\nA key-value map of [AsciiDoc attributes][asciidoc-attributes]. Present on\nmost block and inline nodes. Attribute names are lowercase strings; values\nare typically strings.\n\n---\n\n## Nodes (root)\n\n### `Document`\n\n```idl\ninterface Document <: Parent {\n  type: 'document'\n  doctype: 'article' | 'book' | 'manpage' | 'inline'?\n  title: string?\n  attributes: Attributes?\n  children: [DocumentContent]\n  data: DocumentData?\n}\n```\n\n**Document** ([Parent][dfn-parent]) represents a complete AsciiDoc document.\nIt is always the root of the tree.\n\n**doctype** indicates the document type — `'article'` (default), `'book'`,\n`'manpage'`, or `'inline'`.\n\n**title** is the resolved document title (level-0 heading), or `null` if the\ndocument has no title.\n\n**attributes** holds document-level attributes set with `:name: value` lines\nin the document header.\n\nFor example, the AsciiDoc document:\n\n```asciidoc\n= My Document\nAuthor Name\n:toc:\n\nSome introductory text.\n\n== First Section\n\nContent here.\n```\n\nYields:\n\n```json\n{\n  \"type\": \"document\",\n  \"doctype\": \"article\",\n  \"title\": \"My Document\",\n  \"attributes\": {\"toc\": \"\"},\n  \"children\": [\n    {\n      \"type\": \"preamble\",\n      \"children\": [\n        {\n          \"type\": \"paragraph\",\n          \"children\": [{\"type\": \"text\", \"value\": \"Some introductory text.\"}]\n        }\n      ]\n    },\n    {\n      \"type\": \"section\",\n      \"depth\": 1,\n      \"title\": \"First Section\",\n      \"children\": [\n        {\n          \"type\": \"paragraph\",\n          \"children\": [{\"type\": \"text\", \"value\": \"Content here.\"}]\n        }\n      ]\n    }\n  ]\n}\n```\n\n### `Preamble`\n\n```idl\ninterface Preamble <: Parent {\n  type: 'preamble'\n  children: [BlockContent]\n}\n```\n\n**Preamble** ([Parent][dfn-parent]) represents content between the document\nheader and the first section. A document has at most one preamble, and it is\nalways the first child of the document (when present).\n\n---\n\n## Nodes (sections)\n\n### `Section`\n\n```idl\ninterface Section <: Parent {\n  type: 'section'\n  depth: 0 | 1 | 2 | 3 | 4 | 5\n  title: string\n  numbered: boolean?\n  sectname: string?\n  numeral: string?\n  id: string?\n  attributes: Attributes?\n  children: [Section | BlockContent]\n}\n```\n\n**Section** ([Parent][dfn-parent]) represents a document section created by\na heading marker (`=` through `======`).\n\n**depth** indicates the nesting level: 0 for the document title / part level,\n1 through 5 for section levels.\n\n**title** is the resolved section title text (after substitutions).\n\n**sectname** classifies the section kind. Standard values:\n\n| Value               | Meaning                          |\n| ------------------- | -------------------------------- |\n| `'section'`         | Normal section                   |\n| `'chapter'`         | Level 1 in book doctype          |\n| `'part'`            | Level 0 in multi-part book       |\n| `'appendix'`        | Appendix section                 |\n| `'preface'`         | Preface                          |\n| `'colophon'`        | Colophon                         |\n| `'dedication'`      | Dedication                       |\n| `'acknowledgments'` | Acknowledgments                  |\n| `'glossary'`        | Glossary                         |\n| `'bibliography'`    | Bibliography                     |\n| `'index'`           | Index                            |\n| `'abstract'`        | Abstract                         |\n| `'synopsis'`        | Synopsis (manpage)               |\n\nChildren of a section can be nested sections (of greater depth) and block\ncontent.\n\nFor example:\n\n```asciidoc\n== Introduction\n\nParagraph text.\n\n=== Background\n\nMore details.\n```\n\nYields:\n\n```json\n{\n  \"type\": \"section\",\n  \"depth\": 1,\n  \"title\": \"Introduction\",\n  \"sectname\": \"section\",\n  \"children\": [\n    {\n      \"type\": \"paragraph\",\n      \"children\": [{\"type\": \"text\", \"value\": \"Paragraph text.\"}]\n    },\n    {\n      \"type\": \"section\",\n      \"depth\": 2,\n      \"title\": \"Background\",\n      \"sectname\": \"section\",\n      \"children\": [\n        {\n          \"type\": \"paragraph\",\n          \"children\": [{\"type\": \"text\", \"value\": \"More details.\"}]\n        }\n      ]\n    }\n  ]\n}\n```\n\n---\n\n## Nodes (compound blocks)\n\nCompound blocks contain other block-level nodes as children.\n\n### `Paragraph`\n\n```idl\ninterface Paragraph <: Parent {\n  type: 'paragraph'\n  id: string?\n  attributes: Attributes?\n  children: [InlineContent]\n}\n```\n\n**Paragraph** ([Parent][dfn-parent]) represents a block of prose.\nIts children are inline content nodes.\n\n### `Admonition`\n\n```idl\ninterface Admonition <: Parent {\n  type: 'admonition'\n  name: 'note' | 'tip' | 'important' | 'warning' | 'caution'\n  textlabel: string?\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [BlockContent]\n}\n```\n\n**Admonition** ([Parent][dfn-parent]) represents a call-out block with a\nseverity label.\n\n**name** identifies the admonition type.\n\nCan be created from a paragraph-style shorthand (`NOTE: text`) — in which\ncase children will contain a single Paragraph — or from a delimited block\nwith admonition style (`[NOTE]` on an `====` block).\n\nFor example:\n\n```asciidoc\nNOTE: Remember to save your work.\n```\n\nYields:\n\n```json\n{\n  \"type\": \"admonition\",\n  \"name\": \"note\",\n  \"textlabel\": \"Note\",\n  \"children\": [\n    {\n      \"type\": \"paragraph\",\n      \"children\": [{\"type\": \"text\", \"value\": \"Remember to save your work.\"}]\n    }\n  ]\n}\n```\n\n### `Example`\n\n```idl\ninterface Example <: Parent {\n  type: 'example'\n  title: string?\n  caption: string?\n  id: string?\n  attributes: Attributes?\n  children: [BlockContent]\n}\n```\n\n**Example** ([Parent][dfn-parent]) represents an example block —\n`====` delimiters.\n\n### `Sidebar`\n\n```idl\ninterface Sidebar <: Parent {\n  type: 'sidebar'\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [BlockContent]\n}\n```\n\n**Sidebar** ([Parent][dfn-parent]) represents a sidebar block —\n`****` delimiters.\n\n### `Quote`\n\n```idl\ninterface Quote <: Parent {\n  type: 'quote'\n  title: string?\n  attribution: string?\n  citetitle: string?\n  id: string?\n  attributes: Attributes?\n  children: [BlockContent]\n}\n```\n\n**Quote** ([Parent][dfn-parent]) represents a blockquote — `____` delimiters.\n\n**attribution** names the quoted person or source.\n**citetitle** identifies the source work.\n\nFor example:\n\n```asciidoc\n[quote, Albert Einstein]\n____\nImagination is more important than knowledge.\n____\n```\n\nYields:\n\n```json\n{\n  \"type\": \"quote\",\n  \"attribution\": \"Albert Einstein\",\n  \"children\": [\n    {\n      \"type\": \"paragraph\",\n      \"children\": [\n        {\"type\": \"text\", \"value\": \"Imagination is more important than knowledge.\"}\n      ]\n    }\n  ]\n}\n```\n\n### `Open`\n\n```idl\ninterface Open <: Parent {\n  type: 'open'\n  style: string?\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [BlockContent]\n}\n```\n\n**Open** ([Parent][dfn-parent]) represents an open block — `--` delimiters.\n\nThe **style** attribute can morph it into other block types:\n`'abstract'`, `'partintro'`, `'comment'`, `'example'`, `'literal'`,\n`'listing'`, `'pass'`, `'quote'`, `'sidebar'`, `'source'`, `'verse'`,\n`'admonition'`.\n\n---\n\n## Nodes (leaf blocks)\n\nLeaf blocks contain text content (a `value` string) rather than child nodes.\n\n### `Listing`\n\n```idl\ninterface Listing <: Literal {\n  type: 'listing'\n  value: string\n  style: 'source'?\n  language: string?\n  title: string?\n  caption: string?\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Listing** ([Literal][dfn-literal]) represents a listing block —\n`----` delimiters.\n\nWhen **style** is `'source'`, the block is a source code block with optional\nsyntax highlighting via the **language** field.\n\nFor example:\n\n```asciidoc\n[source,javascript]\n----\nconsole.log('Hello, world!')\n----\n```\n\nYields:\n\n```json\n{\n  \"type\": \"listing\",\n  \"style\": \"source\",\n  \"language\": \"javascript\",\n  \"value\": \"console.log('Hello, world!')\"\n}\n```\n\n### `Literal`\n\n```idl\ninterface Literal <: Literal {\n  type: 'literal'\n  value: string\n  title: string?\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Literal** ([Literal][dfn-literal]) represents a literal block —\n`....` delimiters or indented lines.\n\nContent is rendered monospace, preserving whitespace. Only special-character\nsubstitutions are applied.\n\n### `Verse`\n\n```idl\ninterface Verse <: Literal {\n  type: 'verse'\n  value: string\n  attribution: string?\n  citetitle: string?\n  title: string?\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Verse** ([Literal][dfn-literal]) represents a verse block — a `____` block\nwith `[verse]` style.\n\nLine breaks are preserved as written. Typically used for poetry.\n\n### `Pass`\n\n```idl\ninterface Pass <: Literal {\n  type: 'pass'\n  value: string\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Pass** ([Literal][dfn-literal]) represents a passthrough block —\n`++++` delimiters. Content is passed to the output without substitution.\n\n### `Stem`\n\n```idl\ninterface Stem <: Literal {\n  type: 'stem'\n  value: string\n  style: 'asciimath' | 'latexmath'?\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Stem** ([Literal][dfn-literal]) represents a STEM (math) block.\n\n**style** indicates the notation format.\n\n---\n\n## Nodes (void blocks)\n\nVoid blocks have no text content and no children.\n\n### `Image`\n\n```idl\ninterface Image <: Node {\n  type: 'image'\n  target: string\n  alt: string?\n  title: string?\n  caption: string?\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Image** ([Node][dfn-node]) represents a block image —\n`image::target[alt]`.\n\n### `Audio`\n\n```idl\ninterface Audio <: Node {\n  type: 'audio'\n  target: string\n  title: string?\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Audio** ([Node][dfn-node]) represents a block audio macro.\n\n### `Video`\n\n```idl\ninterface Video <: Node {\n  type: 'video'\n  target: string\n  title: string?\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Video** ([Node][dfn-node]) represents a block video macro.\n\n### `ThematicBreak`\n\n```idl\ninterface ThematicBreak <: Node {\n  type: 'thematicBreak'\n}\n```\n\n**ThematicBreak** ([Node][dfn-node]) represents a horizontal rule — `'''`.\n\n### `PageBreak`\n\n```idl\ninterface PageBreak <: Node {\n  type: 'pageBreak'\n}\n```\n\n**PageBreak** ([Node][dfn-node]) represents a page break — `<<<`.\n\n### `Toc`\n\n```idl\ninterface Toc <: Node {\n  type: 'toc'\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Toc** ([Node][dfn-node]) represents a table-of-contents macro — `toc::[]`.\n\n### `FloatingTitle`\n\n```idl\ninterface FloatingTitle <: Parent {\n  type: 'floatingTitle'\n  depth: 1 | 2 | 3 | 4 | 5\n  id: string?\n  attributes: Attributes?\n  children: [InlineContent]\n}\n```\n\n**FloatingTitle** ([Parent][dfn-parent]) represents a discrete heading — a\nheading with the `[discrete]` attribute that does not create a section.\n\n---\n\n## Nodes (lists)\n\n### `UnorderedList`\n\n```idl\ninterface UnorderedList <: Parent {\n  type: 'unorderedList'\n  style: string?\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [ListItem]\n}\n```\n\n**UnorderedList** ([Parent][dfn-parent]) represents a bullet list —\nlines starting with `*`, `-`, etc.\n\n### `OrderedList`\n\n```idl\ninterface OrderedList <: Parent {\n  type: 'orderedList'\n  style: 'arabic' | 'loweralpha' | 'upperalpha' | 'lowerroman' | 'upperroman' | 'lowergreek'?\n  start: number?\n  reversed: boolean?\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [ListItem]\n}\n```\n\n**OrderedList** ([Parent][dfn-parent]) represents a numbered list —\nlines starting with `.`, `..`, etc.\n\n### `DescriptionList`\n\n```idl\ninterface DescriptionList <: Parent {\n  type: 'descriptionList'\n  style: string?\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [DescriptionListEntry]\n}\n```\n\n**DescriptionList** ([Parent][dfn-parent]) represents a description\n(definition) list — `term:: description` entries.\n\n### `CalloutList`\n\n```idl\ninterface CalloutList <: Parent {\n  type: 'calloutList'\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [ListItem]\n}\n```\n\n**CalloutList** ([Parent][dfn-parent]) represents a callout list —\nexplanations for callout markers in listing/literal blocks.\n\n### `ListItem`\n\n```idl\ninterface ListItem <: Parent {\n  type: 'listItem'\n  marker: string?\n  checked: boolean?\n  attributes: Attributes?\n  children: [BlockContent]\n}\n```\n\n**ListItem** ([Parent][dfn-parent]) represents a single item in an\nunordered, ordered, or callout list.\n\n**marker** is the source marker string (e.g., `'*'`, `'.'`).\n\n**checked** indicates checkbox state for task list items: `true` for checked\n(`[x]`), `false` for unchecked (`[ ]`), `undefined` for regular items.\n\n### `DescriptionListEntry`\n\n```idl\ninterface DescriptionListEntry <: Parent {\n  type: 'descriptionListEntry'\n  children: [DescriptionListTerm | DescriptionListDescription]\n}\n```\n\n**DescriptionListEntry** ([Parent][dfn-parent]) groups one or more terms\nwith an optional description in a {@link DescriptionList}.\n\n### `DescriptionListTerm`\n\n```idl\ninterface DescriptionListTerm <: Parent {\n  type: 'descriptionListTerm'\n  children: [InlineContent]\n}\n```\n\n**DescriptionListTerm** ([Parent][dfn-parent]) is a term in a\ndescription list entry.\n\n### `DescriptionListDescription`\n\n```idl\ninterface DescriptionListDescription <: Parent {\n  type: 'descriptionListDescription'\n  children: [BlockContent]\n}\n```\n\n**DescriptionListDescription** ([Parent][dfn-parent]) is the description\npart of a description list entry.\n\n---\n\n## Nodes (table)\n\n### `Table`\n\n```idl\ninterface Table <: Parent {\n  type: 'table'\n  columns: [TableColumn]\n  title: string?\n  caption: string?\n  id: string?\n  attributes: Attributes?\n  children: [TableHead | TableBody | TableFoot]\n}\n```\n\n**Table** ([Parent][dfn-parent]) represents a table block — `|===`.\n\n**columns** is an array of [TableColumn](#tablecolumn) objects describing\neach column's alignment, width, and default style.\n\nChildren are table sections: an optional [TableHead](#tablehead), one or more\n[TableBody](#tablebody), and an optional [TableFoot](#tablefoot).\n\n### `TableColumn`\n\n```idl\ndictionary TableColumn {\n  halign: 'left' | 'center' | 'right'?\n  valign: 'top' | 'middle' | 'bottom'?\n  width: number?\n  colpcwidth: number?\n  style: 'asciidoc' | 'emphasis' | 'header' | 'literal' | 'monospaced' | 'strong'?\n}\n```\n\n**TableColumn** is a data object (not a node) that describes default\nproperties for a column.\n\n### `TableHead`\n\n```idl\ninterface TableHead <: Parent {\n  type: 'tableHead'\n  children: [TableRow]\n}\n```\n\n**TableHead** ([Parent][dfn-parent]) contains the header row(s) of a table.\n\n### `TableBody`\n\n```idl\ninterface TableBody <: Parent {\n  type: 'tableBody'\n  children: [TableRow]\n}\n```\n\n**TableBody** ([Parent][dfn-parent]) contains the body rows of a table.\n\n### `TableFoot`\n\n```idl\ninterface TableFoot <: Parent {\n  type: 'tableFoot'\n  children: [TableRow]\n}\n```\n\n**TableFoot** ([Parent][dfn-parent]) contains the footer row(s) of a table.\n\n### `TableRow`\n\n```idl\ninterface TableRow <: Parent {\n  type: 'tableRow'\n  children: [TableCell]\n}\n```\n\n**TableRow** ([Parent][dfn-parent]) represents a row in a table section.\n\n### `TableCell`\n\n```idl\ninterface TableCell <: Parent {\n  type: 'tableCell'\n  colspan: number?\n  rowspan: number?\n  halign: 'left' | 'center' | 'right'?\n  valign: 'top' | 'middle' | 'bottom'?\n  style: 'asciidoc' | 'emphasis' | 'header' | 'literal' | 'monospaced' | 'strong'?\n  children: [BlockContent | InlineContent]\n}\n```\n\n**TableCell** ([Parent][dfn-parent]) represents a cell in a table row.\n\nWhen **style** is `'asciidoc'`, the cell contains a nested AsciiDoc document\nand children are block content. Otherwise children are inline content.\n\n---\n\n## Nodes (inline — parent)\n\nInline parent nodes contain other inline nodes as children.\n\n### `Strong`\n\n```idl\ninterface Strong <: Parent {\n  type: 'strong'\n  id: string?\n  attributes: Attributes?\n  children: [InlineContent]\n}\n```\n\n**Strong** ([Parent][dfn-parent]) represents bold text — `*text*` or\n`**text**`.\n\n### `Emphasis`\n\n```idl\ninterface Emphasis <: Parent {\n  type: 'emphasis'\n  id: string?\n  attributes: Attributes?\n  children: [InlineContent]\n}\n```\n\n**Emphasis** ([Parent][dfn-parent]) represents italic text — `_text_` or\n`__text__`.\n\n### `Mark`\n\n```idl\ninterface Mark <: Parent {\n  type: 'mark'\n  id: string?\n  attributes: Attributes?\n  children: [InlineContent]\n}\n```\n\n**Mark** ([Parent][dfn-parent]) represents highlighted text — `#text#` or\n`##text##`.\n\n### `Superscript`\n\n```idl\ninterface Superscript <: Parent {\n  type: 'superscript'\n  children: [InlineContent]\n}\n```\n\n**Superscript** ([Parent][dfn-parent]) — `^text^`.\n\n### `Subscript`\n\n```idl\ninterface Subscript <: Parent {\n  type: 'subscript'\n  children: [InlineContent]\n}\n```\n\n**Subscript** ([Parent][dfn-parent]) — `~text~`.\n\n### `DoubleQuoted`\n\n```idl\ninterface DoubleQuoted <: Parent {\n  type: 'doubleQuoted'\n  children: [InlineContent]\n}\n```\n\n**DoubleQuoted** ([Parent][dfn-parent]) represents smart/typographic double\nquotes — `` \"`text`\" ``.\n\n### `SingleQuoted`\n\n```idl\ninterface SingleQuoted <: Parent {\n  type: 'singleQuoted'\n  children: [InlineContent]\n}\n```\n\n**SingleQuoted** ([Parent][dfn-parent]) represents smart/typographic single\nquotes — `` '`text`' ``.\n\n### `Link`\n\n```idl\ninterface Link <: Parent {\n  type: 'link'\n  url: string\n  title: string?\n  id: string?\n  attributes: Attributes?\n  children: [InlineContent]\n}\n```\n\n**Link** ([Parent][dfn-parent]) represents a hyperlink — `link:url[text]`\nor an auto-detected URL.\n\n### `CrossReference`\n\n```idl\ninterface CrossReference <: Parent {\n  type: 'crossReference'\n  target: string\n  refid: string?\n  path: string?\n  fragment: string?\n  id: string?\n  attributes: Attributes?\n  children: [InlineContent]\n}\n```\n\n**CrossReference** ([Parent][dfn-parent]) represents a cross-reference to\nanother location — `<<id>>` or `xref:target[]`.\n\n**target** is the raw reference target.\n**refid** is the resolved reference ID (without `#`).\n**path** and **fragment** are the path and fragment components for\ninter-document references.\n\n### `Footnote`\n\n```idl\ninterface Footnote <: Parent {\n  type: 'footnote'\n  identifier: string?\n  index: number?\n  children: [InlineContent]\n}\n```\n\n**Footnote** ([Parent][dfn-parent]) represents a footnote —\n`footnote:[text]`.\n\n---\n\n## Nodes (inline — literal)\n\nInline literal nodes contain a text value rather than child nodes.\n\n### `Text`\n\n```idl\ninterface Text <: Literal {\n  type: 'text'\n  value: string\n}\n```\n\n**Text** ([Literal][dfn-literal]) represents plain text content.\n\n### `Monospaced`\n\n```idl\ninterface Monospaced <: Literal {\n  type: 'monospaced'\n  value: string\n  id: string?\n  attributes: Attributes?\n}\n```\n\n**Monospaced** ([Literal][dfn-literal]) represents inline code text —\n`` `text` `` or ``` ``text`` ```.\n\n### `InlinePass`\n\n```idl\ninterface InlinePass <: Literal {\n  type: 'inlinePass'\n  value: string\n}\n```\n\n**InlinePass** ([Literal][dfn-literal]) represents an inline passthrough —\n`+text+` or `pass:[text]`.\n\n---\n\n## Nodes (inline — void)\n\nVoid inline nodes have no children and no text value.\n\n### `Anchor`\n\n```idl\ninterface Anchor <: Node {\n  type: 'anchor'\n  identifier: string\n  reftext: string?\n}\n```\n\n**Anchor** ([Node][dfn-node]) represents an inline anchor (bookmark) —\n`[[id]]` or `anchor:id[]`.\n\n### `BibliographyReference`\n\n```idl\ninterface BibliographyReference <: Node {\n  type: 'bibliographyReference'\n  identifier: string\n  label: string?\n}\n```\n\n**BibliographyReference** ([Node][dfn-node]) represents a bibliography\nentry — `[[[id]]]` or `[[[id, label]]]`.\n\n### `InlineImage`\n\n```idl\ninterface InlineImage <: Node {\n  type: 'inlineImage'\n  target: string\n  alt: string?\n  attributes: Attributes?\n}\n```\n\n**InlineImage** ([Node][dfn-node]) represents an inline image —\n`image:target[alt]`.\n\n### `Icon`\n\n```idl\ninterface Icon <: Node {\n  type: 'icon'\n  name: string\n  attributes: Attributes?\n}\n```\n\n**Icon** ([Node][dfn-node]) represents an inline icon — `icon:name[]`.\n\n### `LineBreak`\n\n```idl\ninterface LineBreak <: Node {\n  type: 'lineBreak'\n}\n```\n\n**LineBreak** ([Node][dfn-node]) represents a hard line break — `+` at end\nof line.\n\n### `InlineCallout`\n\n```idl\ninterface InlineCallout <: Node {\n  type: 'inlineCallout'\n  number: number\n}\n```\n\n**InlineCallout** ([Node][dfn-node]) represents a callout marker in a\nlisting block — `<1>`, `<2>`, etc.\n\n### `Keyboard`\n\n```idl\ninterface Keyboard <: Node {\n  type: 'keyboard'\n  keys: [string]\n}\n```\n\n**Keyboard** ([Node][dfn-node]) represents a keyboard shortcut —\n`kbd:[Ctrl+Alt+Del]`.\n\n### `Button`\n\n```idl\ninterface Button <: Node {\n  type: 'button'\n  label: string\n}\n```\n\n**Button** ([Node][dfn-node]) represents a UI button — `btn:[Save]`.\n\n### `Menu`\n\n```idl\ninterface Menu <: Node {\n  type: 'menu'\n  menuName: string\n  submenus: [string]\n  menuitem: string\n}\n```\n\n**Menu** ([Node][dfn-node]) represents a menu selection —\n`menu:File[Save As...]`.\n\n### `IndexTerm`\n\n```idl\ninterface IndexTerm <: Node {\n  type: 'indexTerm'\n  terms: [string]\n  visible: boolean?\n}\n```\n\n**IndexTerm** ([Node][dfn-node]) represents an index entry —\n`indexterm:[primary, secondary, tertiary]` or `((primary))`.\n\n---\n\n## Content model\n\nEach node belongs to one or more content categories that constrain where it\nmay appear in the tree.\n\n| Category                    | Description                                     |\n| --------------------------- | ----------------------------------------------- |\n| **DocumentContent**         | Nodes that can be children of Document           |\n| **SectionContent**          | Nodes that can be children of Section            |\n| **BlockContent**            | Block-level nodes for any compound container     |\n| **ListContent**             | Children of lists (ListItem)                     |\n| **DescriptionListContent**  | Children of description lists                    |\n| **TableContent**            | Children of tables (table sections)              |\n| **RowContent**              | Children of table sections (TableRow)            |\n| **InlineContent**           | Inline (phrasing) content                        |\n\n### DocumentContent\n\n```\nDocumentContent = Preamble | Section | BlockContent\n```\n\n### SectionContent\n\n```\nSectionContent = Section | BlockContent\n```\n\n### BlockContent\n\n```\nBlockContent = Paragraph | Admonition | Listing | Literal | Example\n             | Sidebar | Quote | Verse | Open | Pass | Stem | Table\n             | Image | Audio | Video | ThematicBreak | PageBreak | Toc\n             | FloatingTitle | UnorderedList | OrderedList\n             | DescriptionList | CalloutList\n```\n\n### InlineContent\n\n```\nInlineContent = Text | Strong | Emphasis | Monospaced | Superscript\n              | Subscript | Mark | DoubleQuoted | SingleQuoted | Link\n              | CrossReference | Anchor | BibliographyReference\n              | InlineImage | Icon | Footnote | LineBreak\n              | InlineCallout | Keyboard | Button | Menu | IndexTerm\n              | InlinePass\n```\n\n---\n\n## Glossary\n\n- **block content** — content that participates in the block layout flow\n  (paragraphs, sections, lists, tables, etc.)\n- **compound block** — a block whose content model is `'compound'`,\n  meaning it contains other blocks as children\n- **inline content** — content that participates in the inline (text) flow\n  (formatted text, links, images, etc.)\n- **leaf block** — a block whose content model is `'simple'`, `'verbatim'`,\n  or `'raw'`, meaning it holds text content\n- **void block** — a block whose content model is `'empty'`, meaning it has\n  neither text content nor children\n\n---\n\n## Mapping to Asciidoctor\n\nThe following table maps adast node types to Asciidoctor's internal\n`context` values and classes.\n\n| adast type               | Asciidoctor context    | Asciidoctor class  |\n| --------------------------- | ---------------------- | ------------------ |\n| `document`                  | `document`             | `Document`         |\n| `preamble`                  | `preamble`             | `Block`            |\n| `section`                   | `section`              | `Section`          |\n| `paragraph`                 | `paragraph`            | `Block`            |\n| `admonition`                | `admonition`           | `Block`            |\n| `listing`                   | `listing`              | `Block`            |\n| `literal`                   | `literal`              | `Block`            |\n| `example`                   | `example`              | `Block`            |\n| `sidebar`                   | `sidebar`              | `Block`            |\n| `quote`                     | `quote`                | `Block`            |\n| `verse`                     | `verse`                | `Block`            |\n| `open`                      | `open`                 | `Block`            |\n| `pass`                      | `pass`                 | `Block`            |\n| `stem`                      | `stem`                 | `Block`            |\n| `image`                     | `image`                | `Block`            |\n| `audio`                     | `audio`                | `Block`            |\n| `video`                     | `video`                | `Block`            |\n| `thematicBreak`             | `thematic_break`       | `Block`            |\n| `pageBreak`                 | `page_break`           | `Block`            |\n| `toc`                       | `toc`                  | `Block`            |\n| `floatingTitle`             | `floating_title`       | `Block`            |\n| `unorderedList`             | `ulist`                | `List`             |\n| `orderedList`               | `olist`                | `List`             |\n| `descriptionList`           | `dlist`                | `List`             |\n| `calloutList`               | `colist`               | `List`             |\n| `listItem`                  | `list_item`            | `ListItem`         |\n| `table`                     | `table`                | `Table`            |\n| `tableCell`                 | `table_cell`           | `Table::Cell`      |\n| `strong`                    | `quoted` (type=strong) | `Inline`           |\n| `emphasis`                  | `quoted` (type=emphasis)| `Inline`          |\n| `monospaced`                | `quoted` (type=monospaced)| `Inline`        |\n| `superscript`               | `quoted` (type=superscript)| `Inline`       |\n| `subscript`                 | `quoted` (type=subscript)| `Inline`         |\n| `mark`                      | `quoted` (type=mark)   | `Inline`           |\n| `doubleQuoted`              | `quoted` (type=double) | `Inline`           |\n| `singleQuoted`              | `quoted` (type=single) | `Inline`           |\n| `link`                      | `anchor` (type=link)   | `Inline`           |\n| `crossReference`            | `anchor` (type=xref)   | `Inline`           |\n| `anchor`                    | `anchor` (type=ref)    | `Inline`           |\n| `bibliographyReference`     | `anchor` (type=bibref) | `Inline`           |\n| `inlineImage`               | `image` (type=image)   | `Inline`           |\n| `icon`                      | `image` (type=icon)    | `Inline`           |\n| `footnote`                  | `footnote`             | `Inline`           |\n| `lineBreak`                 | `break`                | `Inline`           |\n| `inlineCallout`             | `callout`              | `Inline`           |\n| `keyboard`                  | `kbd`                  | `Inline`           |\n| `button`                    | `button`               | `Inline`           |\n| `menu`                      | `menu`                 | `Inline`           |\n| `indexTerm`                  | `indexterm`             | `Inline`           |\n| `inlinePass`                | `quoted` (type=monospaced, subs=none) | `Inline` |\n\n---\n\n## References\n\n- **[unist][]** — Universal Syntax Tree format\n- **[mdast][]** — Markdown Abstract Syntax Tree format\n- **[hast][]** — Hypertext Abstract Syntax Tree format\n- **[AsciiDoc][]** — AsciiDoc Language Documentation\n- **[Asciidoctor][]** — AsciiDoc processor\n\n[unist]: https://github.com/syntax-tree/unist\n[unist-utilities]: https://github.com/syntax-tree/unist#list-of-utilities\n[mdast]: https://github.com/syntax-tree/mdast\n[hast]: https://github.com/syntax-tree/hast\n[webidl]: https://webidl.spec.whatwg.org\n[asciidoc]: https://docs.asciidoctor.org/asciidoc/latest/\n[asciidoc-attributes]: https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes/\n[asciidoctor]: https://docs.asciidoctor.org/asciidoctor/latest/\n[dfn-node]: #node\n[dfn-parent]: #parent\n[dfn-literal]: #literal\n\n## License\n\n[MIT](license) &copy; Pablo Angelani <pablo.angelani@gmail.com>\n","readmeFilename":"README.md","_rev":"1-39f487cf770e2f9965747780d55b7d35"}