feat(docs): document supported syntax

This commit is contained in:
Elian Doran 2025-04-06 22:55:24 +03:00
parent f58a90c648
commit 9fb04b256d
No known key found for this signature in database
4 changed files with 102 additions and 91 deletions

View File

@ -1933,39 +1933,39 @@
"mime": "text/html", "mime": "text/html",
"attributes": [ "attributes": [
{ {
"type": "label", "type": "relation",
"name": "iconClass", "name": "internalLink",
"value": "bx bxs-dock-right", "value": "BFvAtE74rbP6",
"isInheritable": false, "isInheritable": false,
"position": 10 "position": 10
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "BFvAtE74rbP6", "value": "AxshuNRegLAv",
"isInheritable": false, "isInheritable": false,
"position": 20 "position": 20
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "AxshuNRegLAv", "value": "luNhaphA37EO",
"isInheritable": false, "isInheritable": false,
"position": 30 "position": 30
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "luNhaphA37EO", "value": "3seOhtN8uLIY",
"isInheritable": false, "isInheritable": false,
"position": 40 "position": 40
}, },
{ {
"type": "relation", "type": "label",
"name": "internalLink", "name": "iconClass",
"value": "3seOhtN8uLIY", "value": "bx bxs-dock-right",
"isInheritable": false, "isInheritable": false,
"position": 50 "position": 10
} }
], ],
"format": "markdown", "format": "markdown",
@ -3642,6 +3642,13 @@
"value": "bx bxl-markdown", "value": "bx bxl-markdown",
"isInheritable": false, "isInheritable": false,
"position": 50 "position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "NwBbFdNZ9h7O",
"isInheritable": false,
"position": 60
} }
], ],
"format": "markdown", "format": "markdown",
@ -4624,46 +4631,39 @@
"mime": "text/html", "mime": "text/html",
"attributes": [ "attributes": [
{ {
"type": "label", "type": "relation",
"name": "iconClass", "name": "internalLink",
"value": "bx bx-highlight", "value": "RnaPdbciOfeq",
"isInheritable": false, "isInheritable": false,
"position": 10 "position": 10
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "BFvAtE74rbP6", "value": "XpOYSgsLkTJy",
"isInheritable": false, "isInheritable": false,
"position": 20 "position": 20
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "RnaPdbciOfeq", "value": "zEY4DaJG4YT5",
"isInheritable": false, "isInheritable": false,
"position": 30 "position": 30
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "_optionsTextNotes", "value": "BFvAtE74rbP6",
"isInheritable": false, "isInheritable": false,
"position": 40 "position": 40
}, },
{ {
"type": "relation", "type": "label",
"name": "internalLink", "name": "iconClass",
"value": "zEY4DaJG4YT5", "value": "bx bx-highlight",
"isInheritable": false, "isInheritable": false,
"position": 50 "position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "XpOYSgsLkTJy",
"isInheritable": false,
"position": 60
} }
], ],
"format": "markdown", "format": "markdown",
@ -5100,37 +5100,30 @@
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "XpOYSgsLkTJy", "value": "RnaPdbciOfeq",
"isInheritable": false, "isInheritable": false,
"position": 10 "position": 10
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "_optionsTextNotes", "value": "XpOYSgsLkTJy",
"isInheritable": false, "isInheritable": false,
"position": 20 "position": 20
}, },
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 30
},
{ {
"type": "label", "type": "label",
"name": "iconClass", "name": "iconClass",
"value": "bx bx-heading", "value": "bx bx-heading",
"isInheritable": false, "isInheritable": false,
"position": 30 "position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "RnaPdbciOfeq",
"isInheritable": false,
"position": 50
} }
], ],
"format": "markdown", "format": "markdown",

View File

