termd

A terminal markdown viewer that renders tables and diagrams correctly.

go install github.com/ekalinin/termd/cmd/termd@latest
GitHub

Latest release

termd theme
termd --width 40 --theme dark themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme light themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme dracula themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme nord themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme onedark themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme monokai themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme solarized-dark themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme solarized-light themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme gruvbox themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme gruvbox-light themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme catppuccin-mocha themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 --theme catppuccin-latte themes.md
# Color themes

A theme colors headings, links, inline
code, list markers, alerts, tables and
code.

• Select a theme with --theme or
  TERMD_THEME
• Light themes: solarized-light,
  gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the
│ terminal.

│ Warning
│ A named theme does not adapt to the
│ background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme dark themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme light themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme dracula themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme nord themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme onedark themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme monokai themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme solarized-dark themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme solarized-light themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme gruvbox themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme gruvbox-light themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme catppuccin-mocha themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 60 --theme catppuccin-latte themes.md
# Color themes

A theme colors headings, links, inline code, list markers,
alerts, tables and code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light,
  catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme dark themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme light themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme dracula themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme nord themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme onedark themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme monokai themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme solarized-dark themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme solarized-light themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme gruvbox themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme gruvbox-light themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme catppuccin-mocha themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 80 --theme catppuccin-latte themes.md
# Color themes

A theme colors headings, links, inline code, list markers, alerts, tables and
code.

• Select a theme with --theme or TERMD_THEME
• Light themes: solarized-light, gruvbox-light, catppuccin-latte

│ Note
│ Paragraph text keeps the color of the terminal.

│ Warning
│ A named theme does not adapt to the background.

Theme         │ Background
──────────────┼───────────
dark, light   │ any
dracula, nord │ dark

// main prints a greeting.
func main() {
	fmt.Println("hello", 42)
}
termd --width 40 table.md
## Tables

Widths are measured by grapheme
clusters, so emoji and CJK text keep
columns aligned. Only the long column
wraps, and a link shows its text instead
of the URL.

Sample │ Cols │ Notes          │ Spec
───────┼──────┼────────────────┼────────
日本語 │    6 │ CJK characters │ UAX #11
       │      │ take two       │
       │      │ columns each   │
  👩‍💻   │    2 │ A ZWJ sequence │ UAX #29
       │      │ is one         │
       │      │ grapheme       │
       │      │ cluster        │
  ⚠️   │    2 │ Terminals      │ UTS #51
       │      │ disagree on    │
       │      │ emoji with a   │
       │      │ variation      │
       │      │ selector;      │
       │      │ termd follows  │
       │      │ Unicode and    │
       │      │ counts 2       │
termd --width 60 table.md
## Tables

Widths are measured by grapheme clusters, so emoji and CJK
text keep columns aligned. Only the long column wraps, and a
link shows its text instead of the URL.

Sample │ Cols │ Notes                              │ Spec
───────┼──────┼────────────────────────────────────┼────────
日本語 │    6 │ CJK characters take two columns    │ UAX #11
       │      │ each                               │
  👩‍💻   │    2 │ A ZWJ sequence is one grapheme     │ UAX #29
       │      │ cluster                            │
  ⚠️   │    2 │ Terminals disagree on emoji with a │ UTS #51
       │      │ variation selector; termd follows  │
       │      │ Unicode and counts 2               │
termd --width 80 table.md
## Tables

Widths are measured by grapheme clusters, so emoji and CJK text keep columns
aligned. Only the long column wraps, and a link shows its text instead of the
URL.

Sample │ Cols │ Notes                                                  │ Spec
───────┼──────┼────────────────────────────────────────────────────────┼────────
日本語 │    6 │ CJK characters take two columns each                   │ UAX #11
  👩‍💻   │    2 │ A ZWJ sequence is one grapheme cluster                 │ UAX #29
  ⚠️   │    2 │ Terminals disagree on emoji with a variation selector; │ UTS #51
       │      │ termd follows Unicode and counts 2                     │
