### InlineCode markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces an inlineCode node. The markdown '`foo()`' demonstrates inline code syntax. ```markdown `foo()` ``` -------------------------------- ### Definition markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces a definition node. The markdown '[Alpha]: https://example.com' is used. ```markdown [Alpha]: https://example.com ``` -------------------------------- ### Strong node example AST Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Example AST for markdown `**alpha** __bravo__` showing two Strong nodes with text children. ```js { type: 'paragraph', children: [ { type: 'strong', children: [{type: 'text', value: 'alpha'}] }, {type: 'text', value: ' '}, { type: 'strong', children: [{type: 'text', value: 'bravo'}] } ] } ``` -------------------------------- ### Markdown Example of Yaml Frontmatter Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-frontmatter.md Shows a markdown example with YAML frontmatter delimited by `---`. This is the input that produces the `Yaml` node. ```markdown --- foo: bar --- ``` -------------------------------- ### Heading markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces a heading node. The markdown '# Alpha' demonstrates a level-1 heading. ```markdown # Alpha ``` -------------------------------- ### Install @types/mdast with npm Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/index.md Install the TypeScript type definitions for mdast from npm. The specification's Types section recommends this command for TypeScript users. ```sh npm install @types/mdast ``` -------------------------------- ### Html markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces an html node. The markdown '
' demonstrates a raw HTML fragment. ```markdown
``` -------------------------------- ### Link markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces a link node. The markdown '[alpha](https://example.com "bravo")' demonstrates a link with URL and title. ```markdown [alpha](https://example.com "bravo") ``` -------------------------------- ### Emphasis markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces an emphasis node. The markdown '*alpha* _bravo_' demonstrates both asterisk and underscore emphasis syntax. ```markdown *alpha* _bravo_ ``` -------------------------------- ### Image markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces an image node. The markdown '![alpha](https://example.com/favicon.ico "bravo")' demonstrates an image with alt text, URL, and title. ```markdown ![alpha](https://example.com/favicon.ico "bravo") ``` -------------------------------- ### Code markdown example (no language) Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces a code node without a language. The markdown ' foo()' is used. ```markdown foo() ``` -------------------------------- ### ThematicBreak node example Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Example of a ThematicBreak node as produced from the markdown '***'. ```js {type: 'thematicBreak'} ``` -------------------------------- ### Break markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces a break node. The markdown 'foo··\nbar' is used. ```markdown foo·· bar ``` -------------------------------- ### Paragraph node example Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Example of a Paragraph node as produced from the markdown 'Alpha bravo charlie.'. ```js { type: 'paragraph', children: [{type: 'text', value: 'Alpha bravo charlie.'}] } ``` -------------------------------- ### Code example: fenced code with language and meta Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Shows the tree produced by fenced code with language 'js' and meta 'highlight-line="2"'. ```js { type: 'code', lang: 'js', meta: 'highlight-line="2"', value: 'foo()\nbar()\nbaz()' } ``` -------------------------------- ### List markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Markdown source for an ordered list with one item. ```markdown 1. foo ``` -------------------------------- ### Definition node example Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Example JavaScript object representing a Definition node parsed from the markdown `[Alpha]: https://example.com`. Shows the normalized identifier and label. ```js { type: 'definition', identifier: 'alpha', label: 'Alpha', url: 'https://example.com', title: null } ``` -------------------------------- ### Heading node example Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Example JavaScript object representing a Heading node parsed from the markdown `# Alpha`. Shows the depth and text child. ```js { type: 'heading', depth: 1, children: [{type: 'text', value: 'Alpha'}] } ``` -------------------------------- ### ImageReference markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces an imageReference node. The markdown '![alpha][bravo]' demonstrates a full reference to an image definition. ```markdown ![alpha][bravo] ``` -------------------------------- ### List node example: markdown `1. foo` yields AST (JavaScript) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Shows the JavaScript object representation of a `List` node produced from the markdown `1. foo`. The `ordered` field is `true`, `start` is `1`, and `spread` is `false`. The `children` array contains a single `ListItem` with a paragraph containing the text node with value `'foo'`. ```javascript { type: 'list', ordered: true, start: 1, spread: false, children: [{ type: 'listItem', spread: false, children: [{ type: 'paragraph', children: [{type: 'text', value: 'foo'}] }] }] } ``` -------------------------------- ### Code markdown example (with language and meta) Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces a code node with a language and meta. The markdown uses a fenced code block with 'js highlight-line="2"'. ```markdown ```js highlight-line="2" foo() bar() baz() ``` ``` -------------------------------- ### Blockquote markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Example markdown that produces a blockquote node. The markdown '> Alpha bravo charlie.' is used. ```markdown > Alpha bravo charlie. ``` -------------------------------- ### LinkReference markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Markdown source for a link reference using the label 'Bravo'. ```markdown [alpha][Bravo] ``` -------------------------------- ### ListItem markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Markdown source for a list item with the text 'bar'. ```markdown * bar ``` -------------------------------- ### Strong markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Markdown source with two strong emphasis spans: 'alpha' and 'bravo'. ```markdown **alpha** __bravo__ ``` -------------------------------- ### Yaml Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-frontmatter.md Documentation for the Yaml node interface, including its fields, content model, and usage examples. ```APIDOC ## Yaml ### Description Represents a collection of metadata for the document in the YAML data serialisation language. It is usable where frontmatter content is expected and has no content model; its content is represented entirely by its `value` field. ### Interface ```idl interface Yaml <: Literal { type: 'yaml' } ``` ### Fields - **type** (`'yaml'`) - Required - Node discriminator. - **value** (`string`) - Required (from `Literal`) - The raw YAML body between the `---` delimiters. ### Content Model `Yaml` is the sole member of two content-model types: - `FrontmatterContent` - `type FrontmatterContent = Yaml` - Out-of-band information about the document. - `FlowContentFrontmatter` - `type FlowContentFrontmatter = FrontmatterContent | FlowContent` - Flow content extended with frontmatter. Normative placement constraint: if frontmatter is present, it must be limited to **one** node in the tree, and can only exist as a *head* (first child of the document root). ### Example Given the following markdown: ```markdown --- foo: bar --- ``` yields: ```js {type: 'yaml', value: 'foo: bar'} ``` The same output expressed as a TypeScript object literal: ```ts import type {Yaml} from 'mdast' // @types/mdast const metadata: Yaml = { type: 'yaml', value: 'foo: bar' } ``` ``` -------------------------------- ### Example parent node (JavaScript object) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/abstract-nodes.md Shows a parent node as produced by a compliant parser, with type 'blockquote' and nested children. ```js { type: 'blockquote', children: [{ type: 'paragraph', children: [{type: 'text', value: 'Alpha bravo charlie.'}] }] } ``` -------------------------------- ### Link example: markdown [alpha](https://example.com "bravo") yields node Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Shows the JavaScript object representation of the Link node for the markdown `[alpha](https://example.com "bravo")`. ```js { type: 'link', url: 'https://example.com', title: 'bravo', children: [{type: 'text', value: 'alpha'}] } ``` -------------------------------- ### Code example: indented code (no language) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Shows the tree produced by the markdown ` foo()` (indented code without language). ```js { type: 'code', lang: null, meta: null, value: 'foo()' } ``` -------------------------------- ### Break node interface and example tree Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md The Break node has no fields beyond type. The example shows the tree for markdown 'foo \nbar' (two spaces then newline), producing a paragraph with text, break, and text children. ```idl interface Break <: Node { type: 'break' } ``` ```js { type: 'paragraph', children: [ {type: 'text', value: 'foo'}, {type: 'break'}, {type: 'text', value: 'bar'} ] } ``` -------------------------------- ### FootnoteReference example (JavaScript) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Shows the JavaScript object representation of a FootnoteReference node for the markdown `[^alpha]`. ```js { type: 'footnoteReference', identifier: 'alpha', label: 'alpha' } ``` -------------------------------- ### YAML frontmatter example and resulting AST (markdown + js) Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Shows a YAML frontmatter block and the resulting mdast JavaScript object. The markdown block contains 'foo: bar' and the resulting AST is a Yaml node with value 'foo: bar'. ```markdown --- foo: bar --- ``` ```js {type: 'yaml', value: 'foo: bar'} ``` -------------------------------- ### Emphasis node interface and example tree Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md The Emphasis node has a children field of PhrasingContent. The example shows the tree for markdown '*alpha* _bravo_', producing two emphasis nodes separated by a space text node. ```idl interface Emphasis <: Parent { type: 'emphasis' children: [PhrasingContent] } ``` ```js { type: 'paragraph', children: [ { type: 'emphasis', children: [{type: 'text', value: 'alpha'}] }, {type: 'text', value: ' '}, { type: 'emphasis', children: [{type: 'text', value: 'bravo'}] } ] } ``` -------------------------------- ### FootnoteDefinition example (JavaScript) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Shows the JavaScript object representation of a FootnoteDefinition node for the markdown `[^alpha]: bravo and charlie.`. ```js { type: 'footnoteDefinition', identifier: 'alpha', label: 'alpha', children: [{ type: 'paragraph', children: [{type: 'text', value: 'bravo and charlie.'}] }] } ``` -------------------------------- ### Delete example: markdown `~~alpha~~` yields tree Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Shows the resulting mdast tree for the markdown `~~alpha~~`. The Delete node contains a single text child with value 'alpha'. ```js { type: 'delete', children: [{type: 'text', value: 'alpha'}] } ``` -------------------------------- ### Html node example from markdown
Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Shows the JavaScript object representation of an Html node for the markdown input `
`. The value field contains the raw HTML fragment. ```js {type: 'html', value: '
'} ``` -------------------------------- ### Paragraph markdown example Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Markdown source for a paragraph with the text 'Alpha bravo charlie.' ```markdown Alpha bravo charlie. ``` -------------------------------- ### LinkReference example: markdown [alpha][Bravo] yields node Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Shows the JavaScript object representation of the LinkReference node for the markdown `[alpha][Bravo]`. ```js { type: 'linkReference', identifier: 'bravo', label: 'Bravo', referenceType: 'full', children: [{type: 'text', value: 'alpha'}] } ``` -------------------------------- ### Example literal node (JavaScript object) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/abstract-nodes.md Shows a literal node as produced by a compliant parser, with type 'text' and a string value. ```js {type: 'text', value: 'Alpha bravo charlie.'} ``` -------------------------------- ### InlineCode example: markdown `foo()` yields node Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Shows the JavaScript object representation of the InlineCode node for the markdown `` `foo()` ``. ```js {type: 'inlineCode', value: 'foo()'} ``` -------------------------------- ### Table markdown example and resulting AST Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Shows a markdown table and the corresponding mdast Table node it yields. The align field is ['left', 'center'] based on the column alignment markers. ```markdown | foo | bar | | :-- | :-: | | baz | qux | ``` ```js { type: 'table', align: ['left', 'center'], children: [ { type: 'tableRow', children: [ { type: 'tableCell', children: [{type: 'text', value: 'foo'}] }, { type: 'tableCell', children: [{type: 'text', value: 'bar'}] } ] }, { type: 'tableRow', children: [ { type: 'tableCell', children: [{type: 'text', value: 'baz'}] }, { type: 'tableCell', children: [{type: 'text', value: 'qux'}] } ] } ] } ``` -------------------------------- ### TypeScript Object Literal for Yaml Node Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-frontmatter.md TypeScript example showing how to create a `Yaml` node with the `Yaml` type from `mdast`. The `value` field holds the raw YAML body. ```ts import type {Yaml} from 'mdast' // @types/mdast const metadata: Yaml = { type: 'yaml', value: 'foo: bar' } ``` -------------------------------- ### Delete markdown example and JavaScript AST output Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Shows the markdown for a delete (strikethrough) and the resulting JavaScript AST node. The markdown '~~alpha~~' yields a delete node with a text child 'alpha'. ```markdown ~~alpha~~ ``` ```js { type: 'delete', children: [{type: 'text', value: 'alpha'}] } ``` -------------------------------- ### Markdown example of a thematic break Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Shows the markdown syntax for a thematic break, which is three asterisks on a line. This is the input that yields the ThematicBreak node. ```markdown *** ``` -------------------------------- ### Image node example from markdown image with title Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Shows the JavaScript object representation of an Image node for the markdown input `![alpha](https://example.com/favicon.ico "bravo")`. The url, title, and alt fields are populated from the markdown. ```js { type: 'image', url: 'https://example.com/favicon.ico', title: 'bravo', alt: 'alpha' } ``` -------------------------------- ### FootnoteReference markdown example and JavaScript AST output Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Shows the markdown for a footnote reference and the resulting JavaScript AST node. The markdown '[^alpha]' yields a footnoteReference node with identifier and label 'alpha'. ```markdown [^alpha] ``` ```js { type: 'footnoteReference', identifier: 'alpha', label: 'alpha' } ``` -------------------------------- ### ImageReference node example from markdown reference image Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Shows the JavaScript object representation of an ImageReference node for the markdown input `![alpha][bravo]`. The identifier, label, referenceType, and alt fields are populated from the markdown. ```js { type: 'imageReference', identifier: 'bravo', label: 'bravo', referenceType: 'full', alt: 'alpha' } ``` -------------------------------- ### Break yields JavaScript AST Source: https://github.com/syntax-tree/mdast/blob/main/readme.md The JavaScript object representation of the break example. It shows the resulting AST with a break node between two text nodes. ```js { type: 'paragraph', children: [ {type: 'text', value: 'foo'}, {type: 'break'}, {type: 'text', value: 'bar'} ] } ``` -------------------------------- ### ListItem node example: markdown `* bar` yields AST (JavaScript) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Shows the JavaScript object representation of a `ListItem` node produced from the markdown `* bar`. The `spread` field is `false`, and the `children` array contains a single paragraph with a text node with value `'bar'`. ```javascript { type: 'listItem', spread: false, children: [{ type: 'paragraph', children: [{type: 'text', value: 'bar'}] }] } ``` -------------------------------- ### JavaScript Object Representation of Yaml Node Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-frontmatter.md Represents the `Yaml` node as a plain JavaScript object with `type: 'yaml'` and `value: 'foo: bar'`. This is the output of parsing the markdown example. ```js {type: 'yaml', value: 'foo: bar'} ``` -------------------------------- ### List node interface definition (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the `List` node as a Parent with a `type` of `'list'`. Its fields include optional `ordered`, `start`, and `spread`, and a required `children` array of `ListContent` nodes. The `type` field is the node discriminator. ```idl interface List <: Parent { type: 'list' ordered: boolean? start: number? spread: boolean? children: [ListContent] } ``` -------------------------------- ### package.json: Full contents Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/configuration.md The complete package.json for the mdast repository. It is private (never published to npm) and includes dev dependencies for remark-cli and remark-preset-wooorm, with scripts for formatting and testing. The remarkConfig uses the remark-preset-wooorm plugin. ```json { "author": "Titus Wormer (wooorm.com)", "bugs": "https://github.com/syntax-tree/mdast/issues", "contributors": [ "Titus Wormer (wooorm.com)", "Eugene Sharygin " ], "description": "markdown abstract syntax tree", "devDependencies": { "remark-cli": "^12.0.0", "remark-preset-wooorm": "^10.0.0" }, "keywords": [], "license": "MIT", "private": true, "remarkConfig": { "plugins": [ "remark-preset-wooorm" ] }, "repository": "syntax-tree/mdast", "scripts": { "format": "remark --frail --output --quiet -- .", "test": "npm run format" }, "version": "0.0.0" } ``` -------------------------------- ### Resource mixin (url and title fields) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Defines the Resource mixin, which contributes a required url field and an optional title field. The title represents advisory information such as a tooltip. ```idl interface mixin Resource { url: string title: string? } ``` -------------------------------- ### Image interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the Image node as a subtype of Node with type 'image'. Includes the Resource and Alternative mixins, providing url, title, and alt fields. ```idl interface Image <: Node { type: 'image' } Image includes Resource Image includes Alternative ``` -------------------------------- ### ListContentGfm type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md GFM list content: task-list-capable items. ```idl type ListContentGfm = ListItemGfm ``` -------------------------------- ### Content type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Runs of text that form definitions and paragraphs. Used by FlowContent. ```idl type Content = Definition | Paragraph ``` -------------------------------- ### Reference mixin (referenceType field, includes Association) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Defines the Reference mixin, which includes Association and adds a required referenceType field. The referenceType must be one of 'shortcut', 'collapsed', or 'full'. ```idl interface mixin Reference { referenceType: string } Reference includes Association ``` -------------------------------- ### FlowContentFrontmatter type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Flow content extended with frontmatter. ```idl type FlowContentFrontmatter = FrontmatterContent | FlowContent ``` -------------------------------- ### Parent interface definition (Web IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/abstract-nodes.md Defines the abstract Parent interface in Web IDL, inheriting from UnistParent and adding a required array field 'children' of type MdastContent. ```idl interface Parent <: UnistParent { children: [MdastContent] } ``` -------------------------------- ### Alternative mixin (alt field) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Defines the Alternative mixin, which contributes an optional alt field to nodes like Image and ImageReference. The alt field represents fallback content for environments that cannot render the node as intended. ```idl interface mixin Alternative { alt: string? } ``` -------------------------------- ### PhrasingContentGfm type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md GFM phrasing content: base phrasing content plus footnotes and strikethrough. ```idl type PhrasingContentGfm = FootnoteReference | Delete | PhrasingContent ``` -------------------------------- ### Association mixin (identifier and label fields) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Defines the Association mixin, which contributes an identifier field (required, normalized source value) and an optional label field (parsed value). The identifier must be normalized by collapsing whitespace, trimming, and case-folding. ```idl interface mixin Association { identifier: string label: string? } ``` -------------------------------- ### Heading node interface Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the Heading node type in the mdast syntax tree. It extends Parent and includes a depth field (1-6) and children of phrasing content. ```idl interface Heading <: Parent { type: 'heading' depth: 1 <= number <= 6 children: [PhrasingContent] } ``` -------------------------------- ### Strong node interface Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the Strong node interface in the mdast syntax tree. It extends Parent and requires a 'strong' type and children of PhrasingContent. ```idl interface Strong <: Parent { type: 'strong' children: [PhrasingContent] } ``` -------------------------------- ### Link interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the Link node as a Parent with type 'link' and children of PhrasingContent. Includes the Resource mixin for url and title fields. ```idl interface Link <: Parent { type: 'link' children: [PhrasingContent] } Link includes Resource ``` -------------------------------- ### ListItemGfm interface definition (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Defines the ListItemGfm node as a refinement of ListItem, adding an optional checked field for task-list state. The checked field can be true, false, or null/absent for indeterminate. ```idl interface ListItemGfm <: ListItem { checked: boolean? } ``` -------------------------------- ### Text node interface Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the Text node interface in the mdast syntax tree. It extends Literal and has a 'text' type. ```idl interface Text <: Literal { type: 'text' } ``` -------------------------------- ### ImageReference interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the ImageReference node as a subtype of Node with type 'imageReference'. Includes the Reference and Alternative mixins, providing identifier, label, referenceType, and alt fields. ```idl interface ImageReference <: Node { type: 'imageReference' } ImageReference includes Reference ImageReference includes Alternative ``` -------------------------------- ### Root interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the Root node interface in the mdast specification. It extends Parent and requires a type field set to 'root'. Inherits children from Parent. ```idl interface Root <: Parent { type: 'root' } ``` -------------------------------- ### FlowContentGfm type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md GFM flow content: base flow content plus footnotes and tables. ```idl type FlowContentGfm = FootnoteDefinition | Table | FlowContent ``` -------------------------------- ### Html interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the Html node as a subtype of Literal with type 'html'. Represents a fragment of raw HTML usable where flow or phrasing content is expected. ```idl interface Html <: Literal { type: 'html' } ``` -------------------------------- ### Definition node interface Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the Definition node type in the mdast syntax tree. It includes the Association and Resource mixins, providing fields for identifier, label, url, and title. ```idl interface Definition <: Node { type: 'definition' } Definition includes Association Definition includes Resource ``` -------------------------------- ### FrontmatterContent type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Out-of-band information about the document. Constraints: if frontmatter is present, it must be limited to one node in the tree, and can only exist as a head. ```idl type FrontmatterContent = Yaml ``` -------------------------------- ### Break interface (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Defines the Break node interface, which has a type of 'break'. It extends Node. ```idl interface Break <: Node { type: 'break' } ``` -------------------------------- ### ListContent type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md The items in a list. Used by List.children; part of MdastContent. ```idl type ListContent = ListItem ``` -------------------------------- ### Emphasis interface definition (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/readme.md Defines the 'Emphasis' node interface in IDL, which extends Parent and has a type field of 'emphasis' and children of PhrasingContent. Use this to understand the structure of emphasis nodes in the mdast syntax tree. ```idl interface Emphasis <: Parent { type: 'emphasis' children: [PhrasingContent] } ``` -------------------------------- ### Code interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the Code node interface with type 'code', optional lang and meta fields, and inherits value from Literal. ```idl interface Code <: Literal { type: 'code' lang: string? meta: string? } ``` -------------------------------- ### Emphasis AST output (JavaScript) Source: https://github.com/syntax-tree/mdast/blob/main/readme.md The JavaScript object representation of the emphasis node for the markdown '*alpha* _bravo_'. It shows a paragraph containing two emphasis nodes and a text node for the space. ```js { type: 'paragraph', children: [ { type: 'emphasis', children: [{type: 'text', value: 'alpha'}] }, {type: 'text', value: ' '}, { type: 'emphasis', children: [{type: 'text', value: 'bravo'}] } ] } ``` -------------------------------- ### Paragraph interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the Paragraph node interface in the mdast specification. It extends Parent and requires a type field set to 'paragraph' and a children array of PhrasingContent. ```idl interface Paragraph <: Parent { type: 'paragraph' children: [PhrasingContent] } ``` -------------------------------- ### MdastContent type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md The union of all node categories. Used by Parent.children as the abstract container contract for every parent node. ```idl type MdastContent = FlowContent | ListContent | PhrasingContent ``` -------------------------------- ### ListItem node interface definition (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the `ListItem` node as a Parent with a `type` of `'listItem'`. It has an optional `spread` field and a required `children` array of `FlowContent`. The `type` field is the node discriminator. ```idl interface ListItem <: Parent { type: 'listItem' spread: boolean? children: [FlowContent] } ``` -------------------------------- ### InlineCode interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the InlineCode node as a Literal with type 'inlineCode'. Used to represent a fragment of computer code in phrasing content. ```idl interface InlineCode <: Literal { type: 'inlineCode' } ``` -------------------------------- ### FootnoteReference interface (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Defines the FootnoteReference node type, which extends Node and includes the Association mixin. It represents a marker through association, usable where phrasing content is expected. ```idl interface FootnoteReference <: Node { type: 'footnoteReference' } FootnoteReference includes Association ``` -------------------------------- ### Table node interface Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Defines the Table node interface in the mdast syntax tree. It has a type field set to 'table', an optional align field that is a list of alignType values, and a children field containing TableContent nodes. ```idl interface Table <: Parent { type: 'table' align: [alignType]? children: [TableContent] } ``` -------------------------------- ### Literal interface definition (Web IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/abstract-nodes.md Defines the abstract Literal interface in Web IDL, inheriting from UnistLiteral and adding a required string field 'value'. This is the normative definition for implementations. ```idl interface Literal <: UnistLiteral { value: string } ``` -------------------------------- ### Yaml Interface Definition (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-frontmatter.md Defines the `Yaml` interface as a subtype of `Literal` with a `type` field set to `'yaml'`. This is the normative interface for the node. ```idl interface Yaml <: Literal { type: 'yaml' } ``` -------------------------------- ### LinkReference interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-phrasing.md Defines the LinkReference node as a Parent with type 'linkReference' and children of PhrasingContent. Includes the Reference mixin for identifier, label, and referenceType fields. ```idl interface LinkReference <: Parent { type: 'linkReference' children: [PhrasingContent] } LinkReference includes Reference ``` -------------------------------- ### ThematicBreak interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the ThematicBreak node interface in the mdast specification. It extends Node and requires a type field set to 'thematicBreak'. It has no content model. ```idl interface ThematicBreak <: Node { type: 'thematicBreak' } ``` -------------------------------- ### referenceType enum Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Defines the explicitness of a reference. Values: 'shortcut' (implicit identifier inferred from content), 'collapsed' (explicit identifier inferred from content), 'full' (explicit identifier explicitly set). Used by the Reference mixin's referenceType field, and therefore by LinkReference and ImageReference. ```idl enum referenceType { 'shortcut' | 'collapsed' | 'full' } ``` -------------------------------- ### Delete interface definition (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Defines the Delete node as a Parent with type 'delete' and children of PhrasingContent. Represents strikethrough content that is no longer accurate or relevant. ```idl interface Delete <: Parent { type: 'delete' children: [PhrasingContent] } ``` -------------------------------- ### Blockquote interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-flow.md Defines the Blockquote node interface with type 'blockquote' and children of FlowContent. Inherits from Parent. ```idl interface Blockquote <: Parent { type: 'blockquote' children: [FlowContent] } ``` -------------------------------- ### TableRow interface definition Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Defines the TableRow node type in the mdast syntax tree. It represents a row of cells in a table and is usable where table content is expected. Its content model is row content, and if the node is a head, it represents the column labels for its parent Table. ```idl interface TableRow <: Parent { type: 'tableRow' children: [RowContent] } ``` -------------------------------- ### PhrasingContent type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md The text in a document and its markup. Used by Emphasis.children, Heading.children, Link.children, LinkReference.children, Paragraph.children, Strong.children, Delete.children, TableCell.children; part of MdastContent. ```idl type PhrasingContent = Break | Emphasis | Html | Image | ImageReference | InlineCode | Link | LinkReference | Strong | Text ``` -------------------------------- ### alignType enum Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md Represents how phrasing content is aligned per CSS Text. Values: 'left', 'right', 'center' correspond to text-align CSS property values; null means aligned as defined by the host environment. Used by Table's align field ([alignType]?). ```idl enum alignType { 'left' | 'right' | 'center' | null } ``` -------------------------------- ### FootnoteDefinition interface (IDL) Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Defines the FootnoteDefinition node type, which extends Parent and includes the Association mixin. It represents content relating to the document that is outside its flow, usable where flow content is expected. ```idl interface FootnoteDefinition <: Parent { type: 'footnoteDefinition' children: [FlowContent] } FootnoteDefinition includes Association ``` -------------------------------- ### FlowContent type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md The sections of a document. Used by Blockquote.children, ListItem.children, FootnoteDefinition.children; part of MdastContent. ```idl type FlowContent = Blockquote | Code | Heading | Html | List | ThematicBreak | Content ``` -------------------------------- ### TableContent type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md The rows in a table. Used by Table.children. ```idl type TableContent = TableRow ``` -------------------------------- ### TableCell node interface Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/api-reference/nodes-gfm.md Defines the TableCell node interface in the mdast syntax tree. It has a type field set to 'tableCell' and a children field containing PhrasingContent nodes, excluding Break nodes. ```idl interface TableCell <: Parent { type: 'tableCell' children: [PhrasingContent] } ``` -------------------------------- ### RowContent type alias Source: https://github.com/syntax-tree/mdast/blob/main/_autodocs/types.md The cells in a row. Used by TableRow.children. ```idl type RowContent = TableCell ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.