mirror of https://github.com/TriliumNext/Notes
docs(guide): improve and update supported syntax for Markdown import
parent
002c567ae9
commit
41e88614d7
File diff suppressed because one or more lines are too long
@ -0,0 +1,54 @@
|
||||
<p><a href="https://github.github.com/gfm/">GitHub-Flavored Markdown</a> is
|
||||
the main syntax that Trilium is following.</p>
|
||||
<h2>Images</h2>
|
||||
<p>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.</p>
|
||||
<h2>Tables</h2>
|
||||
<p>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.</p>
|
||||
<h2>Links</h2>
|
||||
<p>Standard Markdown links are supported.</p>
|
||||
<p>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.</p>
|
||||
<h2>Math equations</h2>
|
||||
<p>Both inline and display equations are supported, using the <code>$</code> and <code>$$</code> syntaxes.</p>
|
||||
<h2>Admonitions</h2>
|
||||
<p>The Markdown syntax for admonitions as supported by Trilium is the one
|
||||
that GitHub uses, which is as follows:</p><pre><code class="language-text-x-trilium-auto">> [!NOTE]
|
||||
> This is a note.
|
||||
|
||||
> [!TIP]
|
||||
> This is a tip.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> This is a very important information.
|
||||
|
||||
> [!CAUTION]
|
||||
> This is a caution.</code></pre>
|
||||
<p>There are currently no plans of supporting alternative admonition syntaxes
|
||||
such as <code>!!! note</code>.</p>
|
||||
<h2>Wikilinks</h2>
|
||||
<p>Basic support for wikilinks has been added in v0.96.0:</p>
|
||||
<ul>
|
||||
<li><code>[[foo/bar]]</code> will look for the <code>bar.md</code> file in the <code>foo</code> directory
|
||||
and turn it into an internal link.</li>
|
||||
<li><code>![[foo/baz.png]]</code> will look for the <code>baz.png</code> file
|
||||
in the <code>foo</code> directory and turn it into an image.</li>
|
||||
</ul>
|
||||
<p>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.</p>
|
||||
<aside class="admonition important">
|
||||
<p>The path to pages in wikilinks is resolved relatively to the <em>import root </em>and
|
||||
not the current directory of the note. This is to be inline with other
|
||||
platforms that use wikilinks such as SilverBullet.</p>
|
||||
<p>The root path of the import is determined as follows:</p>
|
||||
<ul>
|
||||
<li>If there is a single directory within the archive at root level, then
|
||||
that directory is considered the root.</li>
|
||||
<li>If there are multiple files & directories at root level, then the
|
||||
archive root (containing all of these items) is considered the root.</li>
|
||||
</ul>
|
||||
</aside>
|
||||
@ -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.
|
||||
Loading…
Reference in New Issue