Back to gallery

Markdown

Typography

The content styles of the app's markdown component: headings, paragraphs, lists, task lists, quotes, rules and a table whose cells convert a literal <br> to a line break.

Heading one

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph with strong, emphasis, strikethrough, ~single tildes~ that stay literal, inline code, and a link.

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. One
  2. Two
  3. Three
  • Done task
  • Open task

A quoted paragraph.

A second paragraph in the quote.


NameCountNotes
Alpha1first
second line
Beta22plain
Gamma333plain

Code blocks and copy button

Fenced code with the registered languages, the copy button (click it, the icon turns into a check for 1400ms and clicks are ignored meanwhile), and the block without the button.

export const add = (a: number, b: number): number => a + b; // sum
{ "name": "example", "count": 3, "ok": true }
# list files
ls -la "$HOME" && echo done
@@ -1,2 +1,2 @@
-old line
+new line
plain text without a language

Parts

Line numbers

1def greet(name):
2    return f'hello {name}'
3
4print(greet('world'))

Copy button: normal, disabled, loading, with tooltip

TextLink: underlined by default, underline on hover only, primary color, no destination (a span with role button) and http(s) destinations that open in a new tab. In markdown, the URL transform removes unsafe protocols and allows tel:, sms: and data:image/.

Links: secure, relative, mail, phone, text, image data, and blocked.

Parsing and rendering options

Parser options of the Markdown component: GFM on or off, hard line breaks, raw html as text or skipped, element filters, container, leaf and text directives, reference definitions (which render the document whole), and block-by-block streaming.

GFM: table, task list, strikethrough, autolink

Strong text with struck and www.example.com

  • done
  • open
ab
12

Soft line breaks

first line second line third line

Raw html

Plain text before.

<div>raw html block</div>

A paragraph with inline <b>raw html</b> and a line<br>break.

Directives

Before.

Note (info):

Inside a container directive.

An inline new directive and ::marker leaf below.

marker: leaf label

Unregistered kept label disappears.

Reference definition: rendered whole

A reference link makes the document render as a single block.

A second paragraph.

Unstyled

Unstyled heading

A paragraph.

Streaming

Each paragraph shows how many times it rendered. A block stops rendering again once two more blocks follow it, so with incremental rendering on the early paragraphs stop counting while the last ones grow. With it off, every paragraph renders on every chunk.

Streaming

One short paragraph.

Two short paragraph.

Three short paragraph.

Four short paragraph.

Five short paragraph, still arriving word by word.

Six and last paragraph.

Chat prose

The app flavour of the chat prose: every size derives from one font size and spacing is a quarter of it. Text styles and tones, the table container with a scroller that becomes a labelled region when the table is wider than its column, task lists with the checkbox, and the fade-in of list items, rules, rows and quotes.

Heading one

Heading two

Heading three

Heading four

A paragraph with strong, emphasis, strikethrough and inline code. Another sentence in the same paragraph so it wraps onto a second line when the column is narrow.

A second paragraph follows directly.

  • Bullet item
    • Nested bullet
      • Third level
  • Another bullet
  1. First
  2. Second
  • Done task
  • Open task

A quote with a bar at the start edge.

TypeScript
const value = 1;
NameCountNotes
Alpha1first
Beta22second

中文段落一。

中文段落二。

Text style base with code and a link.

  • item

Text style large with code and a link.

  • item

Text style small with code and a link.

  • item

Text style inherit with code and a link.

  • item

Tone tertiary with code and a link.

Second paragraph.

Tone user-message with code and a link.

Second paragraph.

Tone inherit with code and a link.

Second paragraph.

Narrow column: the table scrolls inside a region

Column oneColumn twoColumn threeColumn fourColumn fiveColumn six
A long cell with a good deal of text so that the table is wider than its columnSecondThirdFourthFifthSixth
Another long cell with a good deal of text so that the table is wider than its columnSecondThirdFourthFifthSixth

