Syntax
Some fields of your en graph, namely the Node text field, have support for special syntax that allows you to apply formatting and create connections between your graph's nodes.
If you are familiar with Markdown, you'll find some features familiar, with some notable differences too.
Anchors
Anchors are the most important and powerful syntactic element you will work with because they can create connections between nodes when you use them. They have the following basic syntax:
anchor|destination
For example:
particles|ParticlePhysics
This example will render as the word "particles" pointing to a node with ID ParticlePhysics because the destination is not an external URL.
An external anchor looks like this:
docs|https://en.jutty.dev/node/Documentation
External anchors are identified by the presence of either a : or a / character in the destination. This works for special handlers, such as mailto:user@domain.com, and destinations relative to the website root like /about.
If the left side contains spaces, you need a leading | character:
|en docs|https://en.jutty.dev/node/Documentation
To make a plain address clickable, wrap it in two | characters:
|https://en.jutty.dev|
Trailing characters in anchors
For internal anchors, most punctuation is automatically separated from the anchor destination so you can simply write:
This gem|PreciousStone, though green, was not an emerald.
This gem, though green, was not an emerald.
However, for external anchors, you want to add a third | to explicitly set the end because external URLs can have all sorts of arbitrary characters.
Node anchors
Because anchors between nodes are central to en, there is special syntax to make them as fluid as possible to create without cluttering the text too much.
A node ID wrapped in two | characters will become an anchor to that node:
|ParticlePhysics|
en can resolve IDs case insensitively (with priority to case-sensitive matches) and will also collapse spaces when trying to resolve an ID, so you can also write:
check out the |en documentation|
And if an anchor with the id enDocumentation or any other case-insensitive combination exists, it will land on it.
In summary, all of the anchors below are valid and lead to the same page:
|syntax|Syntax Syntax|syntax Syntax|syn tax| |Syntax| |syntax| |syn tax|
While flexible, this can sometimes be ambiguous. See AnchorSyntax for some caveats regarding anchors.
Formatting
Supported formatting syntax includes:
*for bold_for italics__for underline~~for strikethrough
To apply these, you can wrap a word in the formatting operators, so for instance *this* will be rendered as this and ~~this~~ as this.
Checkboxes
You can use [ ] and [x] to render checkboxes:
- [ ] not done - [x] done
- not done
- done
Blocks
A block is any group of lines separated by empty lines:
block A still block A block A's last line block B starts here block B ends here this is block C
By default, a block not starting with any special syntax is a paragraph, such as this very line you are reading.
Some blocks will join the lines together, meaning even if you write:
a b c
You still get "a b c" as a result. This is the case for paragraphs, but not for lists, verse blocks, tables and preformatted text. Blockquotes support both modes.
This is useful when editing your text, allowing you to break some thoughts and special syntax without losing control over where your paragraph ends, particularly when handling huge paragraphs.
If you want to force lines to break, you can use a < character at the end of a line:
a < b < c <
Which renders as:
a
b
c
While useful to break a few lines on demand, if you have a large block of lines you want to break this can become cumbersome. That's where verse blocks are useful.
Verse
Verse blocks are delimited by a & character at their first and last line and are useful to avoid precisely this line-joining behavior of paragraphs. They will break all lines without need for a trailing < character:
&
these lines
break just fine
once they are over
&
these lines
break just fine
once they are over
Quotes
A block of lines starting with a > character will render as a quote:
> Who'll change old lamps for new ones?
Who'll change old lamps for new ones?
Quote blocks have two forms. If you prepend all blocks with a >, line breaks will be preserved, not collapsing the whole quote into a single line:
> When I was alive > I was dust which was, > But now I am dust in dust > I am dust which never was.
When I was alive
I was dust which was,
But now I am dust in dust
I am dust which never was.
If you would like the quote to be collapsed into a single line instead, you can leave just the first > and continue until the next empty line:
> And should I feel kindness towards my enemies? No: from that moment I declared everlasting war against the species, and more than all, against him who had formed me and sent me forth to this insupportable misery.
And should I feel kindness towards my enemies? No: from that moment I declared everlasting war against the species, and more than all, against him who had formed me and sent me forth to this insupportable misery.
You can still use < characters to force line breaks in this case.
Citation
To add a citation to your quote block, start a line with two - characters:
> with no more communion > to down as morning pick-me-ups > to sweeten afternoon naps > to soothe nightmares -- Assotto Saint, The Language of Dust
with no more communion
to down as morning pick-me-ups
to sweeten afternoon naps
to soothe nightmares
Assotto Saint, The Language of Dust
If you have a more complex citation, you can use multiple lines starting with --. All such lines will be joined together in the citation. If you need to break lines, use the < character at the end of a line:
> Dois grandes mitos dominam a história oficial do Brasil: o mito da índole pacífica do brasileiro e o da "democracia racial". -- Benedita da Silva, -- |Speech on the Federal Senate|https://www25.senado.leg.br/web/atividade/pronunciamentos/-/p/pronunciamento/165765|, -- March 3rd, 1995, < -- International Day for the Elimination of Racial Discrimination
Dois grandes mitos dominam a história oficial do Brasil: o mito da índole pacífica do brasileiro e o da "democracia racial".
Benedita da Silva, Speech on the Federal Senate, March 3rd, 1995,
International Day for the Elimination of Racial Discrimination
The first URL found in your citation will be used as the blockquote element's cite value.
Lists
A block of lines starting with a - character will be rendered as an unordered list:
- cyan - amber - crimson
- cyan
- amber
- crimson
Lines starting with a + character will create numbered lists instead:
+ ichi + ni + san
- ichi
- ni
- san
Tables
Tables are blocks delimited by a sole % on its own line:
%
Country ! Capital
Colombia | Bogotá
Belgium | Brussels
Palestine | Jerusalem
Zambia | Lusaka
%
| Country | Capital |
|---|---|
| Colombia | Bogotá |
| Belgium | Brussels |
| Palestine | Jerusalem |
| Zambia | Lusaka |
Table cells are delimited by either a ! for headers or | for common cells. These delimiters must be surrounded by at least one space to each side and are optional at the first and last position of each line.
This means you can use any of the following formats:
%
middle | only
tail | only |
| lead | only
| fully | wrapped |
%
| middle | only |
| tail | only |
| lead | only |
| fully | wrapped |
Because at least one space is required around each delimiter, you must indent the table inside the surrounding % markers by at least one space.
Rendering unformatted text
The backtick character ` can be used to render unformatted blocks and inline text:
The asterisk `*` is special in en markup syntax.
The asterisk * is special in en markup syntax.
Using the syntax above, the asterisk won't be interpreted as the start of bold formatting and instead will be shown like this: *.
This is useful for code but also for rendering characters with special meaning you wish to mention literally.
Backticks on their own line will start and close a block of unformatted text such as the ones being used throughout this documentation to show code:
` everything in here will be rendered without formatting `
Finally, you can precede any character with a \ to fully escape that character from being interpreted. Because TOML also treats backslashes specially, you'll likely need to use double slashes, as in \\, unless you wrap your TOML strings in single quotes. See Escaping for more details and examples.
Raw HTML
If you need some more advanced feature that is not supported directly by en's markup snytax, you can always just write plain HTML and it will be passed along. For example, you could render a form:
<form style="text-align: center;">
<label for="name"> *__Name__* </label>
<input type="text" id="name"/>
<input type="submit"/>
</form>
Notice that, as shown in this example, you can mix en syntax and HTML. You might want to add a space between your HTML tags and en special syntax so the boundary is clearer, but otherwise they don't tend to overlap since the symbols most used in HTML are not special in en with the exception of <, which is interpreted specially only at the end of lines.
If you want to avoid either one of these syntaxes from being interpreted specially, you should escape the relevant characters as explained in the previous section.