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.
:::important
This is an important hint
:::
You have the following hint type available:
note
tip
important
caution
warning
Note
This is a note hint
Tip
This is a tip hint
Important
This is an important hint
Caution
This is a caution hint
Warning
This is a warning hint
You can also use standard markdown inside of a hint:
Important
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:
// 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 |