Chat prose links and writing blocks

Links in prose go through the link component. Under the restricted policy a click asks before the link opens. Code fences without a language, or with text, md or markdown, render as writing blocks.

Policy allow

Policy restricted

A fence without a language:

Dear team, Here is the draft of the announcement.

A markdown fence:

# Draft - first point - second point

A code fence stays a code block:

TypeScript
export const one = 1;

none

Footnotes, plugins, streaming fade, links, chat code block, table actions

Parsing fixes, footnotes, the plugin props, the streaming text fade, prose links, the chat code block and the table copy and expand actions.

A table ends at a list item or a rule; an image keeps its formatted description

h
row
  • list item
h2
row2

bold alt and plain

Footnotes (default labels)

A claim with a note1 and a second note2, then the first again1.

  • A list item stays outside the notes.

Footnotes

  1. The first note, with strong text. ↩ ↩2

  2. The second note.

    A second paragraph of the second note. ↩

Footnotes with remarkRehypeOptions

A claim with a note1 and a second note2, then the first again1.

  • A list item stays outside the notes.

Notes

  1. The first note, with strong text. back back

  2. The second note.

    A second paragraph of the second note. back

rehypePlugins turns strong into mark

Text with strong words and a link.

Streaming 0 of 11

externalLinkAppearance decorated

externalLinkAppearance inline-mention

externalLinkAppearance underlined-text

Chat code block

Prose with code blocks:

TypeScript
export const add = (a: number, b: number): number => a + b; // a long line that does not fit the column of this card and needs the wrap button
Python
print("hello")
flowchart LR
  A[Start] --> B[End]
Plain text
no language
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><circle cx="20" cy="20" r="18"/></svg>

Word wrap forced, sticky header

Prose with code blocks:

TypeScript
export const add = (a: number, b: number): number => a + b; // a long line that does not fit the column of this card and needs the wrap button
Python
print("hello")
flowchart LR
  A[Start] --> B[End]
Plain text
no language
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><circle cx="20" cy="20" r="18"/></svg>

Table actions: hover for copy and expand

Column oneColumn twoColumn threeColumn fourColumn fiveColumn six
A long cell with a good deal of text so that the table is wider than its columnSecondThirdFourthFifthSixth
Another long cell with a good deal of text so that the table is wider than its columnSecondThirdFourthFifthSixth

Wide block in a 20rem column inside a wider container

Column oneColumn twoColumn threeColumn fourColumn fiveColumn six
A long cell with a good deal of text so that the table is wider than its columnSecondThirdFourthFifthSixth
Another long cell with a good deal of text so that the table is wider than its columnSecondThirdFourthFifthSixth

Tall table: expand it to see the header stay in view

NameCountNotes
Row 11note 1
Row 22note 2
Row 33note 3
Row 44note 4
Row 55note 5
Row 66note 6
Row 77note 7
Row 88note 8
Row 99note 9
Row 1010note 10
Row 1111note 11
Row 1212note 12
Row 1313note 13
Row 1414note 14
Row 1515note 15
Row 1616note 16
Row 1717note 17
Row 1818note 18
Row 1919note 19
Row 2020note 20
Row 2121note 21
Row 2222note 22
Row 2323note 23
Row 2424note 24

requirement:markdown-math

includeMath loads KaTeX on first use. Only $$ blocks and runs are math.

MarkdownProse

Inline math with two dollars: $$E = mc^2$$ and a single $dollar$ pair stays text.

$$ \int_0^1 x^2,dx = \frac{1}{3} $$

