Compatibility processor

Back to Index

For advanced Markdown users

You can make Epsilon Notes compatible with any other Markdown processor. The Preferences has a function called "Compatibility Processor".

Write there regex (regular expression) patterns and replacements that Epsilon Notes will run through your document before rendering. Examples:

Suppose, you have 100500 notes written in an editor, where a non-standard markdown <:link> was used to denote a link. In Commonmarks, for links we use the standard markdown [link](link.md).

If you do not have time to rewrite all your 100500 notes to Commonmark, place the following regex and replacement line in the Compatibility Preprocessor, to treat your <:links> as [links](links.md):

<:([^>]+)>
[$1]($1.md)

This way, all your <:old-links> will internally be replaced with [old-links](old-links.md), and will be processed correspondingly.

A more down-to-earth example. Suppose, you are always making the same mistake writing "Everyone's spelling is definately better then mine", just add the following words to the preprocessor:

definately
definitely
better then
better than

Epsilon Notes will process those words before rendering and show them to you as definitely and better than.

You can add several regex and replacement strings to the preprocessor. The format is:

regex 1
replacement string 1
regex 2
replacement string 2
...

If you enter a wrong regex, then program will pop up a mistake message.

Note: The program does not change your document, when using the preprocessor. It only changes the output.

YAML for Compatibility Processor

You can use preprocessing in individual documents. The format is

---
prerender: |
 regex 1
 replacement string 1
 regex 2
 replacement string 2
...

Thus, if you want to substitute all a's with o's in your document, write YAML:

---
prerender: |
 a
 o
...

Formatting compatibility processor contenta

You can use the following format to fill in the Compatibility Processor in the Preferences:

REGEX1
              <- empty lines ignored
REPLACEMENT1   
              <- empty lines ignored
              <- empty lines ignored
// My comment <- comments ignored
REGEX2
REPACEMENT2

In other words, all empty lines and lines starting with two backslashes are ignored. Use these to add your comments and to make clear formatting of your regexes. For example,regex for Github emojis:


// This is regex for heart

:heart:
❤


// And here's regex for smile

:smile:
☺

If you need to include an enter character in the replacement string, write \n. For example, to make one enter act like a double enter (for enter to move to the next paragraph in any case), you can write the following regex:

\n
\n\n

Premium function:

Instead of providing regexes in the Preferences, you can provide a link there to the regex file, in the format:

file:///storage/..../my_regex.text

If you would like to customize some Commonmark tags with the Compatibility Processor, but you don't know how, please, join Google Group.

Also, see some examples in Tips and Tricks.

You can also read:

Back to Index