Writing
Callouts
A callout is a blockquote that says what kind of thing it is. Put
> [!type] on the first line and the quote becomes a
coloured box with an icon — the same syntax Obsidian uses, and the same
class names, so a vault written there looks like itself here.
You write
> [!note]
> Everything else in the quote is the body.
The type is case-insensitive: [!note],
[!Note] and [!NOTE] are the same callout. (GFM's
own alert syntax, which Clew also accepts, is stricter about this; Clew
treats them all alike.)
Titles
Anything after the type becomes the title, and it may contain markdown —
emphasis, code, even a [[wikilink]]. Without one, the
callout is headed by the type as you wrote it, with a
capital letter: [!CAUTION] is headed "Caution" and
[!tldr] "Tldr", though they look like the types they stand
for, a warning and an abstract (see the types). A
type's own name gives its own title — [!note] and
[!NOTE] are both "Note". (In 0.12.0 an untitled callout is
always headed by its type's title: [!CAUTION] reads
"Warning".)
You write
> [!tip] Titles can carry *emphasis* and [[links]]
> Body follows as usual.
Foldable callouts
Add - or + immediately after the type to make a
callout collapsible. Both fold; the sign only decides how it starts.
| You write | Behaviour |
|---|---|
> [!note] | Always open, not collapsible |
> [!note]- | Collapsible, starts collapsed |
> [!note]+ | Collapsible, starts expanded |
The mnemonic is slightly back-to-front: - does not mean "no
callout", it means "start minimised". Click the title to toggle.
<details>, not a script. So a
foldable callout survives a live re-render while you type, works in a
site exported from your vault with no
JavaScript at all, and prints expanded — which is what you want on
paper.
The types
Fifteen types, several answering to more than one name. Aliases are not
merely tolerated: they resolve to the same callout, so
[!tldr] and [!abstract] look the same; only an
untitled one's heading tells them apart.
| Type | Also called | For |
|---|---|---|
note | — | A remark worth setting apart |
abstract | summary, tldr | The short version |
info | — | Context the reader may not have |
todo | — | Something still to do |
tip | hint, important | Advice worth taking |
success | check, done | It worked |
question | help, faq | A question, or an answer to one |
warning | caution, attention | Mind this |
failure | fail, missing | It did not work |
danger | error | This will hurt |
bug | — | A known defect |
example | — | A worked case |
quote | cite | Someone else's words |
compatibility | — | Version or platform caveats |
suggestion | — | An idea worth trying (not in 0.12.0) |
Your own callout types
The fifteen are a starting set. Settings → Callouts
defines more — a [!remark], a [!definition], a
[!homework] — and changes the built-in ones. It has two
lists. Global types are kept in Clew's own
clew-settings.json and work in every vault on this machine;
This vault's are kept in
.clew/vault-settings.json and travel with the vault. Each
row is one type:
- Name
- What you write between
[!and]: a letter, then letters, digits,-or_. Case does not matter, as with the built-in types. - Title
- The heading a callout written with the type's name shows when it is not given one of its own; left blank, the name with a capital letter. Written with an alias, it is headed by the alias, as a built-in type is.
- Icon
- Any icon in Font Awesome Free, by name, chosen from a picker you
can search. A plain name is looked for among the solid icons, then the
regular ones, then the brands;
regular:orbrands:before the name picks the family. - Colour
- A swatch, or typed: a hex value,
rgb(),hsl()or a CSS colour name. - Aliases
- Other names that open the same type, as
[!tldr]opens an abstract — up to eight, separated by commas or spaces.
In .clew/vault-settings.json
"callouts": [
{ "name": "remark", "title": "Remark", "icon": "flask",
"color": "#2e8b57", "aliases": ["rem"] }
]
The lists merge field by field: a built-in type, then
a global definition, then this vault's, each overriding only the fields
it sets. So a row named warning with nothing but a colour
recolours the built-in warning and keeps its title and icon, and a vault
can change a global type's colour without repeating its icon. Aliases
add to a type's own. An alias that is itself a type's name is ignored;
one that another type already has moves to this one, and a new type
named like an existing alias takes the name — the row says so in each
case.
As with the built-in types, one colour drives a custom callout's border, icon, title and tint, and Clew keeps it readable: a pale colour is darkened on the light theme and a very dark one lightened on the dark, so the same definition reads in both. Each row previews its callout in both themes. A row Clew cannot use — a name that is not a name, a colour that is not a colour, an icon Font Awesome does not have — says why and is skipped whole, never applied in part; that holds for a hand-edited file too, and a vault someone sent you can put nothing on the page but a title, a colour and an icon. Deleting a row takes two clicks.
Changes apply at once: the notes open in reading mode, live edit and
embeds redraw, including after a hand edit of
.clew/vault-settings.json. Each custom type gets a command in the
command palette — Insert remark
callout for the example above — and the editor toolbar's callout
menu lists it. Custom types show wherever callouts do: reading mode,
live edit, a website export, the
reading-view PDF, and a note's HTML and LaTeX
exports. (Not in 0.12.0.)
.clew/vault-settings.json
is committed — if your repository ignores .clew/, as the
vaults chapter suggests
for Clew's state, add that one file back. A synced folder (iCloud,
Dropbox) carries it as it is.
An unknown type
A type Clew does not recognise — neither built in nor one of
your own — is still a callout, drawn as a
note: the note's blue and its pencil icon, headed by the
name as you wrote it with a capital letter ([!whatever] is
headed "Whatever") or by the title you gave it. That is what Obsidian
does, so a note using a type that only the other app defines still reads
as a callout in both. Its data-callout is the name, in lower
case, as in Obsidian. (In 0.12.0 an unknown type stays an ordinary
blockquote, with the [!whatever] line visible as text.)
Admonition fences — the older spelling
Before Obsidian had callouts, vaults used the Admonition plugin, which writes fenced blocks instead of blockquotes. Clew reads those too, and renders them as the callouts they always meant — the same types, the same look:
You write (Admonition's syntax)
```ad-warning
title: Careful now
collapse: closed
The body, in ordinary markdown.
```
title: and collapse: (open /
closed) are honoured; icon: and
color: were the plugin's cosmetic overrides and the
callout's own type styling applies instead. Without a
title:, a fence is headed by its type as you wrote it, like
an untitled callout: ad-hint is headed
"Hint", though it looks like a tip, and ad-warning
"Warning". (In 0.12.0 an untitled fence is headed by its type's own
title, as an untitled callout is there: ad-hint reads
"Tip", ad-caution "Warning".) An ad- type Clew's table does not know
renders as a note titled with the raw type name, which is how the plugin
treated user-defined types too.
Styling and compatibility
Each type has one accent colour, which drives its border, icon and title; the body keeps the page's own text colour, so a callout reads as emphasis rather than as a coloured slab. The background tint is mixed from that same colour, which is why callouts look right in both the dark and light themes without a second set of rules.
The markup carries both Obsidian's class names
(callout, data-callout="note") and the
jmarkdown engine's (markdown-alert). A CSS snippet written
for Obsidian therefore keeps working in Clew — see
Theming — and so does anything that targeted
the engine's alert classes.
Icons are Font Awesome Free, embedded as inline SVG rather than fetched at render time, so they appear in reading mode, in an exported site, and on paper alike; a note's LaTeX export draws the same icon in its box.
Reference
| You write | Result |
|---|---|
> [!type] | A callout of that type, headed by the type as written, capitalised: [!CAUTION] → Caution (in 0.12.0, the type's title) |
> [!type] Title | The same, with your title (markdown allowed) |
> [!type]- / > [!type]+ | Collapsible, starting collapsed / expanded |
> [!unknown] | A callout drawn as a note, headed by the name written (in 0.12.0, an ordinary quote, the marker shown as text) |
```ad-type | The Admonition plugin's spelling of the same callout; untitled, headed by the type as written (in 0.12.0, the type's title) |
| Settings → Callouts | Your own types, global or this vault's: name, title, icon, colour, aliases (not in 0.12.0) |
callouts in clew-settings.json / .clew/vault-settings.json | Where those lists are kept; built-in < global < vault, field by field |