A parse error keeps the source: $$\frac{1}{$$

MarkdownProse, renderMath off

Inline math with two dollars: $$E = mc^2$$ and a single $dollar$ pair stays text.

$$ \int_0^1 x^2,dx = \frac{1}{3} $$

A parse error keeps the source: $$\frac{1}{$$

includeMath

Inline math with two dollars: $$E = mc^2$$ and a single $dollar$ pair stays text.

$$ \int_0^1 x^2,dx = \frac{1}{3} $$

A parse error keeps the source: $$\frac{1}{$$

includeMath off

Inline math with two dollars: $$E = mc^2$$ and a single $dollar$ pair stays text.

$$ \int_0^1 x^2,dx = \frac{1}{3} $$

A parse error keeps the source: $$\frac{1}{$$

requirement:markdown-code-editor

Click into an editor and press Mod-f for the find panel. The key bindings are the CodeMirror default, fold, completion, history, indent-with-Tab and find keymaps.

223 characters

requirement:markdown-prism-grammars

The 24 registered languages tokenized by Prism grammars (refractor).

bash

echo "hi" | grep -c h # count

c

int main(void) { return 0; }

clike

class A { int x = 1; }

css

a:hover { color: #fff; margin: 0 auto; }

diff

- old line
+ new line

docker

FROM node:20
RUN npm ci

go

func main() { fmt.Println("hi") }

java

public class A { void run() {} }

javascript

const f = (a) => a + 1; // add

json

{"a": [1, true, null]}

jsonc

{"a": 1}

jsx

const a = <div className="x">{y}</div>;

kotlin

fun main() { println("hi") }

markdown

# Title

- item with `code`

markup

<a href="/x">link</a>

php

<?php echo strlen($a); ?>

python

def f(x):
    return x ** 2

ruby

def f(x) = x.map { |y| y + 1 }

scss

$c: red; a { &:hover { color: $c; } }

sql

SELECT id FROM t WHERE n > 1;

toml

[a]
b = true

tsx

const A = ({ n }: { n: number }) => <b>{n}</b>;

typescript

type T = { a: string }; const t: T = { a: 'x' };

yaml

a:
  - b
  - c: 1

ANSI block

Terminal output: the normal and bright colors, background, reverse, palette and truecolor (which the stylesheet leaves unstyled), one decoration per run, carriage-return overwrites and backspaces.

red green yellow blue magenta cyan
bright black bright red bright green bright white
 white on red  reverse palette truecolor
bold dim italic underline strike hidden
progress 100%
typpe done

Markdown file preview

A markdown file with front matter shows a metadata card above the body. More than 8 entries hide behind Show more.

Metadata
title
Example document
tags
alphabetagamma
draft
false

Body heading

Body paragraph after the front matter.

Metadata
title
Example document
author
A. Person
version
1.0
tags
alphabeta
empty
""
language
en
license
MIT
status
draft

Body after a long front matter.

title: Example document tags: [alpha, beta, gamma] draft: false

Body heading

Body paragraph after the front matter.

Metadata
title
Card only
empty
""
tags
onetwo""

Right to left

Right to left text in both flavours: lists and quotes mirror, the quote bar sits at the start edge, code stays left to right.

عنوان تجريبي

فقرة قصيرة من النص العربي مع كود ورابط.

  • عنصر أول
  • عنصر ثان

اقتباس قصير.

عنوان تجريبي

فقرة قصيرة من النص العربي مع كود ورابط.

  • عنصر أول
  • عنصر ثان

اقتباس قصير.

Light and dark

Each panel sets its own theme scope, so the appearance control above does not change them. The two lower panels nest the opposite theme inside, and the nested parts follow the nearest scope.

Light theme

Heading one

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph with strong, emphasis, strikethrough, ~single tildes~ that stay literal, inline code, and a link.

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. One
  2. Two
  3. Three
  • Done task
  • Open task

A quoted paragraph.

A second paragraph in the quote.


NameCountNotes
Alpha1first
second line
Beta22plain
Gamma333plain
export const add = (a: number, b: number): number => a + b; // sum
{ "name": "example", "count": 3, "ok": true }
# list files
ls -la "$HOME" && echo done
@@ -1,2 +1,2 @@
-old line
+new line
plain text without a language

Heading one

Heading two

Heading three

Heading four

A paragraph with strong, emphasis, strikethrough and inline code. Another sentence in the same paragraph so it wraps onto a second line when the column is narrow.

A second paragraph follows directly.

  • Bullet item
    • Nested bullet
      • Third level
  • Another bullet
  1. First
  2. Second
  • Done task
  • Open task

A quote with a bar at the start edge.

TypeScript
const value = 1;
NameCountNotes
Alpha1first
Beta22second

中文段落一。

中文段落二。

red green yellow blue magenta cyan
bright black bright red bright green bright white
 white on red  reverse palette truecolor
bold dim italic underline strike hidden
progress 100%
typpe done
Metadata
title
Example document
tags
alphabetagamma
draft
false

Body heading

Body paragraph after the front matter.

Dark theme

Heading one

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph with strong, emphasis, strikethrough, ~single tildes~ that stay literal, inline code, and a link.

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. One
  2. Two
  3. Three
  • Done task
  • Open task

A quoted paragraph.

A second paragraph in the quote.


NameCountNotes
Alpha1first
second line
Beta22plain
Gamma333plain
export const add = (a: number, b: number): number => a + b; // sum
{ "name": "example", "count": 3, "ok": true }
# list files
ls -la "$HOME" && echo done
@@ -1,2 +1,2 @@
-old line
+new line
plain text without a language

Heading one

Heading two

Heading three

Heading four

A paragraph with strong, emphasis, strikethrough and inline code. Another sentence in the same paragraph so it wraps onto a second line when the column is narrow.

A second paragraph follows directly.

  • Bullet item
    • Nested bullet
      • Third level
  • Another bullet
  1. First
  2. Second
  • Done task
  • Open task

A quote with a bar at the start edge.

TypeScript
const value = 1;
NameCountNotes
Alpha1first
Beta22second

中文段落一。

中文段落二。

red green yellow blue magenta cyan
bright black bright red bright green bright white
 white on red  reverse palette truecolor
bold dim italic underline strike hidden
progress 100%
typpe done
Metadata
title
Example document
tags
alphabetagamma
draft
false

Body heading

Body paragraph after the front matter.

Dark theme, with a light panel inside

Heading one

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph with strong, emphasis, strikethrough, ~single tildes~ that stay literal, inline code, and a link.

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. One
  2. Two
  3. Three
  • Done task
  • Open task

A quoted paragraph.

A second paragraph in the quote.


NameCountNotes
Alpha1first
second line
Beta22plain
Gamma333plain
export const add = (a: number, b: number): number => a + b; // sum
{ "name": "example", "count": 3, "ok": true }
# list files
ls -la "$HOME" && echo done
@@ -1,2 +1,2 @@
-old line
+new line
plain text without a language

Heading one

Heading two

Heading three

Heading four

A paragraph with strong, emphasis, strikethrough and inline code. Another sentence in the same paragraph so it wraps onto a second line when the column is narrow.

A second paragraph follows directly.

  • Bullet item
    • Nested bullet
      • Third level
  • Another bullet
  1. First
  2. Second
  • Done task
  • Open task

A quote with a bar at the start edge.

TypeScript
const value = 1;
NameCountNotes
Alpha1first
Beta22second

中文段落一。

中文段落二。

red green yellow blue magenta cyan
bright black bright red bright green bright white
 white on red  reverse palette truecolor
bold dim italic underline strike hidden
progress 100%
typpe done
Metadata
title
Example document
tags
alphabetagamma
draft
false

Body heading

Body paragraph after the front matter.

Light theme, nested in dark

Heading one

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph with strong, emphasis, strikethrough, ~single tildes~ that stay literal, inline code, and a link.

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. One
  2. Two
  3. Three
  • Done task
  • Open task

A quoted paragraph.

A second paragraph in the quote.


NameCountNotes
Alpha1first
second line
Beta22plain
Gamma333plain
export const add = (a: number, b: number): number => a + b; // sum
{ "name": "example", "count": 3, "ok": true }
# list files
ls -la "$HOME" && echo done
@@ -1,2 +1,2 @@
-old line
+new line
plain text without a language

Heading one

Heading two

Heading three

Heading four

A paragraph with strong, emphasis, strikethrough and inline code. Another sentence in the same paragraph so it wraps onto a second line when the column is narrow.

A second paragraph follows directly.

  • Bullet item
    • Nested bullet
      • Third level
  • Another bullet
  1. First
  2. Second
  • Done task
  • Open task

A quote with a bar at the start edge.

TypeScript
const value = 1;
NameCountNotes
Alpha1first
Beta22second

中文段落一。

中文段落二。

red green yellow blue magenta cyan
bright black bright red bright green bright white
 white on red  reverse palette truecolor
bold dim italic underline strike hidden
progress 100%
typpe done
Metadata
title
Example document
tags
alphabetagamma
draft
false

Body heading

Body paragraph after the front matter.

Light theme, with a dark panel inside

Heading one

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph with strong, emphasis, strikethrough, ~single tildes~ that stay literal, inline code, and a link.

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. One
  2. Two
  3. Three
  • Done task
  • Open task

A quoted paragraph.

A second paragraph in the quote.


NameCountNotes
Alpha1first
second line
Beta22plain
Gamma333plain
export const add = (a: number, b: number): number => a + b; // sum
{ "name": "example", "count": 3, "ok": true }
# list files
ls -la "$HOME" && echo done
@@ -1,2 +1,2 @@
-old line
+new line
plain text without a language

Heading one

Heading two

Heading three

Heading four

A paragraph with strong, emphasis, strikethrough and inline code. Another sentence in the same paragraph so it wraps onto a second line when the column is narrow.

A second paragraph follows directly.

  • Bullet item
    • Nested bullet
      • Third level
  • Another bullet
  1. First
  2. Second
  • Done task
  • Open task

A quote with a bar at the start edge.

TypeScript
const value = 1;
NameCountNotes
Alpha1first
Beta22second

中文段落一。

中文段落二。

red green yellow blue magenta cyan
bright black bright red bright green bright white
 white on red  reverse palette truecolor
bold dim italic underline strike hidden
progress 100%
typpe done
Metadata
title
Example document
tags
alphabetagamma
draft
false

Body heading

Body paragraph after the front matter.

Dark theme, nested in light

Heading one

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph with strong, emphasis, strikethrough, ~single tildes~ that stay literal, inline code, and a link.

  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. One
  2. Two
  3. Three
  • Done task
  • Open task

A quoted paragraph.

A second paragraph in the quote.


NameCountNotes
Alpha1first
second line
Beta22plain
Gamma333plain
export const add = (a: number, b: number): number => a + b; // sum
{ "name": "example", "count": 3, "ok": true }
# list files
ls -la "$HOME" && echo done
@@ -1,2 +1,2 @@
-old line
+new line
plain text without a language

Heading one

Heading two

Heading three

Heading four

A paragraph with strong, emphasis, strikethrough and inline code. Another sentence in the same paragraph so it wraps onto a second line when the column is narrow.

A second paragraph follows directly.

  • Bullet item
    • Nested bullet
      • Third level
  • Another bullet
  1. First
  2. Second
  • Done task
  • Open task

A quote with a bar at the start edge.

TypeScript
const value = 1;
NameCountNotes
Alpha1first
Beta22second

中文段落一。

中文段落二。

red green yellow blue magenta cyan
bright black bright red bright green bright white
 white on red  reverse palette truecolor
bold dim italic underline strike hidden
progress 100%
typpe done
Metadata
title
Example document
tags
alphabetagamma
draft
false

Body heading

Body paragraph after the front matter.