termd --width 40 sequence.md
## Sequence diagrams

Mermaid diagrams are drawn as text.

┌────────┐     ┌─────┐
│ Client │     │ API │
└────┬───┘     └──┬──┘
     │            │
     │ 1. GET /doc│
     ├───────────►│
     │            ┃
     │            ┃ ┌─────────────┐
     │            ┃ │ check token │
     │            ┃ └─────────────┘
   ┌─[alt token is valid]──┐
   │ │            ┃        │
   │ │ 2. 200 OK  ┃        │
   │ │◄┈┈┈┈┈┈┈┈┈┈┈┨        │
   ├┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┤
   │ │            ┃        │
   │ │ 3. 401 Unauthorized │
   │ │◄┈┈┈┈┈┈┈┈┈┈┈┨        │
   │ │            ┃        │
   └───────────────────────┘
     │            │
termd --width 60 sequence.md
## Sequence diagrams

Mermaid diagrams are drawn as text.

┌────────┐     ┌─────┐
│ Client │     │ API │
└────┬───┘     └──┬──┘
     │            │
     │ 1. GET /doc│
     ├───────────►│
     │            ┃
     │            ┃ ┌─────────────┐
     │            ┃ │ check token │
     │            ┃ └─────────────┘
   ┌─[alt token is valid]──┐
   │ │            ┃        │
   │ │ 2. 200 OK  ┃        │
   │ │◄┈┈┈┈┈┈┈┈┈┈┈┨        │
   ├┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┤
   │ │            ┃        │
   │ │ 3. 401 Unauthorized │
   │ │◄┈┈┈┈┈┈┈┈┈┈┈┨        │
   │ │            ┃        │
   └───────────────────────┘
     │            │
termd --width 80 sequence.md
## Sequence diagrams

Mermaid diagrams are drawn as text.

┌────────┐     ┌─────┐
│ Client │     │ API │
└────┬───┘     └──┬──┘
     │            │
     │ 1. GET /doc│
     ├───────────►│
     │            ┃
     │            ┃ ┌─────────────┐
     │            ┃ │ check token │
     │            ┃ └─────────────┘
   ┌─[alt token is valid]──┐
   │ │            ┃        │
   │ │ 2. 200 OK  ┃        │
   │ │◄┈┈┈┈┈┈┈┈┈┈┈┨        │
   ├┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┤
   │ │            ┃        │
   │ │ 3. 401 Unauthorized │
   │ │◄┈┈┈┈┈┈┈┈┈┈┈┨        │
   │ │            ┃        │
   └───────────────────────┘
     │            │
termd --width 40 flowchart.md
## Flowcharts

A left-to-right flowchart that does not
fit the width is laid out top-to-bottom.

┌──────────┐
│          │
│ Markdown │
│          │
└─────┬────┘
      │
      │
      │
      │
      ▼
┌──────────┐
│          │
│   AST    │
│          │
└─────┬────┘
      │
      │
      │
      │
      ▼
┌──────────┐
│          │
│ Mermaid? │
│          │
└─────┬────┘
      │
      ├──────────────┐
      │              │
     yes            no
      │              │
      ▼              ▼
┌──────────┐     ┌──────┐
│          │     │      │
│ Diagram  │     │ Text │
│          │     │      │
└─────┬────┘     └───┬──┘
      │              │
      │              │
      │              │
      │              │
      ▼              │
┌──────────┐         │
│          │         │
│ Terminal │◄────────┘
│          │
└──────────┘
termd --width 60 flowchart.md
## Flowcharts

A left-to-right flowchart that does not fit the width is
laid out top-to-bottom.

┌──────────┐
│          │
│ Markdown │
│          │
└─────┬────┘
      │
      │
      │
      │
      ▼
┌──────────┐
│          │
│   AST    │
│          │
└─────┬────┘
      │
      │
      │
      │
      ▼
