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 differently, for example: [[Foo bar]] (if a wiki-link) or [Foo bar](foo-bar.md) (if a regular Markdown link).

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

Emanote supports Obsidian-style callouts. 5 To customize their structure and styling, change callout.tpl (and base.tpl) in HTML templates.

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.

Info

This is an info callout

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

Callouts can have custom titles

Like this one.

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

Warning

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

Failure

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

Callouts also work with Org Mode ✍️ syntax.

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:

Level 3

Level 4

Level 5
Level 6
Live server behaviour

When running in the live server (not static site), you may find that scrolling to heading anchors is glitchy. This is a known issue that you can help resolve; see here.

More extensions

Syntax Highlighting

In order to enable syntax highlighting, you must use a client-side JavaScript highlighter, such as highlight.js by adding it to page.headHtml of YAML configuration or Markdown frontmatter. Emanote already provides a snippet, so you may directly include the following in your index.yaml (assuming you are enabling it on all routes):

page:
  headHtml: |
    <snippet var="js.highlightjs" />
Warning

Bear in mind that when using highlight.js you must manually add language support. The above snippet includes Haskell and Nix by default; otherwise, it is normally added as:

page:
  headHtml: |
    <snippet var="js.highlightjs" />
    <with var="js">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/${value:highlightjs-ver}/languages/haskell.min.js"></script>
    </with>

(The highlightjs-ver variable comes from the default index.yaml.)

Example (highlight.js)

Python

def fib(n):
    a, b = 0, 1
    while a < n:
        print(a, end=' ')
        a, b = b, a+b
    print()
fib(1000)

Haskell

fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)

Prism

A predefined snippet also exists for another syntax highlighter called Prism. To use it add the following to page.headHtml of YAML configuration or Markdown frontmatter.

page:
  headHtml: |
    <snippet var="js.prism" />
Prism does not cooperate well with Emanote’s live preview mode.

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.
5.
Not all of Obsidian spec may yet be supported. See https://github.com/srid/emanote/issues/465 for details.
Links to this page
#emanote/syntax/demo