Skip to content

Build your personal knowledge base with Trilium Notes

docs(user): mention new features for markdown

Elian Doran845877e98826
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html
index 4402246350..f172885093 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Markdown.html
@@ -16,7 +16,7 @@
text notes.</p>
<aside class="admonition note">
<p>Feature requests regarding the Markdown implementation will be considered,
- but if they are outside the realm of Trilium they will not be implemented.
+ but if they are outside the realm of Trilium, they will not be implemented.
One of the core aspects of the Markdown integration is that it reuses components
that are already available through other features of the application.</p>
</aside>
@@ -31,48 +31,128 @@
<h3>Preview pane</h3>
<p>The following features are supported by Trilium's Markdown format and
will show up in the preview pane:</p>
+<ul>
+ <li>All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes).</li>
+ <li
+ >Basic HTML is also supported (e.g. collapsible blocks using <code spellcheck="false">&lt;details&gt;</code> and
+ <code
+ spellcheck="false">&lt;summary&gt;</code>).</li>
+ <li>Code blocks with syntax highlight. Note that the language must be specified
+ for syntax highlight to apply (e.g. <code spellcheck="false">```js</code>).</li>
+ <li
+ ><a class="reference-link" href="#root/_help_NwBbFdNZ9h7O">Block quotes &amp; admonitions</a>
+ </li>
+ <li><a class="reference-link" href="#root/_help_YfYAtQBcfo5V">Math Equations</a>&nbsp;(both
+ inline and block)</li>
+ <li><a class="reference-link" href="#root/_help_s1aBHPd79XYj">Mermaid Diagrams</a>&nbsp;using
+ <code
+ spellcheck="false">```mermaid</code>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_nBAXQFj20hS1">Include Note</a>&nbsp;(no
+ built-in Markdown syntax, but HTML syntax works just fine):</p><pre><code class="language-text-html">&lt;section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable"&gt;
+ &amp;nbsp;
+&lt;/section&gt;</code></pre>
+ <ul>
+ <li>These can also be quickly created via the <code spellcheck="false">/include</code> command
+ or via a dedicated keyboard shortcut (not assigned by default).</li>
+ </ul>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_hrZ1D00cLbal">Internal (reference) links</a>&nbsp;via
+ its HTML syntax, or through a <em>Wikilinks</em>-like format (only&nbsp;
+ <a
+ class="reference-link" href="#root/_help_m1lbrzyKDaRB">Note ID</a>):</p><pre><code class="language-text-x-markdown">[[Hg8TS5ZOxti6]]</code></pre>
+ </li>
+ <li>
+ <p><a class="reference-link" href="#root/_help_AgjCISero73a">Footnotes</a>&nbsp;are
+ also supported via the corresponding Markdown syntax:</p><pre><code class="language-text-x-markdown">This is [^1], while this is [^2].
+
+[^1]: the first footnote
+[^2]: the second footnote</code></pre>
+ <ul>
+ <li>These can also be quickly created using the <code spellcheck="false">/footnote</code> command.</li>
+ </ul>
+ </li>
+</ul>
+<h3>Links</h3>
+<p>Multiple types of links are supported:</p>
<ul>
<li>
- <p>All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes)</p>
+ <p>Web URLs can be written with the standard Markdown syntax:</p><pre><code class="language-text-x-markdown">[Wikipedia](https://www.wikipedia.org)</code></pre>
</li>
<li>
- <p>Code blocks with syntax highlight. Note that the language must be specified
- for syntax highlight to apply (e.g. <code spellcheck="false">```js</code>).</p>
+ <p><a href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/QEAPj01N5f7w/_help_hrZ1D00cLbal">Reference link</a> to
+ other notes with dynamic title, either by manually entering the note ID
+ or via the <em>Add link</em> dialog:</p><pre><code class="language-text-x-markdown">[[B9oMG6rFvvfq]]</code></pre>
</li>
<li>
- <p><a class="reference-link" href="#root/_help_NwBbFdNZ9h7O">Block quotes &amp; admonitions</a>
- </p>
+ <p><a href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/QEAPj01N5f7w/_help_hrZ1D00cLbal">Reference link</a> to
+ other notes with a custom text:</p><pre><code class="language-text-x-markdown">[This is a link](#root/LhtnZxtVsUMp)</code></pre>
</li>
+</ul>
+<p>To create a link, either:</p>
+<ul>
+ <li>Type it manually using the syntax described above.</li>
+ <li>Use the <em>Add link</em> dialog by pressing <kbd spellcheck="false">Ctrl</kbd>+
+ <kbd
+ spellcheck="false">L</kbd>or typing the <code spellcheck="false">/link</code> command.</li>
+</ul>
+<h3>Keyboard shortcuts</h3>
+<p>The Markdown notes share some of the keyboard shortcuts from&nbsp;<a class="reference-link"
+ href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a>&nbsp;notes:</p>
+<ul>
<li>
- <p><a class="reference-link" href="#root/_help_YfYAtQBcfo5V">Math Equations</a>&nbsp;(both
- inline and block)</p>
+ <p><em>Cut to note</em> (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">X</kbd>)
+ which cuts the selection into a new child note.</p>
</li>
<li>
- <p><a class="reference-link" href="#root/_help_s1aBHPd79XYj">Mermaid Diagrams</a>&nbsp;using
- <code
- spellcheck="false">```mermaid</code>
- </p>
+ <p><em>Add link</em> (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">L</kbd>)
+ which shows the dialog to create external or reference links.</p>
</li>
<li>
- <p><a class="reference-link" href="#root/_help_nBAXQFj20hS1">Include Note</a>&nbsp;(no
- built-in Markdown syntax, but HTML syntax works just fine):</p><pre><code class="language-text-x-trilium-auto">&lt;section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable"&gt;
- &amp;nbsp;
-&lt;/section&gt;n</code></pre>
+ <p><em>Insert date/time</em> (<kbd spellcheck="false">Alt</kbd>+<kbd spellcheck="false">T</kbd>)
+ which respects the same formatting as text notes.</p>
</li>
<li>
- <p><a class="reference-link" href="#root/_help_hrZ1D00cLbal">Internal (reference) links</a>&nbsp;via
- its HTML syntax, or through a <em>Wikilinks</em>-like format (only&nbsp;
- <a
- class="reference-link" href="#root/_help_m1lbrzyKDaRB">Note ID</a>):</p><pre><code class="language-text-x-trilium-auto">[[Hg8TS5ZOxti6]]</code></pre>
+ <p><em>Include note</em> (not assigned by default), which triggers the same
+ dialog to insert notes as the one for text notes.</p>
</li>
+</ul>
+<h3>Images &amp; attachments</h3>
+<p>Images can be inserted into the document in four different methods:</p>
+<ul>
<li>
- <p><a class="reference-link" href="#root/_help_AgjCISero73a">Footnotes</a>&nbsp;are
- also supported via the corresponding Markdown syntax:</p><pre><code class="language-text-x-trilium-auto">This is [^1], while this is [^2].
-
-[^1]: the first footnote
-[^2]: the second footnote</code></pre>
+ <p>Drag &amp; drop directly into the editor area.</p>
+ </li>
+ <li>
+ <p>Pasting an image from clipboard.</p>
+ </li>
+ <li>
+ <p>Pasting a reference to another <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/BFs8mudNFgCS/_help_0vhv7lsOLy82">attachment</a> (e.g. <em>Copy reference to clipboard</em> button).</p>
+ </li>
+ <li>
+ <p>Use the <code spellcheck="false">/image</code> slash command.</p>
+ </li>
+</ul>
+<p>An image reference to an attachment looks like this:</p><pre><code class="language-text-x-markdown">![Name.jpeg](api/attachments/z50RceuHXe9J/image/image)</code></pre>
+<h3>Slash commands</h3>
+<p>Just like&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a>&nbsp;notes,
+ Markdown notes support a selection of slash commands:</p>
+<ul>
+ <li>
+ <p>Creating <a href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/_help_NwBbFdNZ9h7O">admonitions</a> (e.g.
+ <code
+ spellcheck="false">/tip</code>)</p>
+ </li>
+ <li>
+ <p>Uploading images (<code spellcheck="false">/image</code>).</p>
+ </li>
+ <li>
+ <p>Inserting the current date &amp; time (<code spellcheck="false">/date</code>).</p>
</li>
</ul>
+<p>Note that slash commands only work outside of inline&nbsp;</p>
<h3>Other features</h3>
<ul>
<li>The&nbsp;<a class="reference-link" href="#root/_help_BFvAtE74rbP6">Table of contents</a>&nbsp;will
@@ -95,7 +175,8 @@
<ol>
<li>Create a new note (e.g. in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>)
and select the type <em>Markdown</em>, just like all the other note types.</li>
- <li>Create a note of type&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;and
+ <li
+ >Create a note of type&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;and
select as the language either <em>Markdown</em> or <em>GitHub-Flavored Markdown</em>.
This maintains compatibility with your existing notes prior to the introduction
of this feature.</li>
@@ -103,8 +184,15 @@
<aside class="admonition note">
<p>There is no distinction between the new Markdown note type and code notes
of type Markdown; internally both are represented as&nbsp;<a class="reference-link"
- href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes with the proper MIME type
- (e.g. <code spellcheck="false">text/x-markdown</code>).</p>
+ href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes with one of the following
+ MIME types:</p>
+ <ul>
+ <li><code spellcheck="false">text/markdown</code>
+ </li>
+ <li><code spellcheck="false">text/x-markdown</code>
+ </li>
+ <li><code spellcheck="false">text/x-gfm</code> (GitHub Flavored Markdown)</li>
+ </ul>
</aside>
<h2>Import/export</h2>
<ul>
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Anchors.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Anchors.html
index e66f1471f3..94671ecc16 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Anchors.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Anchors.html
@@ -15,16 +15,15 @@
<li>To create a anchor:
<ul>
<li>Place the cursor at the desired position where to place the anchor.</li>
- <li
- >Look for the
+ <li>Look for the
<img src="Anchors_plus.png"
width="15" height="16">button in the&nbsp;<a class="reference-link" href="#root/_help_nRhnJkTT8cPs">Formatting toolbar</a>,
and then press the
<img src="1_Anchors_plus.png"
width="12" height="15">button.</li>
- <li>Alternatively, use&nbsp;<a class="reference-link" href="#root/_help_ZlN4nump6EbW">Slash Commands</a>&nbsp;and
- look for <em>anchor</em>.</li>
- </ul>
+ <li>Alternatively, use&nbsp;<a class="reference-link" href="#root/_help_ZlN4nump6EbW">Slash Commands</a>&nbsp;and
+ look for <em>anchor</em>.</li>
+ </ul>
</li>
<li>To place a link to a anchor:
<ul>
diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md
index 5f44c4915b..3d4d679ce7 100644
--- a/docs/Developer Guide/Developer Guide/Documentation.md
+++ b/docs/Developer Guide/Developer Guide/Documentation.md
@@ -1,5 +1,5 @@
# Documentation
-There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/rnAvaqJtdg7Q/Documentation_image.png" width="205" height="162">
+There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/KmFCFBKmAztv/Documentation_image.png" width="205" height="162">
* The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing <kbd>F1</kbd>.
* The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers.
diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json
index 0c134be197..6ba32e8c24 100644
--- a/docs/User Guide/!!!meta.json
+++ b/docs/User Guide/!!!meta.json
@@ -11243,6 +11243,13 @@
"value": "markdown",
"isInheritable": false,
"position": 40
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "0vhv7lsOLy82",
+ "isInheritable": false,
+ "position": 180
}
],
"format": "markdown",
diff --git a/docs/User Guide/User Guide/Note Types/Markdown.md b/docs/User Guide/User Guide/Note Types/Markdown.md
index e4df7ba71e..4199dd021d 100644
--- a/docs/User Guide/User Guide/Note Types/Markdown.md
+++ b/docs/User Guide/User Guide/Note Types/Markdown.md
@@ -10,7 +10,7 @@ The goal of this note type is to fill a gap: rendering Markdown but not altering
Even if Markdown is now specially treated by having a preview mechanism, Trilium remains at its core a WYSWYG editor so Markdown will not replace text notes.
> [!NOTE]
-> Feature requests regarding the Markdown implementation will be considered, but if they are outside the realm of Trilium they will not be implemented. One of the core aspects of the Markdown integration is that it reuses components that are already available through other features of the application.
+> Feature requests regarding the Markdown implementation will be considered, but if they are outside the realm of Trilium, they will not be implemented. One of the core aspects of the Markdown integration is that it reuses components that are already available through other features of the application.
## Features
@@ -24,31 +24,95 @@ Even if Markdown is now specially treated by having a preview mechanism, Trilium
The following features are supported by Trilium's Markdown format and will show up in the preview pane:
-* All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes)
+* All standard and GitHub-flavored syntax (basic formatting, tables, blockquotes).
+* Basic HTML is also supported (e.g. collapsible blocks using `<details>` and `<summary>`).
* Code blocks with syntax highlight. Note that the language must be specified for syntax highlight to apply (e.g. ` ```js `).
* <a class="reference-link" href="Text/Block%20quotes%20%26%20admonitions.md">Block quotes &amp; admonitions</a>
* <a class="reference-link" href="Text/Math%20Equations.md">Math Equations</a> (both inline and block)
* <a class="reference-link" href="Mermaid%20Diagrams.md">Mermaid Diagrams</a> using ` ```mermaid `
* <a class="reference-link" href="Text/Include%20Note.md">Include Note</a> (no built-in Markdown syntax, but HTML syntax works just fine):
- ```
+ ```html
<section class="include-note" data-note-id="vJDjQm0VK8Na" data-box-size="expandable">
&nbsp;
- </section>n
+ </section>
```
+
+ * These can also be quickly created via the `/include` command or via a dedicated keyboard shortcut (not assigned by default).
* <a class="reference-link" href="Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a> via its HTML syntax, or through a _Wikilinks_\-like format (only <a class="reference-link" href="../Advanced%20Usage/Note%20ID.md">Note ID</a>):
- ```
+ ```markdown
[[Hg8TS5ZOxti6]]
```
* <a class="reference-link" href="Text/Footnotes.md">Footnotes</a> are also supported via the corresponding Markdown syntax:
- ```
+ ```markdown
This is [^1], while this is [^2].
[^1]: the first footnote
[^2]: the second footnote
```
+
+ * These can also be quickly created using the `/footnote` command.
+
+### Links
+
+Multiple types of links are supported:
+
+* Web URLs can be written with the standard Markdown syntax:
+
+ ```markdown
+ [Wikipedia](https://www.wikipedia.org)
+ ```
+* [Reference link](Text/Links/Internal%20\(reference\)%20links.md) to other notes with dynamic title, either by manually entering the note ID or via the _Add link_ dialog:
+
+ ```markdown
+ [[B9oMG6rFvvfq]]
+ ```
+* [Reference link](Text/Links/Internal%20\(reference\)%20links.md) to other notes with a custom text:
+
+ ```markdown
+ [This is a link](#root/LhtnZxtVsUMp)
+ ```
+
+To create a link, either:
+
+* Type it manually using the syntax described above.
+* Use the _Add link_ dialog by pressing <kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">L</kbd> or typing the `/link` command.
+
+### Keyboard shortcuts
+
+The Markdown notes share some of the keyboard shortcuts from <a class="reference-link" href="Text.md">Text</a> notes:
+
+* _Cut to note_ (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">X</kbd>) which cuts the selection into a new child note.
+* _Add link_ (<kbd spellcheck="false">Ctrl</kbd>+<kbd spellcheck="false">L</kbd>) which shows the dialog to create external or reference links.
+* _Insert date/time_ (<kbd spellcheck="false">Alt</kbd>+<kbd spellcheck="false">T</kbd>) which respects the same formatting as text notes.
+* _Include note_ (not assigned by default), which triggers the same dialog to insert notes as the one for text notes.
+
+### Images & attachments
+
+Images can be inserted into the document in four different methods:
+
+* Drag & drop directly into the editor area.
+* Pasting an image from clipboard.
+* Pasting a reference to another [attachment](../Basic%20Concepts%20and%20Features/Notes/Attachments.md) (e.g. _Copy reference to clipboard_ button).
+* Use the `/image` slash command.
+
+An image reference to an attachment looks like this:
+
+```markdown
+![Name.jpeg](api/attachments/z50RceuHXe9J/image/image)
+```
+
+### Slash commands
+
+Just like <a class="reference-link" href="Text.md">Text</a> notes, Markdown notes support a selection of slash commands:
+
+* Creating [admonitions](Text/Block%20quotes%20%26%20admonitions.md) (e.g. `/tip`)
+* Uploading images (`/image`).
+* Inserting the current date & time (`/date`).
+
+Note that slash commands only work outside of inline 
### Other features
@@ -69,7 +133,11 @@ There are two ways to create a Markdown note:
2. Create a note of type <a class="reference-link" href="Code.md">Code</a> and select as the language either _Markdown_ or _GitHub-Flavored Markdown_. This maintains compatibility with your existing notes prior to the introduction of this feature.
> [!NOTE]
-> There is no distinction between the new Markdown note type and code notes of type Markdown; internally both are represented as <a class="reference-link" href="Code.md">Code</a> notes with the proper MIME type (e.g. `text/x-markdown`).
+> There is no distinction between the new Markdown note type and code notes of type Markdown; internally both are represented as <a class="reference-link" href="Code.md">Code</a> notes with one of the following MIME types:
+>
+> * `text/markdown`
+> * `text/x-markdown`
+> * `text/x-gfm` (GitHub Flavored Markdown)
## Import/export