h1("Header 1")
h2("Header 2")
h3("Header 3")
h4("Header 4")
h5("Header 5")
h6("Header 6")
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
p {
-"This text will appear in a paragraph."
-"This sentence will be grouped with the preceding one."
}
p("""
A second paragraph.
Line breaks won't
affect the rendered markdown
and indent is trimmed
""")
This text will appear in a paragraph.
This sentence will be grouped with the preceding one.
A second paragraph.
Line breaks won't
affect the rendered markdown
and indent is trimmed
This text will appear in a paragraph. This sentence will be grouped with the preceding one.
A second paragraph. Line breaks won't affect the rendered markdown and indent is trimmed
p {
b("Bold")
+", "
i("Italics")
+" and "
b { i("Bold italics") }
+"."
}
p {
/* same as above, using `+` syntax sugar */
b("Bold") + ", " + i("Italics") + " and " + b { i("Bold italics") } + "."
}
p {
+"For inline text styling you can *still* use **raw markdown**"
}
**Bold**, *Italics* and ***Bold italics***.
**Bold**, *Italics* and ***Bold italics***.
For inline text styling you can *still* use **raw markdown**
Bold, Italics and Bold italics.
Bold, Italics and Bold italics.
For inline text styling you can still use raw markdown
+"I'm about to quote something"
quote {
+"Here's the quote with a nested quote inside"
quote {
+"A final inner quote"
}
}
I'm about to quote something
> Here's the quote with a nested quote inside
>
> > A final inner quote
I'm about to quote something
Here's the quote with a nested quote inside
A final inner quote
+"Dot points"
ul {
li("Dot point 1")
li("Another point")
li("A third point")
}
+"Numbered"
ol {
li("Item 1")
li {
p {
+"You can nest any markdown inside list items"
}
p {
+"Multiple paragraphs"
}
quote {
+"Or even a quote"
}
}
li {
ol {
li("This includes")
li("Lists themselves")
}
}
}
+"Task lists"
cl {
li(true, "Create a markdown DSL")
li(true, "Add task list support")
li(false, "Solve all of the world's problems")
}
Dot points
* Dot point 1
* Another point
* A third point
Numbered
1. Item 1
2. You can nest any markdown inside list items
Multiple paragraphs
> Or even a quote
3. 1. This includes
2. Lists themselves
Task lists
- [x] Create a markdown DSL
- [x] Add task list support
- [ ] Solve all of the world's problems
Dot points
- Dot point 1
- Another point
- A third point
Numbered
Item 1
You can nest any markdown inside list items
Multiple paragraphs
Or even a quote
- This includes
- Lists themselves
Task lists
- Create a markdown DSL
- Add task list support
- Solve all of the world's problems
c("Inline code block")
code("multiline\ncode\nblocks")
code("kotlin", """
fun main() {
println("Syntax hinted code!")
}
""".trimIndent())
val block = code {
/* this code block is captured */
fun square(x: Int) = x*x
square(7)
}
+"Code executed with result: "
c("${block.invoke()}")
`Inline code block`
```
multiline
code
blocks
```
```kotlin
fun main() {
println("Syntax hinted code!")
}
```
```kotlin
/* this code block is captured */
fun square(x: Int) = x*x
square(7)
```
Code executed with result: `49`
Inline code block
multiline code blocks
fun main() { println("Syntax hinted code!") }/* this code block is captured */ fun square(x: Int) = x*x square(7)Code executed with result:
49
t("Separated")
hr()
t("By")
hr()
t("Hrs")
Separated
---
By
---
Hrs
Separated
By
Hrs
p {
+"Visit "
a("https://example.com", "Example Website")
}
p {
a("https://example.com") {
+"Links "
i("can contain")
+" "
b("inner formatting")
}
}
p {
a(cite("https://example.com"), "Reference style link")
}
p {
+"Reference "
a(cite("https://example.com"), "links")
+" are de-duplicated"
}
p {
a(cite("https://example.com", "Example"), "References")
+" can be titled"
}
Visit [Example Website](https://example.com)
[Links *can contain* **inner formatting**](https://example.com)
[Reference style link][1]
Reference [links][1] are de-duplicated
[References][2] can be titled
[1]: https://example.com
[2]: https://example.com "Example"
Visit Example Website
Links can contain inner formatting
Reference links are de-duplicated
References can be titled
p {
+"In inline contexts images will "
img("markout.png")
+" be shown inline "
img("markout.png", "Alt text", "Title text is displayed on hover")
}
+"At top level images will be treated as blocks and vertically separated"
img("markout.png")
img("markout.png")
img("unknown.png", "Alt text is displayed when the image can't be displayed")
In inline contexts images will ![](markout.png) be shown inline ![Alt text](markout.png "Title text is displayed on hover")
At top level images will be treated as blocks and vertically separated
![](markout.png)
![](markout.png)
![Alt text is displayed when the image can't be displayed](unknown.png)
In inline contexts images will be shown inline
At top level images will be treated as blocks and vertically separated
table {
th {
td("Column 1")
td { i("Italic Column") }
}
tr {
td("1997")
td("Non-italic")
}
tr {
td("2023")
td { i("Italic") }
}
}
| Column 1 | *Italic Column* |
| -------- | --------------- |
| 1997 | Non-italic |
| 2023 | *Italic* |
Column 1 Italic Column 1997 Non-italic 2023 Italic
fun note() = footnote("""
At the moment there is no way to re-use footnotes
and the requirement for the note text to appear at
the site of the footnote call is less than ideal
""")
+"The syntax is a work in progress" + note() + " but footnotes are possible."
The syntax is a work in progress[^1] but footnotes are possible.
[^1]: At the moment there is no way to re-use footnotes
and the requirement for the note text to appear at
the site of the footnote call is less than ideal
The syntax is a work in progress1 but footnotes are possible.
Footnotes
-
At the moment there is no way to re-use footnotes and the requirement for the note text to appear at the site of the footnote call is less than ideal ↩