Supported syntax

GitHub-Flavored Markdown is the main syntax that Trilium is following.

Images

When exporting, images are usually kept in the basic Markdown syntax but will use the HTML syntax if the image has a custom width. Figures are always embedded as HTML.

Tables

Simple tables are supported with the Markdown syntax. If the table is too complex or contains elements that would render as HTML, the table is also rendered as HTML.

Standard Markdown links are supported.

Trilium internal links (that mirror a note's title and display its icon) are embedded as HTML in order to preserve the information on import.

Anchors are kept as HTML as well, so links to an anchor still lead to it after the note is imported again.

Math equations

Both inline and display equations are supported, using the $ and $$ syntaxes.

Admonitions

The Markdown syntax for admonitions as supported by Trilium is the one that GitHub uses, which is as follows:

> [!NOTE]
> This is a note.

> [!TIP]
> This is a tip.

> [!IMPORTANT]
> This is a very important information.

> [!CAUTION]
> This is a caution.

There are currently no plans of supporting alternative admonition syntaxes such as !!! note.

Tabs

Tabs use the syntax of Material for MkDocs: each tab starts with a === "Title" line, followed by its content indented by four spaces. Consecutive tabs form one tabs block, and ===! starts a new block right after another one:

=== "Windows"

    Run the **installer**.

=== "Linux"

    Use the package.

===! "Another block"

    This tab starts a separate tabs block.

Tabs can be nested by indenting the inner tabs inside the content of a tab. A tab title is plain text, so its formatting is not kept on export. For how tabs blocks work in a text note, see Content tabs.

Aside blocks

Aside blocks are written as <aside> tags on lines of their own, with the content between them in Markdown:

<aside>

A **side note** at the right of the text.

</aside>

A plain <aside> tag is placed and colored like a newly inserted aside block: at the right, with the text wrapping around it, on a gray background. A tag with attributes takes only what they set. For another position, add a data-position attribute with one of these values:

ValuePosition
wrap-leftWrap text → Align left
wrap-rightWrap text → Align right, the default
leftBreak text → Align left
centerBreak text → Align center
rightBreak text → Align right

For a background color, add a style attribute such as style="background-color:#4d99e6". Without one, a tag with attributes gives a transparent aside block.

The export follows the same rules, and also keeps the width of a resized aside block.

The blank line after the opening tag is required. Without it, the content is read as plain text instead of Markdown, and the aside block takes the full width of the note.

Basic support for wikilinks has been added in v0.96.0:

  • [[foo/bar]] will look for the bar.md file in the foo directory and turn it into an internal link.
  • ![[foo/baz.png]] will look for the baz.png file in the foo directory and turn it into an image.

This feature is import-only, which means that it will turn wikilinks into Trilium-compatible syntax, but it will not export Trilium Notes into Markdown files with this syntax.

Highlights

Background highlights are supported in two ways:

  • The Markdown == extension which is supported by other Markdown-based applications such as Obsidian:

    ==highlighted==
  • The canonical HTML representation of highlights, as supported by Trilium:

    <span style="background-color:hsl(0,0%,100%);">Highlighted</span>

When the yellow highlight is used, import/export prefers the == syntax whereas the canonical HTML reprepresentation is used otherwise.