docs(guide): improve and update supported syntax for Markdown import

This commit is contained in:
Elian Doran
2025-06-21 09:46:13 +03:00
parent 002c567ae9
commit 41e88614d7
14 changed files with 259 additions and 159 deletions

View File

@@ -4350,13 +4350,6 @@
"type": "text",
"mime": "text/markdown",
"attributes": [
{
"type": "relation",
"name": "internalLink",
"value": "NwBbFdNZ9h7O",
"isInheritable": false,
"position": 10
},
{
"type": "label",
"name": "shareAlias",
@@ -4370,6 +4363,13 @@
"value": "bx bxl-markdown",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "rJ9grSgoExl9",
"isInheritable": false,
"position": 60
}
],
"format": "markdown",
@@ -4407,6 +4407,38 @@
"position": 10,
"dataFileName": "Markdown_markdown-inline-i.gif"
}
],
"dirFileName": "Markdown",
"children": [
{
"isClone": false,
"noteId": "rJ9grSgoExl9",
"notePath": [
"pOsGYCXsbNQG",
"gh7bpGYxajRS",
"mHbBMPDPkVV5",
"Oau6X9rCuegd",
"rJ9grSgoExl9"
],
"title": "Supported syntax",
"notePosition": 10,
"prefix": null,
"isExpanded": false,
"type": "text",
"mime": "text/html",
"attributes": [
{
"type": "label",
"name": "iconClass",
"value": "bx bx-code-alt",
"isInheritable": false,
"position": 10
}
],
"format": "markdown",
"dataFileName": "Supported syntax.md",
"attachments": []
}
]
},
{
@@ -4957,31 +4989,52 @@
{
"type": "relation",
"name": "internalLink",
"value": "CoFPLs3dRlXc",
"value": "gLt3vA97tMcp",
"isInheritable": false,
"position": 150
},
{
"type": "relation",
"name": "internalLink",
"value": "A9Oc6YKKc65v",
"value": "ZlN4nump6EbW",
"isInheritable": false,
"position": 160
},
{
"type": "relation",
"name": "internalLink",
"value": "QrtTYPmdd1qq",
"value": "KC1HB96bqqHX",
"isInheritable": false,
"position": 170
},
{
"type": "relation",
"name": "internalLink",
"value": "MI26XDLSAlCD",
"value": "CoFPLs3dRlXc",
"isInheritable": false,
"position": 180
},
{
"type": "relation",
"name": "internalLink",
"value": "A9Oc6YKKc65v",
"isInheritable": false,
"position": 190
},
{
"type": "relation",
"name": "internalLink",
"value": "QrtTYPmdd1qq",
"isInheritable": false,
"position": 200
},
{
"type": "relation",
"name": "internalLink",
"value": "MI26XDLSAlCD",
"isInheritable": false,
"position": 210
},
{
"type": "label",
"name": "shareAlias",
@@ -5009,27 +5062,6 @@
"value": "",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "gLt3vA97tMcp",
"isInheritable": false,
"position": 190
},
{
"type": "relation",
"name": "internalLink",
"value": "ZlN4nump6EbW",
"isInheritable": false,
"position": 200
},
{
"type": "relation",
"name": "internalLink",
"value": "KC1HB96bqqHX",
"isInheritable": false,
"position": 210
}
],
"format": "markdown",
@@ -5091,6 +5123,13 @@
"value": "bx bx-info-circle",
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "rJ9grSgoExl9",
"isInheritable": false,
"position": 20
}
],
"format": "markdown",
@@ -6741,7 +6780,7 @@
"name": "internalLink",
"value": "wy8So3yZZlH9",
"isInheritable": false,
"position": 10
"position": 20
},
{
"type": "label",
@@ -6785,28 +6824,28 @@
"name": "internalLink",
"value": "iPIMuisry3hd",
"isInheritable": false,
"position": 10
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "A9Oc6YKKc65v",
"isInheritable": false,
"position": 10
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "NwBbFdNZ9h7O",
"isInheritable": false,
"position": 10
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "pwc194wlRzcH",
"isInheritable": false,
"position": 20
"position": 50
},
{
"type": "label",
@@ -6858,56 +6897,56 @@
"name": "internalLink",
"value": "KC1HB96bqqHX",
"isInheritable": false,
"position": 10
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "oPVyFC7WL2Lp",
"isInheritable": false,
"position": 10
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "OFXdgB2nNk1F",
"isInheritable": false,
"position": 10
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "nRhnJkTT8cPs",
"isInheritable": false,
"position": 10
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "ZlN4nump6EbW",
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "s8alTXmpFR61",
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "wy8So3yZZlH9",
"isInheritable": false,
"position": 10
"position": 60
},
{
"type": "relation",
"name": "internalLink",
"value": "9sRHySam5fXb",
"isInheritable": false,
"position": 10
"position": 70
},
{
"type": "relation",
"name": "internalLink",
"value": "s8alTXmpFR61",
"isInheritable": false,
"position": 80
},
{
"type": "relation",
"name": "internalLink",
"value": "wy8So3yZZlH9",
"isInheritable": false,
"position": 90
},
{
"type": "label",

View File

@@ -42,9 +42,4 @@ If you want to export protected notes, enter a protected session first! This wil
## 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/Block%20quotes%20%26%20admonitions.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.
See the dedicated page: <a class="reference-link" href="Markdown/Supported%20syntax.md">Supported syntax</a>

View File

@@ -0,0 +1,57 @@
# Supported syntax
[GitHub-Flavored Markdown](https://github.github.com/gfm/) 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.
## Links
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.
## 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`.
## Wikilinks
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.
> [!IMPORTANT]
> The path to pages in wikilinks is resolved relatively to the _import root_ and not the current directory of the note. This is to be inline with other platforms that use wikilinks such as SilverBullet.
>
> The root path of the import is determined as follows:
>
> * If there is a single directory within the archive at root level, then that directory is considered the root.
> * If there are multiple files & directories at root level, then the archive root (containing all of these items) is considered the root.

View File

@@ -52,20 +52,4 @@ These types were inspired by GitHub's support for this feature and there are cur
### Markdown support
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`.
See <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Markdown/Supported%20syntax.md">Supported syntax</a>.

View File

@@ -1,5 +1,5 @@
# Slash Commands
<figure class="image image-style-align-right"><img style="aspect-ratio:419/571" src="Slash Commands_image.png" width="419" height="571"></figure>
<figure class="image image-style-align-right"><img style="aspect-ratio:419/571;" src="Slash Commands_image.png" width="419" height="571"></figure>
> [!NOTE]
> This is a premium feature of the editor we are using (CKEditor) and we benefit from it thanks to an written agreement with the team. See  <a class="reference-link" href="../Premium%20features.md">Premium features</a> for more information.

View File

@@ -1,5 +1,5 @@
# Text Snippets
<figure class="image image-style-align-right"><img style="aspect-ratio:265/108" src="Text Snippets_image.png" width="265" height="108"></figure>
<figure class="image image-style-align-right"><img style="aspect-ratio:265/108;" src="Text Snippets_image.png" width="265" height="108"></figure>
> [!NOTE]
> This is a premium feature of the editor we are using (CKEditor) and we benefit from it thanks to an written agreement with the team. See  <a class="reference-link" href="../Premium%20features.md">Premium features</a> for more information.