Skip to content

Build your personal knowledge base with Trilium Notes

feat(docs): document admonitions

Elian Doran79c82b16ce1d
diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json
index a8f82232eb..7872606cfc 100644
--- a/docs/User Guide/!!!meta.json
+++ b/docs/User Guide/!!!meta.json
@@ -2798,6 +2798,51 @@
],
"dirFileName": "Text",
"children": [
+ {
+ "isClone": false,
+ "noteId": "NwBbFdNZ9h7O",
+ "notePath": [
+ "pOsGYCXsbNQG",
+ "KSZ04uQ2D1St",
+ "iPIMuisry3hd",
+ "NwBbFdNZ9h7O"
+ ],
+ "title": "Admonitions",
+ "notePosition": 10,
+ "prefix": null,
+ "isExpanded": false,
+ "type": "text",
+ "mime": "text/html",
+ "attributes": [
+ {
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bx-info-circle",
+ "isInheritable": false,
+ "position": 10
+ }
+ ],
+ "format": "markdown",
+ "dataFileName": "Admonitions.md",
+ "attachments": [
+ {
+ "attachmentId": "do36b54XpmIC",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "Admonitions_image.png"
+ },
+ {
+ "attachmentId": "hUwfwkRSDeLJ",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "1_Admonitions_image.png"
+ }
+ ]
+ },
{
"isClone": false,
"noteId": "QxEyIjRBizuC",
@@ -2808,7 +2853,7 @@
"QxEyIjRBizuC"
],
"title": "Code blocks",
- "notePosition": 10,
+ "notePosition": 20,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2889,7 +2934,7 @@
"veGu4faJErEM"
],
"title": "Content language & Right-to-left support",
- "notePosition": 20,
+ "notePosition": 30,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2926,7 +2971,7 @@
"UYuUB1ZekNQU"
],
"title": "Formatting",
- "notePosition": 30,
+ "notePosition": 40,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2979,7 +3024,7 @@
"nRhnJkTT8cPs"
],
"title": "Formatting toolbar",
- "notePosition": 40,
+ "notePosition": 50,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -3054,7 +3099,7 @@
"mT0HEkOsz6i1"
],
"title": "Images",
- "notePosition": 50,
+ "notePosition": 60,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -3192,7 +3237,7 @@
"QEAPj01N5f7w"
],
"title": "Links",
- "notePosition": 60,
+ "notePosition": 70,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -3248,7 +3293,7 @@
"S6Xx8QIWTV66"
],
"title": "Lists",
- "notePosition": 70,
+ "notePosition": 80,
"prefix": null,
"isExpanded": false,
"type": "text",
diff --git a/docs/User Guide/User Guide/Note Types/Text/1_Admonitions_image.png b/docs/User Guide/User Guide/Note Types/Text/1_Admonitions_image.png
new file mode 100644
index 0000000000..07876abbf2
Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/1_Admonitions_image.png differ
diff --git a/docs/User Guide/User Guide/Note Types/Text/Admonitions.md b/docs/User Guide/User Guide/Note Types/Text/Admonitions.md
new file mode 100644
index 0000000000..86328305cb
--- /dev/null
+++ b/docs/User Guide/User Guide/Note Types/Text/Admonitions.md
@@ -0,0 +1,63 @@
+# Admonitions
+![](1_Admonitions_image.png)
+
+Admonitions are a way to highlight information to the reader. Other names for it include _call-outs_ and _info/warning/alert boxes_.
+
+## Inserting a new admonition
+
+### From the UI
+
+In the Formatting toolbar:
+
+![](Admonitions_image.png)
+
+### Via the keyboard
+
+It's possible to insert an admonition simply by typing:
+
+* `!!! note`
+* `!!! tip`
+* `!!! important`
+* `!!! caution`
+* `!!! warning`
+
+In addition to that, it's also possible to type `!!!`  followed by any text, case in which a default admonition type will appear (note) with the entered text inside it.
+
+## Interaction
+
+By design, admonitions act very similar to block quotes.
+
+* Selecting a text and pressing the admonition button will turn that text into an admonition.
+* If selecting multiple admonitions, pressing the admonition button will automatically merge them into one.
+
+Inside an admonition:
+
+* Pressing <kbd>Backspace</kbd> while the admonition is empty will remove it.
+* Pressing <kbd>Enter</kbd> will start a new paragraph. Pressing it twice will exit out of the admonition.
+* Headings and other block content including tables can be inserted inside the admonition.
+
+## Types of admonitions
+
+There are currently five types of admonitions: _Note_, _Tip_, _Important_, _Caution_, _Warning_.
+
+These types were inspired by GitHub's support for this feature and there are currently no plans for adjusting it or allowing the user to customize them.
+
+## Markdown support
+
+The Markdown syntax for admonitions as supported by Trilium is the one that GitHub uses, which is as follows:
+
+```markdown
+> [!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`.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Note Types/Text/Admonitions_image.png b/docs/User Guide/User Guide/Note Types/Text/Admonitions_image.png
new file mode 100644
index 0000000000..9eb0846551
Binary files /dev/null and b/docs/User Guide/User Guide/Note Types/Text/Admonitions_image.png differ
diff --git a/src/public/app/doc_notes/en/User Guide/!!!meta.json b/src/public/app/doc_notes/en/User Guide/!!!meta.json
index 1a2e328c95..56ec7d553d 100644
--- a/src/public/app/doc_notes/en/User Guide/!!!meta.json
+++ b/src/public/app/doc_notes/en/User Guide/!!!meta.json
@@ -2681,7 +2681,7 @@
"title": "Note Types",
"notePosition": 100,
"prefix": null,
- "isExpanded": false,
+ "isExpanded": true,
"type": "text",
"mime": "text/html",
"attributes": [
@@ -2708,7 +2708,7 @@
"title": "Text",
"notePosition": 10,
"prefix": null,
- "isExpanded": false,
+ "isExpanded": true,
"type": "text",
"mime": "text/markdown",
"attributes": [
@@ -2798,6 +2798,51 @@
],
"dirFileName": "Text",
"children": [
+ {
+ "isClone": false,
+ "noteId": "NwBbFdNZ9h7O",
+ "notePath": [
+ "pOsGYCXsbNQG",
+ "KSZ04uQ2D1St",
+ "iPIMuisry3hd",
+ "NwBbFdNZ9h7O"
+ ],
+ "title": "Admonitions",
+ "notePosition": 10,
+ "prefix": null,
+ "isExpanded": false,
+ "type": "text",
+ "mime": "text/html",
+ "attributes": [
+ {
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bx-info-circle",
+ "isInheritable": false,
+ "position": 10
+ }
+ ],
+ "format": "html",
+ "dataFileName": "Admonitions.html",
+ "attachments": [
+ {
+ "attachmentId": "do36b54XpmIC",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "Admonitions_image.png"
+ },
+ {
+ "attachmentId": "hUwfwkRSDeLJ",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "1_Admonitions_image.png"
+ }
+ ]
+ },
{
"isClone": false,
"noteId": "QxEyIjRBizuC",
@@ -2808,7 +2853,7 @@
"QxEyIjRBizuC"
],
"title": "Code blocks",
- "notePosition": 10,
+ "notePosition": 20,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2889,7 +2934,7 @@
"veGu4faJErEM"
],
"title": "Content language & Right-to-left support",
- "notePosition": 20,
+ "notePosition": 30,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2926,7 +2971,7 @@
"UYuUB1ZekNQU"
],
"title": "Formatting",
- "notePosition": 30,
+ "notePosition": 40,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -2979,7 +3024,7 @@
"nRhnJkTT8cPs"
],
"title": "Formatting toolbar",
- "notePosition": 40,
+ "notePosition": 50,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -3054,7 +3099,7 @@
"mT0HEkOsz6i1"
],
"title": "Images",
- "notePosition": 50,
+ "notePosition": 60,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -3192,7 +3237,7 @@
"QEAPj01N5f7w"
],
"title": "Links",
- "notePosition": 60,
+ "notePosition": 70,
"prefix": null,
"isExpanded": false,
"type": "text",
@@ -3248,7 +3293,7 @@
"S6Xx8QIWTV66"
],
"title": "Lists",
- "notePosition": 70,
+ "notePosition": 80,
"prefix": null,
"isExpanded": false,
"type": "text",
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/1_Admonitions_image.png b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/1_Admonitions_image.png
new file mode 100644
index 0000000000..07876abbf2
Binary files /dev/null and b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/1_Admonitions_image.png differ
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/Admonitions.html b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/Admonitions.html
new file mode 100644
index 0000000000..5c79e1bf91
--- /dev/null
+++ b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/Admonitions.html
@@ -0,0 +1,90 @@
+<html>
+
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="../../../style.css">
+ <base target="_parent">
+ <title data-trilium-title>Admonitions</title>
+ </head>
+
+ <body>
+ <div class="content">
+ <h1 data-trilium-h1>Admonitions</h1>
+
+ <div class="ck-content">
+ <div>
+ <div>
+ <figure class="image">
+ <img style="aspect-ratio:959/547;" src="1_Admonitions_image.png" width="959"
+ height="547">
+ </figure>
+ <p>Admonitions are a way to highlight information to the reader. Other names
+ for it include <em>call-outs</em> and <em>info/warning/alert boxes</em>.</p>
+ <h2>Inserting a new admonition</h2>
+ <h3>From the UI</h3>
+ <p>In the Formatting toolbar:</p>
+ <p>
+ <img src="Admonitions_image.png" width="202" height="194">
+ </p>
+ <h3>Via the keyboard</h3>
+ <p>It's possible to insert an admonition simply by typing:</p>
+ <ul>
+ <li><code>!!! note</code>
+ </li>
+ <li><code>!!! tip</code>
+ </li>
+ <li><code>!!! important</code>
+ </li>
+ <li><code>!!! caution</code>
+ </li>
+ <li><code>!!! warning</code>
+ </li>
+ </ul>
+ <p>In addition to that, it's also possible to type <code>!!!&nbsp;</code> followed
+ by any text, case in which a default admonition type will appear (note)
+ with the entered text inside it.</p>
+ <h2>Interaction</h2>
+ <p>By design, admonitions act very similar to block quotes.</p>
+ <ul>
+ <li>Selecting a text and pressing the admonition button will turn that text
+ into an admonition.</li>
+ <li>If selecting multiple admonitions, pressing the admonition button will
+ automatically merge them into one.</li>
+ </ul>
+ <p>Inside an admonition:</p>
+ <ul>
+ <li>Pressing <kbd>Backspace</kbd> while the admonition is empty will remove
+ it.</li>
+ <li>Pressing <kbd>Enter</kbd> will start a new paragraph. Pressing it twice
+ will exit out of the admonition.</li>
+ <li>Headings and other block content including tables can be inserted inside
+ the admonition.</li>
+ </ul>
+ <h2>Types of admonitions</h2>
+ <p>There are currently five types of admonitions: <em>Note</em>, <em>Tip</em>, <em>Important</em>, <em>Caution</em>, <em>Warning</em>.</p>
+ <p>These types were inspired by GitHub's support for this feature and there
+ are currently no plans for adjusting it or allowing the user to customize
+ them.</p>
+ <h2>Markdown support</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-markdown">&gt; [!NOTE]
+&gt; This is a note.
+
+&gt; [!TIP]
+&gt; This is a tip.
+
+&gt; [!IMPORTANT]
+&gt; This is a very important information.
+
+&gt; [!CAUTION]
+&gt; This is a caution.</code></pre>
+ <p>There are currently no plans of supporting alternative admonition syntaxes
+ such as <code>!!! note</code>.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+
+</html>
\ No newline at end of file
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/Admonitions_image.png b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/Admonitions_image.png
new file mode 100644
index 0000000000..9eb0846551
Binary files /dev/null and b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Text/Admonitions_image.png differ
diff --git a/src/public/app/doc_notes/en/User Guide/navigation.html b/src/public/app/doc_notes/en/User Guide/navigation.html
index 451a94d8d1..8d77c08e92 100644
--- a/src/public/app/doc_notes/en/User Guide/navigation.html
+++ b/src/public/app/doc_notes/en/User Guide/navigation.html
@@ -172,6 +172,8 @@
<ul>
<li><a href="User%20Guide/Note%20Types/Text.html" target="detail">Text</a>
<ul>
+ <li><a href="User%20Guide/Note%20Types/Text/Admonitions.html" target="detail">Admonitions</a>
+ </li>
<li><a href="User%20Guide/Note%20Types/Text/Code%20blocks.html" target="detail">Code blocks</a>
</li>
<li><a href="User%20Guide/Note%20Types/Text/Content%20language%20%26%20Right-to-le.html"