Variables

Variables are used to represent text and a subset of elements.

#Variable

A standard variable used to represent text with no additional processing required.

#Example

<title>Welcome</title>

#AST

{
  "type": "element",
  "name": "title",
  "attrs": {},
  "children": [
    {
      "type": "variable",
      "reference": [
        "variable_name"
      ]
    }
  ]
}

#Variable content

Welcome

#Markdown variable

A variable used to represent a block of markdown. This is generated from a node tree which only contains the following elements:

Additionally tags can only contain attributes that can be represented in markdown.

#Example

<h1>Hi <strong>there</strong></h1>

<p>Welcome back!</p>

#AST

{
  "type": "markdown-variable",
  "reference": [
  "variable_name"
  ]
}

#Variable content

# Hi **there**

Welcome back!

#Inline markdown variables

A variable used to represent the markdown inside of a markdown element. This is generated from a node tree which only contains the following elements:

#Example

<h1 class="heading">Hi <strong>there</strong></h1>

#AST

{
  "type": "element",
  "name": "h1",
  "attrs": {
    "class": {
      "type": "attribute",
      "name": "class",
      "value": "heading"
    }
  },
  "children": [
    {
      "type": "inline-markdown-variable",
      "reference": [
        "variable_name"
      ]
    }
  ]
}

#Variable content

Hi **there**