Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Latest commit

 

History

History
550 lines (307 loc) · 20.7 KB

mdast.md

File metadata and controls

550 lines (307 loc) · 20.7 KB

MDAST Schema

https://ns.adobe.com/helix/pipeline/mdast

The Markdown AST is 100% API compatible with the UnifiedJS MDAST data structure.

All MDAST Utilities are compatible and can be used for easy processing of MDAST trees.

Abstract Extensible Status Identifiable Custom Properties Additional Properties Access Restrictions Defined In
Can be instantiated No Stable No Forbidden Forbidden none mdast.schema.json

MDAST Type

object (MDAST)

MDAST Properties

Property Type Required Nullable Defined by
type Not specified Optional cannot be null MDAST
children array Optional cannot be null MDAST
position object Optional cannot be null MDAST
value string Optional cannot be null MDAST
payload object Optional cannot be null MDAST
depth integer Optional cannot be null MDAST
ordered boolean Optional cannot be null MDAST
start integer Optional can be null MDAST
spread boolean Optional can be null MDAST
checked boolean Optional can be null MDAST
align array Optional cannot be null MDAST
lang string Optional can be null MDAST
identifier string Optional cannot be null MDAST
label string Optional cannot be null MDAST
url string Optional cannot be null MDAST
meta object Optional can be null MDAST
title string Optional can be null MDAST
code string Optional cannot be null MDAST
intro string Optional can be null MDAST
image string Optional can be null MDAST
types array Optional cannot be null MDAST
alt string Optional can be null MDAST
referenceType Not specified Optional cannot be null MDAST
data object Optional cannot be null MDAST

type

The node type of the MDAST node

type

  • is optional

  • Type: unknown

  • cannot be null

  • defined in: MDAST

type Type

unknown

type Constraints

enum: the value of this property must be equal to one of the following values:

Value Explanation
"root" The root node, representing a document or section
"paragraph" A paragraph. Note: standalone `image` blocks are often wrapped in a `paragraph`
"text" Plain text
"heading" A heading with heading level
"thematicBreak" A section break
"blockquote" A blockquote
"list" An ordered or unordered list
"listItem"
"table" A table
"tableRow" A row in a table
"tableCell" A cell in a table
"html" Raw HTML embedded in Markdown. Disabled by default.
"code" A code block
"yaml" A metadata block. If the block is not at the top of the document, it will start a new section.
"definition" A definition that can be referenced
"footnoteDefinition" A footnote
"emphasis" emphasis (often in italics)
"strong" strong (often in bold type)
"delete" deleted content
"inlineCode" inline code
"break" A line break
"link" A hyperlink
"image" An image
"linkReference" A pointer to a link
"imageReference" A pointer to an image
"footnote" A footnote
"footnoteReference" A reference to a footnote
"embed" Content embedded from another page, identified by the `url` attribute.
"dataEmbed" Data embedded from another data source (API), identified by the `url` attribute.
"section" A section within the document. Sections serve as a high-level structure of a single markdown document and can have their own section-specific front matter metadata.
"icon" An SVG icon, identified by the syntax `:foo:`

children

children

  • is optional

  • Type: an array of merged types (Details)

  • cannot be null

  • defined in: MDAST

children Type

an array of merged types (Details)

position

Marks the position of an AST node in the original text flow

position

  • is optional

  • Type: object (Position)

  • cannot be null

  • defined in: MDAST

position Type

object (Position)

value

The string value of the node, if it is a terminal node.

value

  • is optional

  • Type: string

  • cannot be null

  • defined in: MDAST

value Type

string

payload

The payload of a frontmatter/yaml block

payload

  • is optional

  • Type: object (Details)

  • cannot be null

  • defined in: MDAST

payload Type

object (Details)

depth

The heading level

depth

  • is optional

  • Type: integer

  • cannot be null

  • defined in: MDAST

depth Type

integer

depth Constraints

maximum: the value of this number must smaller than or equal to: 6

minimum: the value of this number must greater than or equal to: 1

ordered

Is the list ordered

ordered

  • is optional

  • Type: boolean

  • cannot be null

  • defined in: MDAST

ordered Type

boolean

start

Starting item of the list

start

  • is optional

  • Type: integer

  • can be null

  • defined in: MDAST

start Type

integer

spread

A spread field can be present. It represents that any of its items is separated by a blank line from its siblings or contains two or more children (when true), or not (when false or not present).

spread

  • is optional

  • Type: boolean

  • can be null

  • defined in: MDAST

spread Type

boolean

checked

A checked field can be present. It represents whether the item is done (when true), not done (when false), or indeterminate or not applicable (when null or not present).

checked

  • is optional

  • Type: boolean

  • can be null

  • defined in: MDAST

checked Type

boolean

align

For tables, an align field can be present. If present, it must be a list of alignTypes. It represents how cells in columns are aligned.

align

  • is optional

  • Type: string[]

  • cannot be null

  • defined in: MDAST

align Type

string[]

lang

For code, a lang field can be present. It represents the language of computer code being marked up.

lang

  • is optional

  • Type: string

  • can be null

  • defined in: MDAST

lang Type

string

identifier

For associations, an identifier field must be present. It can match an identifier field on another node.

identifier

  • is optional

  • Type: string

  • cannot be null

  • defined in: MDAST

identifier Type

string

label

For associations, a label field can be present. It represents the original value of the normalised identifier field.

label

  • is optional

  • Type: string

  • cannot be null

  • defined in: MDAST

label Type

string

url

For resources, an url field must be present. It represents a URL to the referenced resource.

url

  • is optional

  • Type: string

  • cannot be null

  • defined in: MDAST

url Type

string

url Constraints

URI reference: the string must be a URI reference, according to RFC 3986

meta

meta

  • is optional

  • Type: object (Details)

  • can be null

  • defined in: MDAST

meta Type

object (Details)

title

Extracted title of the document

title

  • is optional

  • Type: string

  • can be null

  • defined in: MDAST

title Type

string

code

Icon code

code

  • is optional

  • Type: string

  • cannot be null

  • defined in: MDAST

code Type

string

code Constraints

pattern: the string must match the following regular expression:

:#*[a-zA-Z_-]+[a-zA-Z0-9]*:

try pattern

intro

Extracted first paragraph of the document

intro

  • is optional

  • Type: string

  • can be null

  • defined in: MDAST

intro Type

string

image

Path (can be relative) to the first image in the document

image

  • is optional

  • Type: string

  • can be null

  • defined in: MDAST

image Type

string

image Constraints

URI reference: the string must be a URI reference, according to RFC 3986

types

The inferred class names for the section

types

  • is optional

  • Type: string[]

  • cannot be null

  • defined in: MDAST

types Type

string[]

alt

An alt field should be present. It represents equivalent content for environments that cannot represent the node as intended.

alt

  • is optional

  • Type: string

  • can be null

  • defined in: MDAST

alt Type

string

referenceType

Represents the explicitness of a reference.

referenceType

  • is optional

  • Type: unknown

  • cannot be null

  • defined in: MDAST

referenceType Type

unknown

referenceType Constraints

enum: the value of this property must be equal to one of the following values:

Value Explanation
"shortcut" the reference is implicit, its identifier inferred from its content
"collapsed" the reference is explicit, its identifier inferred from its content
"full" the reference is explicit, its identifier explicitly set

data

data is guaranteed to never be specified by unist or specifications implementing unist. Free data space.

data

  • is optional

  • Type: object (Details)

  • cannot be null

  • defined in: MDAST

data Type

object (Details)