Skip to main content

You're viewing the documentation for an older version of Docs. Consider upgrading your project to version 3.x

Markdown

Dok comes with two commonmark extensions pre-installed:

These are initiated inside of AppServiceProvider.php and their config is managed at config/statamic/markdown.php.

To use the Table of Contents extension, simply write [TOC] on the line you want it to be displayed at.

#Hints Extension

You can use hints (also known as callouts, admonitions, tips etc) in your markdown. Dok comes packaged with a custom version of this commonmark extension.

markdown
:::important
This is an important hint
:::

You have the following hint type available:

  • note
  • tip
  • important
  • caution
  • warning

This is a note hint

This is a tip hint

This is an important hint

This is a caution hint

This is a warning hint

You can also use standard markdown inside of a hint:

Stars are giant balls of super-hot gas that make their own light and heat. Our Sun is a star! Stars come in different colors, which tell us about their temperature. Red stars are the coolest, while blue stars are the hottest. Our Sun is a yellow-white star, sitting right in the middle of the temperature range. Stars also come in many sizes - some are smaller than Earth, while others are so huge they could fit our entire Solar System inside them!

Fenced Code:

javascript
// Example of a simple function in JavaScript
function calculateSum(a, b) {
    let sum = a + b;
    console.log(`The sum of ${a} and ${b} is ${sum}`);
    return sum;
}

// Call the function
calculateSum(5, 10);

Tables:

Syntax Description
Header Title
Paragraph Text

Theme