Skip to main content Svelte Highlight v7.21.1

Markdoc language preview

1. A basic document

frontmatter, a comment tag, and a callout tag
horizon-dark
---
title: Getting Started
---

# Welcome

{% comment %} internal note, not rendered {% /comment %}

{% callout type="warning" %}
Set the $name variable before calling {% if(equals($name, "")) %}validate(){% /if %}.
{% /callout %}

{% partial file="footer.md" /%}
atom-one-dark
---
title: Getting Started
---

# Welcome

{% comment %} internal note, not rendered {% /comment %}

{% callout type="warning" %}
Set the $name variable before calling {% if(equals($name, "")) %}validate(){% /if %}.
{% /callout %}

{% partial file="footer.md" /%}
github-dark
---
title: Getting Started
---

# Welcome

{% comment %} internal note, not rendered {% /comment %}

{% callout type="warning" %}
Set the $name variable before calling {% if(equals($name, "")) %}validate(){% /if %}.
{% /callout %}

{% partial file="footer.md" /%}
dracula
---
title: Getting Started
---

# Welcome

{% comment %} internal note, not rendered {% /comment %}

{% callout type="warning" %}
Set the $name variable before calling {% if(equals($name, "")) %}validate(){% /if %}.
{% /callout %}

{% partial file="footer.md" /%}
nord
---
title: Getting Started
---

# Welcome

{% comment %} internal note, not rendered {% /comment %}

{% callout type="warning" %}
Set the $name variable before calling {% if(equals($name, "")) %}validate(){% /if %}.
{% /callout %}

{% partial file="footer.md" /%}
github
---
title: Getting Started
---

# Welcome

{% comment %} internal note, not rendered {% /comment %}

{% callout type="warning" %}
Set the $name variable before calling {% if(equals($name, "")) %}validate(){% /if %}.
{% /callout %}

{% partial file="footer.md" /%}

2. Functions and variables

and(), or(), not(), default() over Markdoc variables
horizon-dark
{% if(and(equals($status, "active"), not($archived))) %}
This item is active and not archived.
{% /if %}

{% $user.name %} joined on {% default($joinDate, "unknown") %}.
atom-one-dark
{% if(and(equals($status, "active"), not($archived))) %}
This item is active and not archived.
{% /if %}

{% $user.name %} joined on {% default($joinDate, "unknown") %}.
github-dark
{% if(and(equals($status, "active"), not($archived))) %}
This item is active and not archived.
{% /if %}

{% $user.name %} joined on {% default($joinDate, "unknown") %}.
dracula
{% if(and(equals($status, "active"), not($archived))) %}
This item is active and not archived.
{% /if %}

{% $user.name %} joined on {% default($joinDate, "unknown") %}.
nord
{% if(and(equals($status, "active"), not($archived))) %}
This item is active and not archived.
{% /if %}

{% $user.name %} joined on {% default($joinDate, "unknown") %}.
github
{% if(and(equals($status, "active"), not($archived))) %}
This item is active and not archived.
{% /if %}

{% $user.name %} joined on {% default($joinDate, "unknown") %}.

3. Table and shorthand attributes

the {% table %} tag with #id and .class shorthands
horizon-dark
{% table %}
* Name
* Score
---
* Alice
* 92
* Bob
* 88
{% /table %}

{% callout #important .highlight %}
This section needs review.
{% /callout %}
atom-one-dark
{% table %}
* Name
* Score
---
* Alice
* 92
* Bob
* 88
{% /table %}

{% callout #important .highlight %}
This section needs review.
{% /callout %}
github-dark
{% table %}
* Name
* Score
---
* Alice
* 92
* Bob
* 88
{% /table %}

{% callout #important .highlight %}
This section needs review.
{% /callout %}
dracula
{% table %}
* Name
* Score
---
* Alice
* 92
* Bob
* 88
{% /table %}

{% callout #important .highlight %}
This section needs review.
{% /callout %}
nord
{% table %}
* Name
* Score
---
* Alice
* 92
* Bob
* 88
{% /table %}

{% callout #important .highlight %}
This section needs review.
{% /callout %}
github
{% table %}
* Name
* Score
---
* Alice
* 92
* Bob
* 88
{% /table %}

{% callout #important .highlight %}
This section needs review.
{% /callout %}