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.
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.
- 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
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 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" />
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" />
However, take note that Prism does not cooperate well with Emanote’s live preview mode.