The JSON files in this directory are generated from the default styles. To re-generate them, run:
go generate ..
Block elements contain other elements and are rendered around them. All block elements support the following style settings:
Attribute | Value | Description |
---|---|---|
block_prefix | string | Printed before the block's first element (in parent's style) |
block_suffix | string | Printed after the block's last element (in parent's style) |
prefix | string | Printed before the block's first element |
suffix | string | Printed after the block's last element |
indent | number | Specifies the indentation of the block |
indent_token | string | Specifies the indentation format |
margin | number | Specifies the margin around the block |
color | color | Defines the default text color for the block |
background_color | color | Defines the default background color for the block |
Elements inside a block inherit the block's following style settings:
Attribute | Value | Description |
---|---|---|
color | color | Defines the default text color for the block |
background_color | color | Defines the default background color for the block |
bold | bool | Increases text intensity |
faint | bool | Decreases text intensity |
italic | bool | Prints the text in italic |
crossed_out | bool | Enables strikethrough as text decoration |
underline | bool | Enables underline as text decoration |
overlined | bool | Enables overline as text decoration |
blink | bool | Enables blinking text |
conceal | bool | Conceals / hides the text |
inverse | bool | Swaps fore- & background colors |
The document
element represents the markdown's body.
Style:
"document": {
"indent": 2,
"background_color": "234",
"block_prefix": "\n",
"block_suffix": "\n"
}
The paragraph
element represents a paragraph in the document.
Style:
"paragraph": {
"margin": 4,
"color": "15",
"background_color": "235"
}
The heading
element represents a heading.
The h1
to h6
elements represent headings. h1
defines the most important
heading, h6
the least important heading. Undefined attributes are inherited
from the heading
element.
Markdown:
# h1
## h2
### h3
Style:
"heading": {
"color": "15",
"background_color": "57"
},
"h1": {
"prefix": "=> ",
"suffix": " <=",
"margin": 2,
"bold": true,
"background_color": "69"
},
"h2": {
"prefix": "## ",
"margin": 4
},
"h3": {
"prefix": "### ",
"margin": 6
}
Output:
The block_quote
element represents a quote.
Style:
"block_quote": {
"color": "200",
"indent": 1,
"indent_token": "=> "
}
Output:
The list
element represents a list in the document.
Attribute | Value | Description |
---|---|---|
level_indent | number | Specifies the indentation for nested lists |
Style:
"list": {
"color": "15",
"background_color": "52",
"level_indent": 4
}
The code_block
element represents a block of code.
Attribute | Value | Description |
---|---|---|
theme | string | Defines the Chroma theme used for syntax highlighting |
Style:
"code_block": {
"color": "200",
"theme": "solarized-dark"
}
Output:
The table
element represents a table of data.
Markdown:
| Label | Value |
| ------ | ----- |
| First | foo |
| Second | bar |
Style:
"table": {
"margin": 4
}
Output:
All inline elements support the following style settings:
Attribute | Value | Description |
---|---|---|
block_prefix | string | Printed before the element (in parent's style) |
block_suffix | string | Printed after the element (in parent's style) |
prefix | string | Printed before the element |
suffix | string | Printed after the element |
color | color | Defines the default text color for the document |
background_color | color | Defines the default background color for the document |
bold | bool | Increases text intensity |
faint | bool | Decreases text intensity |
italic | bool | Prints the text in italic |
crossed_out | bool | Enables strikethrough as text decoration |
underline | bool | Enables underline as text decoration |
overlined | bool | Enables overline as text decoration |
blink | bool | Enables blinking text |
conceal | bool | Conceals / hides the text |
inverse | bool | Swaps fore- & background colors |
The text
element represents a block of text.
Style:
"text": {
"bold": true,
"color": "15",
"background_color": "57"
}
The item
element represents an item in a list.
Markdown:
- First Item
- Nested List Item
- Second Item
Style:
"item": {
"block_prefix": "β’ "
}
Output:
The enumeration
element represents an item in an ordered list.
Markdown:
1. First Item
2. Second Item
Style:
"enumeration": {
"block_prefix": ". "
}
Output:
The task
element represents a task item.
Attribute | Value | Description |
---|---|---|
ticked | string | Prefix for finished tasks |
unticked | string | Prefix for unfinished tasks |
Markdown:
- [x] Finished Task
- [ ] Outstanding Task
Style:
"task": {
"ticked": "β ",
"unticked": "β "
}
Output:
The link
element represents a link.
Markdown:
This is a [link](https://charm.sh).
Style:
"link": {
"color": "123",
"underline": true,
"block_prefix": "(",
"block_suffix": ")"
}
Output:
The link_text
element represents the text associated with a link.
Style:
"link_text": {
"color": "123",
"bold": true
}
The image
element represents an image.
Markdown:
![Image](https://charm.sh/logo.png).
Style:
"image": {
"color": "123",
"block_prefix": "[Image: ",
"block_suffix": "]"
}
Output:
The image_text
element represents the text associated with an image.
Style:
"image_text": {
"color": "8"
}
The code
element represents an inline code segment.
Style:
"code": {
"color": "200"
}
Output:
The emph
element represents an emphasized text.
Markdown:
This text is *emphasized*.
Style:
"emph": {
"italic": true
}
Output:
The strong
element represents important text.
Markdown:
This text is **strong**.
Style:
"strong": {
"bold": true
}
Output:
The strikethrough
element represents strikethrough text.
Markdown:
~~Scratch this~~.
Style:
"strikethrough": {
"crossed_out": true
}
Output:
The hr
element represents a horizontal rule.
Markdown:
---
Style:
"hr": {
"block_prefix": "---"
}