┌──────────┐
│          │
│ Mermaid? │
│          │
└─────┬────┘
      │
      ├──────────────┐
      │              │
     yes            no
      │              │
      ▼              ▼
┌──────────┐     ┌──────┐
│          │     │      │
│ Diagram  │     │ Text │
│          │     │      │
└─────┬────┘     └───┬──┘
      │              │
      │              │
      │              │
      │              │
      ▼              │
┌──────────┐         │
│          │         │
│ Terminal │◄────────┘
│          │
└──────────┘
termd --width 80 flowchart.md
## Flowcharts

A left-to-right flowchart that does not fit the width is laid out top-to-bottom.

┌──────────┐     ┌─────┐     ┌──────────┐      ┌─────────┐     ┌──────────┐
│          │     │     │     │          │      │         │     │          │
│ Markdown ├────►│ AST ├────►│ Mermaid? ├─yes─►│ Diagram ├────►│ Terminal │
│          │     │     │     │          │      │         │     │          │
└──────────┘     └─────┘     └─────┬────┘      └─────────┘     └──────────┘
                                   │                                 ▲
                                   │                                 │
                                   │                                 │
                                   │                                 │
                                   │                                 │
                                   │           ┌─────────┐           │
                                   │           │         │           │
                                   └──────no──►│   Text  ├───────────┘
                                               │         │
                                               └─────────┘
termd --width 40 unsupported.md
## Unsupported diagrams

A diagram that cannot be drawn is shown
as source in a labelled frame.

┌─ mermaid - stateDiagram-v2 - not supported ┐
│ stateDiagram-v2                            │
│     [*] --> Idle                           │
│     Idle --> Loading: open                 │
│     Loading --> Idle: done                 │
└────────────────────────────────────────────┘
termd --width 60 unsupported.md
## Unsupported diagrams

A diagram that cannot be drawn is shown as source in a
labelled frame.

┌─ mermaid - stateDiagram-v2 - not supported ┐
│ stateDiagram-v2                            │
│     [*] --> Idle                           │
│     Idle --> Loading: open                 │
│     Loading --> Idle: done                 │
└────────────────────────────────────────────┘
termd --width 80 unsupported.md
## Unsupported diagrams

A diagram that cannot be drawn is shown as source in a labelled frame.

┌─ mermaid - stateDiagram-v2 - not supported ┐
│ stateDiagram-v2                            │
│     [*] --> Idle                           │
│     Idle --> Loading: open                 │
│     Loading --> Idle: done                 │
└────────────────────────────────────────────┘
termd --width 40 --theme dark code.md
## Code

Fenced code blocks are highlighted with
a dark or light theme.

package main

import "fmt"

// main prints a greeting.
func main() {
	fmt.Println("Hello, 世界", 42)
}
termd --width 40 --theme light code.md
## Code

Fenced code blocks are highlighted with
a dark or light theme.

package main

import "fmt"

// main prints a greeting.
func main() {
	fmt.Println("Hello, 世界", 42)
}
termd --width 60 --theme dark code.md
## Code

Fenced code blocks are highlighted with a dark or light
theme.

package main

import "fmt"

// main prints a greeting.
func main() {
	fmt.Println("Hello, 世界", 42)
}
termd --width 60 --theme light code.md
## Code

Fenced code blocks are highlighted with a dark or light
theme.

package main

import "fmt"

// main prints a greeting.
func main() {
	fmt.Println("Hello, 世界", 42)
}
termd --width 80 --theme dark code.md
## Code

Fenced code blocks are highlighted with a dark or light theme.

package main

import "fmt"

// main prints a greeting.
func main() {
	fmt.Println("Hello, 世界", 42)
}
termd --width 80 --theme light code.md
## Code

Fenced code blocks are highlighted with a dark or light theme.

package main

import "fmt"

// main prints a greeting.
func main() {
	fmt.Println("Hello, 世界", 42)
}