Skip to content
bordaigorl edited this page Feb 16, 2015 · 8 revisions

The Evernote plugin supports two-way Markdown editing of notes. Two-way here means that not only can you write your notes in Markdown and have them converted to rich-text notes when saving them to Evernote, but you also can open a note and have it converted back to editable Markdown, from the rich-text version stored on Evernote.

This page documents the Markdown syntax supported by the Evernote plugin. For how to style the generated HTML, see the Styling page.

When opening, from Sublime Text, a note stored on Evernote, two of the following can happen:

  1. if the note was created/last updated with the plugin then the Markdown code will be derived from an hidden element of the note and will match exactly the code you wrote to generate the note's content;
  2. if the note was created/last updated by another client, the Markdown will be recreated from the rich-text internal representation used by Evernote. This is not 100% accurate, as, for instance, there is no way one can infer whether an emphasized element was created using *...* or _..._ so one of the two is picked according to the settings. Other ambiguities are treated similarly, by either choosing a canonical Markdown representation or by inserting raw HTML.

Supported Markdown extensions

Basic Markdown is fully supported.

Fenced code blocks

Fenced code blocks GitHub style are supported. If a language is specified, pygments is used to highlight the code.

Strikethrough and underline

The GFM syntax for strikethrough ~~text~~ is supported in both directions (from and to markdown).

Underlined text is supported by adding the non standard markdown notation ==underlined text==. The == markup follows the same rules as ** for strong.

Checkboxes

GitHub checklist is supported:

 - [ ] Unchecked
 - [x] Checked

rendered using Evernote's built-in checkboxes.

Footnotes

The code [^ref] puts a note marker in the text (rendered with a <sup> element), [^ref]: note text specifies the contents. The footnotes are rendered in a <div> element with title="footnotes" and the footnotes style applied to it.

Raw HTML

Take extra care in not using prohibited elements (see here). Evernote will complain if you use unsupported elements (such as <style>) or unsupported attributes (such as class or id). If you wish to have the code within a raw html block interpreted as Markdown, specify a markdown="1" attribute for the outermost element:

<div markdown="1">
**Note**:

This is important!
</div>

Code Friendly Extension

With the code_friendly setting you can switch on and off the extension that disables parsing of _ so that variables like my_long_var are kept verbatim in the generated HTML. Make sure you change this setting in your Evernote.sublime-settings file, accessible from Preferences > Package Settings > Evernote > Settings – User.

Tables

HTML tables are supported. Just put <table> and </table> each in a single line to enclose the table and put valid HTML inside (use <tr> and <td> to create rows and cells). For example:

<table>
<tr>
<td>Hi</td>
<td>There</td>
</tr>
</table>

If you wish to use markdown in the cells just use <table markdown="1">.

Special syntax for tables can be enabled using the wiki_tables and gfm_tables setting. Then you can write tables using the WikiTables syntax documented here or the GFM one documented here. Make sure you change this setting in your Evernote.sublime-settings file, accessible from Preferences > Package Settings > Evernote > Settings – User. For example, with wiki_tables set to true, this:

|| *Year* || *Temperature (low)* || *Temperature (high)* ||
|| 1900 || -10 || 25 ||
|| 1910 || -15 || 30 ||
|| 1920 || -10 || 32 ||
|| 1930 || _N/A_ || _N/A_ ||
|| 1940 || -2 || 40 ||

gets turned into this

Year Temperature (low) Temperature (high)
1900 -10 25
1910 -15 30
1920 -10 32
1930 N/A N/A
1940 -2 40

The style can be controlled via the inline_css settings (specifically using the table, td, th (GFM only), tr, tr:odd and tr:even keys). The default Evernote.sublime-settings file contains predefined styles that mimic GitHub tables' appearances.

Obviously, if you modify the table from other clients you will loose the original wiki-tables textual formatting and will get a raw HTML table instead on open.