@ -1,5 +1,5 @@
# Markdown # Markdown
Trilium Notes supports importing Markdown restricted to the [CommonMark specification](https://spec.commonmark.org/current/) (where [tables are not supported](https://github.com/TriliumNext/Notes/issues/2026)) Trilium supports Markdown for both import and export, while trying to keep compatibility as high as possible.
## Import ## Import
@ -39,3 +39,12 @@ If you want to export just single note without its subtree, you can do it from N
### Exporting protected notes ### Exporting protected notes
If you want to export protected notes, enter a protected session first! This will export the notes in an unencrypted form, so if you reimport into Trilium, make sure to re-protect these notes. If you want to export protected notes, enter a protected session first! This will export the notes in an unencrypted form, so if you reimport into Trilium, make sure to re-protect these notes.
## Supported syntax
* [GitHub-Flavored Markdown](https://github.github.com/gfm/) is the main syntax that Trilium is following.
* Images are supported. 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 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.
* <a class="reference-link" href="../../Note%20Types/Text/Admonitions.md">Admonitions</a> are supported using GitHub's format.
* Links are supported. “Reference links” (internal links that mirror a note's title and display its icon) are embedded as HTML in order to preserve the information on import.
* Math equations are supported using `$` and `$$` syntaxes.

View File

@ -1933,39 +1933,39 @@
"mime": "text/html", "mime": "text/html",
"attributes": [ "attributes": [
{ {
"type": "label", "type": "relation",
"name": "iconClass", "name": "internalLink",
"value": "bx bxs-dock-right", "value": "BFvAtE74rbP6",
"isInheritable": false, "isInheritable": false,
"position": 10 "position": 10
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "BFvAtE74rbP6", "value": "AxshuNRegLAv",
"isInheritable": false, "isInheritable": false,
"position": 20 "position": 20
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "AxshuNRegLAv", "value": "luNhaphA37EO",
"isInheritable": false, "isInheritable": false,
"position": 30 "position": 30
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "luNhaphA37EO", "value": "3seOhtN8uLIY",
"isInheritable": false, "isInheritable": false,
"position": 40 "position": 40
}, },
{ {
"type": "relation", "type": "label",
"name": "internalLink", "name": "iconClass",
"value": "3seOhtN8uLIY", "value": "bx bxs-dock-right",
"isInheritable": false, "isInheritable": false,
"position": 50 "position": 10
} }
], ],
"format": "html", "format": "html",
@ -3642,6 +3642,13 @@
"value": "bx bxl-markdown", "value": "bx bxl-markdown",
"isInheritable": false, "isInheritable": false,
"position": 50 "position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "NwBbFdNZ9h7O",
"isInheritable": false,
"position": 60
} }
], ],
"format": "html", "format": "html",
@ -4624,46 +4631,39 @@
"mime": "text/html", "mime": "text/html",
"attributes": [ "attributes": [
{ {
"type": "label", "type": "relation",
"name": "iconClass", "name": "internalLink",
"value": "bx bx-highlight", "value": "RnaPdbciOfeq",
"isInheritable": false, "isInheritable": false,
"position": 10 "position": 10
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "BFvAtE74rbP6", "value": "XpOYSgsLkTJy",
"isInheritable": false, "isInheritable": false,
"position": 20 "position": 20
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "RnaPdbciOfeq", "value": "zEY4DaJG4YT5",
"isInheritable": false, "isInheritable": false,
"position": 30 "position": 30
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "_optionsTextNotes", "value": "BFvAtE74rbP6",
"isInheritable": false, "isInheritable": false,
"position": 40 "position": 40
}, },
{ {
"type": "relation", "type": "label",
"name": "internalLink", "name": "iconClass",
"value": "zEY4DaJG4YT5", "value": "bx bx-highlight",
"isInheritable": false, "isInheritable": false,
"position": 50 "position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "XpOYSgsLkTJy",
"isInheritable": false,
"position": 60
} }
], ],
"format": "html", "format": "html",
@ -5100,37 +5100,30 @@
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "XpOYSgsLkTJy", "value": "RnaPdbciOfeq",
"isInheritable": false, "isInheritable": false,
"position": 10 "position": 10
}, },
{ {
"type": "relation", "type": "relation",
"name": "internalLink", "name": "internalLink",
"value": "_optionsTextNotes", "value": "XpOYSgsLkTJy",
"isInheritable": false, "isInheritable": false,
"position": 20 "position": 20
}, },
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 30
},
{ {
"type": "label", "type": "label",
"name": "iconClass", "name": "iconClass",
"value": "bx bx-heading", "value": "bx bx-heading",
"isInheritable": false, "isInheritable": false,
"position": 30 "position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "RnaPdbciOfeq",
"isInheritable": false,
"position": 50
} }
], ],
"format": "html", "format": "html",

View File

@ -13,9 +13,8 @@
<h1 data-trilium-h1>Markdown</h1> <h1 data-trilium-h1>Markdown</h1>
<div class="ck-content"> <div class="ck-content">
<p>Trilium Notes supports importing Markdown restricted to the <a href="https://spec.commonmark.org/current/">CommonMark specification</a> (where <p>Trilium supports Markdown for both import and export, while trying to
<a keep compatibility as high as possible.</p>
href="https://github.com/TriliumNext/Notes/issues/2026">tables are not supported</a>)</p>
<h2>Import</h2> <h2>Import</h2>
<h3>Clipboard import</h3> <h3>Clipboard import</h3>
<p>If you want to import just a chunk of markdown from clipboard, you can <p>If you want to import just a chunk of markdown from clipboard, you can
@ -57,6 +56,23 @@
<p>If you want to export protected notes, enter a protected session first! <p>If you want to export protected notes, enter a protected session first!
This will export the notes in an unencrypted form, so if you reimport into This will export the notes in an unencrypted form, so if you reimport into
Trilium, make sure to re-protect these notes.</p> Trilium, make sure to re-protect these notes.</p>
<h2>Supported syntax</h2>
<ul>
<li><a href="https://github.github.com/gfm/">GitHub-Flavored Markdown</a> is
the main syntax that Trilium is following.</li>
<li>Images are supported. 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.</li>
<li>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.</li>
<li><a class="reference-link" href="../../Note%20Types/Text/Admonitions.html">Admonitions</a>&nbsp;are
supported using GitHub's format.</li>
<li>Links are supported. “Reference links” (internal links that mirror a note's
title and display its icon) are embedded as HTML in order to preserve the
information on import.</li>
<li>Math equations are supported using <code>$</code> and <code>$$</code> syntaxes.</li>
</ul>
</div> </div>
</div> </div>
</body> </body>