Markdown ✍️

Emanote notes are primarily written in Markdown format, but Org Mode ✍️ is also supported in a basic form. A tutorial is available here. Below we shall highlight some of the commonmark extensions that Emanote supports on top of standard Mardown syntax.

You can link to a note by placing the filename (without extension) inside double square brackets. For example, [[neuron]] links to the file neuron.md and it will be rendered as Migrating from neuron. Note that it is using the title of the note automatically; you can specify a custom title as [[neuron|Moving off neuron]] which renders as Moving off neuron or even force use of filename with [[neuron|neuron]] which renders as neuron.

See Folgezettel links for a special type of wiki-link used to define the Sidebar (and Uplink tree) heirarchy.

Anchors

Wiki-links do not yet support anchor links, but they work for regular links (example link).

Broken links render with a distinctive red/error style to help you identify missing notes. For example: [[Foo bar]] (wiki-link) or [Foo bar](foo-bar.md) (Markdown link). Fix by creating the target file or correcting the link path.

Ambiguous wiki-links are disambiguated by selecting the one that shares the closest ancestor. 1

Emojis

😄

🏃 🐜

See list of available emojis for reference.

Footnotes

https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/footnotes.md

Demo: Checkout this note 2 and this other note 3 as both are footnotes. You may also reuse 2 footnotes.

Task lists

  • A task that was done
  • A task that is to be done.
  • Task with Markdown and links (eg: Pandoc Lua Filters)
  • A list item with no task marker

Tasks can also be written outside of list context, such as paragraphs:

This is a task on its own paragraph.

Here we have the next paragraph.

Unchecked tasks will appear in the task index available at /-/tasks.

Definition lists

https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/definition_lists.md

Fruits
Apples
Oranges
Animal Foods
Eggs
Diary
Offal
Muscle meat

Lists

Simple lists,

  • Apple
  • Orange
  • Mango

Lists with sub-lists,

  • Muscle meat
  • Offal
    • Liver
    • Heart
  • Misc
    • Bone Marrow
    • Cartillage
    • Skin

List items can contain multiple block elements (eg: paragraph),

  • Meat is the only nutritionally complete food

  • Animal foods contain all of the protein, fat, vitamins and minerals that humans need to function.

    They contain absolutely everything we need in just the right proportions.

  • In contrast to vegetables, meat does not contain any “anti-nutrients”

Ordered lists,

  • Be happy
  • Be harmless
  • Be naive

Tables

CategoryFavourite
Web BrowserBrave
Search EngineBrave Search
ChatElement

(Note that wiki links with a custom text must have their pipe escaped when used inside tables.)

Hash Tags

Add Twitter-like hashtags anywhere in Markdown file. They can also be added to the YAML frontmatter. Hash tags can also be “hierarchical”, for instance: #emanote/syntax/demo

Highlighting

You can highlight any inline text by wraping them in == (ie. ==inline text==). 4 The CSS style for highlighted inlines can be specified in index.yaml. Regular Markdown syntax, including emojis, can be mixed in with highlighted inlines to 🍓 give a distinction on top of it all.

Callouts

See Callouts for details.

Note

This is a note callout

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Heading anchors

You can use the following syntax to override the default heading anchors:

{#head}
## Some heading

On default theme, an anchor is displayed when you hover on the heading allowing you to copy the link to the heading. Here are all heading levels for comparison:

Heading level 3

Heading level 4

Heading level 5
Heading level 6

More extensions

Syntax Highlighting

Emanote includes built-in syntax highlighting powered by skylighting, the same library used by Pandoc. Code blocks are highlighted at build time—no JavaScript required.

How it Works

Code blocks are automatically tokenized during rendering. Each token gets a CSS class (like kw for keywords, st for strings, co for comments) and styled via CSS included in emanote’s default theme.

Example

-- A simple factorial function
factorial :: Integer -> Integer
factorial 0 = 1
factorial n = n * factorial (n - 1)
def fibonacci(n):
    """Generate fibonacci sequence up to n"""
    a, b = 0, 1
    while a < n:
        yield a
        a, b = b, a + b
{ pkgs, ... }:
{
  environment.systemPackages = with pkgs; [
    vim
    git
  ];
}

Supported Languages

Skylighting supports over 140 languages including:

  • Haskell, Python, JavaScript, TypeScript, Rust, Go
  • Nix, Shell/Bash, YAML, JSON, TOML
  • HTML, CSS, SQL, Markdown
  • And many more…

Disabling Syntax Highlighting

To disable built-in syntax highlighting (for example, to use a client-side highlighter like highlight.js instead), set in your index.yaml:

emanote:
  syntaxHighlighting: false

Customizing the Theme

The default theme is in _emanote-static/skylighting.css. To customize, create your own _emanote-static/skylighting.css in your notes directory to override the default.

Alternatively, add custom styles in your index.yaml:

page:
  headHtml: |
    <style>
    /* Override keyword color */
    code span.kw { color: #ff79c6; font-weight: bold; }
    /* Override string color */
    code span.st { color: #f1fa8c; }
    </style>

See the skylighting documentation for a full list of token classes and their meanings.

Mermaid Diagrams

Footnotes
1.
This particular selection process was choosen in particular to allow combining multiple notebooks (with similar note filenames) at the top-level.
2.
First footnote example
3.
Second footnote example. Footnotes within footnotes are not handled.
4.
See original proposal for this syntax here.
Links to this page
#emanote/syntax/demo