Emanote notes are written in Markdown format. A tutorial is available here. Below we shall highlight some of the commonmark extensions that Emanote supports on top of standard Mardown syntax.
Wiki Links
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.
Broken links render differently, for example: [[Foo bar]]❌ (if a wiki-link) or [Foo bar](foo-bar.md)❌ (if a regular Markdown link).
Anchors
Wiki-links do not yet support anchor links, but they work for regular links (example link).
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 1 and this other note 2 as both are footnotes. You may also reuse 1 footnotes.
Task lists
- A task that was done
- A task that is to be done.
- 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
Category | Favourite |
---|---|
Web Browser | Brave |
Search Engine | Brave Search |
Chat | Element |
(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==
).
3
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.
More extensions
In order to enable syntax highlighting, you must use a client-side JavaScript highlighter, such as PrismJS, and add it to page.headHtml
of YAML configuration (if adding to all or multiple routes) or Markdown frontmatter (if adding to a single route):
page:
headHtml: |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/themes/prism-tomorrow.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/combine/npm/[email protected]/prism.min.js,npm/[email protected]/plugins/autoloader/prism-autoloader.min.js"></script>
Or, using the alias from the default layer’s index.yaml
:
page:
headHtml: |
<snippet var="js.prism" />
An alias for highlight.js also exists, especially as highlight.js works better with Mermaid Diagrams than PrismJS:
page:
headHtml: |
<snippet var="js.highlightjs" />
Bear in mind that when using highlight.js you must manually add language support. Prism.js in contrast provides an autoload feature.
Example using PrismJS:
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)