Links, embeds and tags
Charon knows nothing about your files. When a note links to or embeds another file, the parser writes a placeholder, and your app fills it in. A docs site fills them at build time; see Write pages.
Wikilinks #
See [[Ferry]], [[Ferry|the boat]] or [[Ferry#Fares]].
See Ferry, the boat or Ferry > Fares.
| Write | Links to |
|---|---|
[[Ferry]] |
the note Ferry.md; notes need no .md |
[[river/Ferry]] |
a note in a folder |
[[Ferry|the boat]] |
the same note, shown as "the boat" |
[[Ferry#Fares]] |
a heading in that note |
[[Ferry#^dock]] |
a block marked ^dock |
[[#Fares]] |
a heading in this note |
[[map.png]] |
any other file, by its extension |
Each one renders as <a class="wiki-link" data-link-id="Ferry#Fares">. Read
the target from data-link-id, set href, and add wiki-link-broken or
wiki-link-ambiguous when it finds no file or two. The theme styles both.
parseWikiTarget from @memomori/charon/wiki-target splits a target into its
path, heading or block, and label.
Embeds #
![[boat.svg|120]]
![[fare#Fares]]
An embed puts another file inside the note. On a line of its own it renders as
<div class="embed-container" data-file-id="…">; inside a sentence, as a
span. Your app decides what each file type shows.
fillEmbeds from @memomori/charon/assets fills images and notes from a
folder, as above:
| Write | Shows |
|---|---|
![[boat.svg]] |
an image; add |300 for a width |
![[fare]] |
a whole note |
![[fare#Fares]] |
one heading of a note and what sits under it |
It reports any other file type as broken. See Static pages.
Images with a path #
 renders as <img data-blob-path="map.png"> with no src,
since only your app knows where map.png lives. Images with a full URL keep
their src.
Block ids #
The ferry leaves at dusk. ^dusk
| Stop | Time |
| ----- | ----- |
| Dock | 18:00 |
^times
The ferry leaves at dusk.
| Stop | Time |
|---|---|
| Dock | 18:00 |
End a paragraph with ^id, or put ^id on its own line under a table, list
or quote, to mark that block. It renders as
<span class="block-anchor" data-block-id="dusk">, so a link to #^dusk has a
target.
Tags #
Pack for #travel, and book the #travel/river crossing.
Pack for #travel, and book the #travel/river crossing.
A tag renders as <a class="tag" data-tag="travel">.
- Use letters, digits,
-and_. A tag needs one character that is not a digit, so#1stays text. /nests tags:#travel/riversits under#travel.- The
#must start a word, soissue#12is not a tag. Write\#wordfor a plain#word.
noteTags(source) from @memomori/charon/tags lists every tag in a note,
from its text and from tags or tag in its frontmatter.
Frontmatter #
---
title: Ferry
tags: [travel, river]
---
YAML between --- lines at the top of a note is its frontmatter. The output
leaves it out. parseFrontmatter from @memomori/charon/frontmatter reads it.