Glamour Style Guide
The JSON files in this directory are generated from the default styles. To re-generate them, run:
go generate ..
Block Elements
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 |
document
The document element represents the markdown's body.
Example
Style:
"document": {
"indent": 2,
"background_color": "234",
"block_prefix": "\n",
"block_suffix": "\n"
}
paragraph
The paragraph element represents a paragraph in the document.
Example
Style:
"paragraph": {
"margin": 4,
"color": "15",
"background_color": "235"
}
heading
The heading element represents a heading.
h1 - h6
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.
Example
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:

block_quote
The block_quote element represents a quote.
Example
Style:
"block_quote": {
"color": "200",
"indent": 1,
"indent_token": "=> "
}
Output:

list
The list element represents a list in the document.
| Attribute | Value | Description |
|---|---|---|
| level_indent | number | Specifies the indentation for nested lists |
Example
Style:
"list": {
"color": "15",
"background_color": "52",
"level_indent": 4
}
code_block
The code_block element represents a block of code.
| Attribute | Value | Description |
|---|---|---|
| theme | string | Defines the Chroma theme used for syntax highlighting |
Example
Style:
"code_block": {
"color": "200",
"theme": "solarized-dark"
}
Output:

table
The table element represents a table of data.
Example
Markdown:
| Label | Value |
| ------ | ----- |
| First | foo |
| Second | bar |
Style:
"table": {
"margin": 4
}
Output:

Inline Elements
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 |
text
The text element represents a block of text.
Example
Style:
"text": {
"bold": true,
"color": "15",
"background_color": "57"
}
item
The item element represents an item in a list.
Example
Markdown:
- First Item
- Nested List Item
- Second Item
Style:
"item": {
"block_prefix": "• "
}
Output:

enumeration
The enumeration element represents an item in an ordered list.
Example
Markdown:
1. First Item
2. Second Item
Style:
"enumeration": {
"block_prefix": ". "
}
Output:

task
The task element represents a task item.
| Attribute | Value | Description |
|---|---|---|
| ticked | string | Prefix for finished tasks |
| unticked | string | Prefix for unfinished tasks |
Example
Markdown:
- [x] Finished Task
- [ ] Outstanding Task
Style:
"task": {
"ticked": "✓ ",
"unticked": "✗ "
}
Output:

link
The link element represents a link.
Example
Markdown:
This is a [link](https://charm.sh).
Style:
"link": {
"color": "123",
"underline": true,
"block_prefix": "(",
"block_suffix": ")"
}
Output:

link_text
The link_text element represents the text associated with a link.
Example
Style:
"link_text": {
"color": "123",
"bold": true
}
image
The image element represents an image.
Example
Markdown:
.
Style:
"image": {
"color": "123",
"block_prefix": "[Image: ",
"block_suffix": "]"
}
Output:

image_text
The image_text element represents the text associated with an image.
Example
Style:
"image_text": {
"color": "8"
}
code
The code element represents an inline code segment.
Example
Style:
"code": {
"color": "200"
}
Output:

emph
The emph element represents an emphasized text.
Example
Markdown:
This text is *emphasized*.
Style:
"emph": {
"italic": true
}
Output:

strong
The strong element represents important text.
Example
Markdown:
This text is **strong**.
Style:
"strong": {
"bold": true
}
Output:

strikethrough
The strikethrough element represents strikethrough text.
Example
Markdown:
~~Scratch this~~.
Style:
"strikethrough": {
"crossed_out": true
}
Output:

hr
The hr element represents a horizontal rule.
Example
Markdown:
---
Style:
"hr": {
"block_prefix": "---"
}