mirror of
https://github.com/zadam/trilium.git
synced 2025-11-26 02:24:23 +01:00
docs(scripting): remove workaround for sidebar visibility
This commit is contained in:
parent
7daee36d3e
commit
664d28f105
@ -4,6 +4,7 @@
|
|||||||
<figcaption>Screenshot of the note contextual menu indicating the “Export as PDF”
|
<figcaption>Screenshot of the note contextual menu indicating the “Export as PDF”
|
||||||
option.</figcaption>
|
option.</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
||||||
<h2>Printing</h2>
|
<h2>Printing</h2>
|
||||||
<p>This feature allows printing of notes. It works on both the desktop client,
|
<p>This feature allows printing of notes. It works on both the desktop client,
|
||||||
but also on the web.</p>
|
but also on the web.</p>
|
||||||
@ -59,9 +60,9 @@ class="admonition note">
|
|||||||
orientation, size. However, there are a few <a class="reference-link"
|
orientation, size. However, there are a few <a class="reference-link"
|
||||||
href="#root/_help_zEY4DaJG4YT5">Attributes</a> to adjust some of the settings:</p>
|
href="#root/_help_zEY4DaJG4YT5">Attributes</a> to adjust some of the settings:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="e2c3a384e6b36708d7eab0be86e6b390f">To print in landscape mode instead of portrait (useful for big diagrams
|
<li>To print in landscape mode instead of portrait (useful for big diagrams
|
||||||
or slides), add <code>#printLandscape</code>.</li>
|
or slides), add <code>#printLandscape</code>.</li>
|
||||||
<li data-list-item-id="e697b50e94a0cf5748434ade36b74bd2a">By default, the resulting PDF will be in Letter format. It is possible
|
<li>By default, the resulting PDF will be in Letter format. It is possible
|
||||||
to adjust it to another page size via the <code>#printPageSize</code> attribute,
|
to adjust it to another page size via the <code>#printPageSize</code> attribute,
|
||||||
with one of the following values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.</li>
|
with one of the following values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -73,10 +74,9 @@ class="admonition note">
|
|||||||
<p>Since v0.100.0, it is possible to print more than one note at the time
|
<p>Since v0.100.0, it is possible to print more than one note at the time
|
||||||
by using <a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>:</p>
|
by using <a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li data-list-item-id="ea89c798776f96c4b224dffec2518a4ab">First create a collection.</li>
|
<li>First create a collection.</li>
|
||||||
<li data-list-item-id="efb4061e38e2b1ca6c9be16fd1c8a4c76">Configure it to use <a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>.</li>
|
<li>Configure it to use <a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>.</li>
|
||||||
<li
|
<li>Print the collection note normally.</li>
|
||||||
data-list-item-id="ecaad5f90dcbfd65da21689c54b063ff9">Print the collection note normally.</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
<p>The resulting collection will contain all the children of the collection,
|
<p>The resulting collection will contain all the children of the collection,
|
||||||
while maintaining the hierarchy.</p>
|
while maintaining the hierarchy.</p>
|
||||||
@ -86,9 +86,9 @@ class="admonition note">
|
|||||||
href="#root/_help_4TIF1oA4VQRO">Options</a> and assigning a key combination
|
href="#root/_help_4TIF1oA4VQRO">Options</a> and assigning a key combination
|
||||||
for:</p>
|
for:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="ck-list-marker-italic" data-list-item-id="e0ad1793aca0023d3a01e12bafb1809b7"><em>Print Active Note</em>
|
<li><em>Print Active Note</em>
|
||||||
</li>
|
</li>
|
||||||
<li class="ck-list-marker-italic" data-list-item-id="edf28e69abc7a3d73fdc5f7deec99521c"><em>Export Active Note as PDF</em>
|
<li><em>Export Active Note as PDF</em>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>Constraints & limitations</h2>
|
<h2>Constraints & limitations</h2>
|
||||||
@ -96,39 +96,39 @@ class="admonition note">
|
|||||||
supported when printing, in which case the <em>Print</em> and <em>Export as PDF</em> options
|
supported when printing, in which case the <em>Print</em> and <em>Export as PDF</em> options
|
||||||
will be disabled.</p>
|
will be disabled.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="eb24570f2dbcda191d4069b16b4aaf5bd">For <a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a> notes:
|
<li>For <a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a> notes:
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="e7bf313b83ebbf1b58063d146d50d40aa">Line numbers are not printed.</li>
|
<li>Line numbers are not printed.</li>
|
||||||
<li data-list-item-id="e7d63b2d4beb4adb1f3a7ad7b01613ddb">Syntax highlighting is enabled, however a default theme (Visual Studio)
|
<li>Syntax highlighting is enabled, however a default theme (Visual Studio)
|
||||||
is enforced.</li>
|
is enforced.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li data-list-item-id="e45945585853cb2a279892dc88074356a">For <a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>,
|
<li>For <a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>,
|
||||||
the following are supported:
|
the following are supported:
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="e879b581c17cf870f98b8f37ae819afc9"><a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>, allowing
|
<li><a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>, allowing
|
||||||
to print multiple notes at once while preserving hierarchy (similar to
|
to print multiple notes at once while preserving hierarchy (similar to
|
||||||
a book).</li>
|
a book).</li>
|
||||||
<li data-list-item-id="e93230bc1582a7cb07e5ae606dd505486"><a class="reference-link" href="#root/_help_zP3PMqaG71Ct">Presentation</a>,
|
<li><a class="reference-link" href="#root/_help_zP3PMqaG71Ct">Presentation</a>,
|
||||||
where each slide/sub-note is displayed.</li>
|
where each slide/sub-note is displayed.</li>
|
||||||
<li data-list-item-id="ea457b15c29b7dc8b9b1dfa22d6bbcb35"><a class="reference-link" href="#root/pOsGYCXsbNQG/GTwFsgaA0lCt/_help_2FvYrpmOXm29">Table</a>,
|
<li><a class="reference-link" href="#root/_help_2FvYrpmOXm29">Table</a>, where the
|
||||||
where the table is rendered in a print-friendly way.
|
table is rendered in a print-friendly way.
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="ed64b8fd7568613fde935f7d1a3cc88a2">Tables that are too complex (especially if they have multiple columns)
|
<li>Tables that are too complex (especially if they have multiple columns)
|
||||||
might not fit properly, however tables with a large number of rows are
|
might not fit properly, however tables with a large number of rows are
|
||||||
supported thanks to pagination. </li>
|
supported thanks to pagination.</li>
|
||||||
<li data-list-item-id="e48fe6df48b7d8b4dd8f71f16167c31f3">Consider printing in landscape mode, or using <code>#printLandscape</code> if
|
<li>Consider printing in landscape mode, or using <code>#printLandscape</code> if
|
||||||
exporting to PDF.</li>
|
exporting to PDF.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li data-list-item-id="ea6e788358ba1007f66e3bc29e1e49c12">The rest of the collections are not supported, but we plan to add support
|
<li>The rest of the collections are not supported, but we plan to add support
|
||||||
for all the collection types at some point.</li>
|
for all the collection types at some point.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li data-list-item-id="e95bd83615311f18f479a403939dbec58">Using <a class="reference-link" href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a> for
|
<li>Using <a class="reference-link" href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a> for
|
||||||
printing is not longer supported, due to a more stable but isolated mechanism.
|
printing is not longer supported, due to a more stable but isolated mechanism.
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="e9e2e9710e9155be07904a540cf0fb763">We plan to introduce a new mechanism specifically for a print CSS.</li>
|
<li>We plan to introduce a new mechanism specifically for a print CSS.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -139,10 +139,10 @@ class="admonition note">
|
|||||||
printing.</p>
|
printing.</p>
|
||||||
<p>To do so:</p>
|
<p>To do so:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="ec8d2d5ae1a26cee897f2b9d56ed7ea32">Create a CSS <a href="#root/_help_6f9hih2hXXZk">code note</a>.</li>
|
<li>Create a CSS <a href="#root/_help_6f9hih2hXXZk">code note</a>.</li>
|
||||||
<li data-list-item-id="ea03a880dca8e360a1a2ae108f64d5c68">On the note being printed, apply the <code>~printCss</code> relation to
|
<li>On the note being printed, apply the <code>~printCss</code> relation to
|
||||||
point to the newly created CSS code note.</li>
|
point to the newly created CSS code note.</li>
|
||||||
<li data-list-item-id="e9e8ec1b600ea8928a871010e349a2cb4">To apply the CSS to multiple notes, consider using <a href="#root/_help_bwZpz2ajCEwO">inheritable attributes</a> or
|
<li>To apply the CSS to multiple notes, consider using <a href="#root/_help_bwZpz2ajCEwO">inheritable attributes</a> or
|
||||||
<a
|
<a
|
||||||
class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>.</li>
|
class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -153,11 +153,10 @@ class="admonition note">
|
|||||||
}</code></pre>
|
}</code></pre>
|
||||||
<p>To remark:</p>
|
<p>To remark:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li data-list-item-id="e0d7b17407d4a25fe03ab4a76aea5f9c1">Multiple CSS notes can be add by using multiple <code>~printCss</code> relations.</li>
|
<li>Multiple CSS notes can be add by using multiple <code>~printCss</code> relations.</li>
|
||||||
<li
|
<li>If the note pointing to the <code>printCss</code> doesn't have the right
|
||||||
data-list-item-id="e5989879c4432018bf90fecc5e31e090b">If the note pointing to the <code>printCss</code> doesn't have the right
|
|
||||||
note type or mime type, it will be ignored.</li>
|
note type or mime type, it will be ignored.</li>
|
||||||
<li data-list-item-id="e5536508d3645ba81244d16e75aca8c86">If migrating from a previous version where <a class="reference-link"
|
<li>If migrating from a previous version where <a class="reference-link"
|
||||||
href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>, there's no need for <code>@media print {</code> since
|
href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>, there's no need for <code>@media print {</code> since
|
||||||
the style-sheet is used only for printing.</li>
|
the style-sheet is used only for printing.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><code>doRender</code> must not be overridden, instead <code>doRenderBody()</code> has
|
<li data-list-item-id="ea7daf7caa74a0f97f6f17625eacc6125"><code>doRender</code> must not be overridden, instead <code>doRenderBody()</code> has
|
||||||
to be overridden.
|
to be overridden.
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>doRenderBody</code> can optionally be <code>async</code>.</li>
|
<li data-list-item-id="ef0f078ef265c54da5ff012f12cf7adee"><code>doRenderBody</code> can optionally be <code>async</code>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><code>parentWidget()</code> must be set to <code>“rightPane”</code>.</li>
|
<li data-list-item-id="e8b97337d5d8d708f5555b6f78fc1a993"><code>parentWidget()</code> must be set to <code>“rightPane”</code>.</li>
|
||||||
<li><code>widgetTitle()</code> getter can optionally be overriden, otherwise
|
<li
|
||||||
|
data-list-item-id="eccb7323be12f3facd371512a19582705"><code>widgetTitle()</code> getter can optionally be overriden, otherwise
|
||||||
the widget will be displayed as “Untitled widget”.</li>
|
the widget will be displayed as “Untitled widget”.</li>
|
||||||
</ul><pre><code class="language-text-x-trilium-auto">const template = `<div>Hi</div>`;
|
</ul><pre><code class="language-text-x-trilium-auto">const template = `<div>Hi</div>`;
|
||||||
|
|
||||||
@ -23,12 +24,13 @@ class ToDoListWidget extends api.RightPanelWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async refreshWithNote(note) {
|
async refreshWithNote(note) {
|
||||||
this.toggleInt(false);
|
// Do something when the note changes.
|
||||||
this.triggerCommand("reEvaluateRightPaneVisibility");
|
|
||||||
this.toggleInt(true);
|
|
||||||
this.triggerCommand("reEvaluateRightPaneVisibility");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = new ToDoListWidget();</code></pre>
|
module.exports = new ToDoListWidget();</code></pre>
|
||||||
<p>The implementation is in <code>src/public/app/widgets/right_panel_widget.js</code>.</p>
|
<p>The implementation is in <code>src/public/app/widgets/right_panel_widget.js</code>.</p>
|
||||||
|
<h2>Conditionally changing visibility</h2>
|
||||||
|
<p>In <code>refreshWithNote</code>:</p><pre><code class="language-text-x-trilium-auto">const visible = true; // replace with your own visibility logic
|
||||||
|
this.toggleInt(visible);
|
||||||
|
this.triggerCommand("reEvaluateRightPaneVisibility");</code></pre>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
# Documentation
|
# Documentation
|
||||||
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/8e2EXlB1gooL/Documentation_image.png" width="205" height="162">
|
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/gKWerx46R13O/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 _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.
|
* The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers.
|
||||||
|
|||||||
22
docs/User Guide/!!!meta.json
vendored
22
docs/User Guide/!!!meta.json
vendored
@ -4104,31 +4104,38 @@
|
|||||||
{
|
{
|
||||||
"type": "relation",
|
"type": "relation",
|
||||||
"name": "internalLink",
|
"name": "internalLink",
|
||||||
"value": "AlhDUqhENtH7",
|
"value": "2FvYrpmOXm29",
|
||||||
"isInheritable": false,
|
"isInheritable": false,
|
||||||
"position": 100
|
"position": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "relation",
|
"type": "relation",
|
||||||
"name": "internalLink",
|
"name": "internalLink",
|
||||||
"value": "bwZpz2ajCEwO",
|
"value": "AlhDUqhENtH7",
|
||||||
"isInheritable": false,
|
"isInheritable": false,
|
||||||
"position": 110
|
"position": 110
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "relation",
|
"type": "relation",
|
||||||
"name": "internalLink",
|
"name": "internalLink",
|
||||||
"value": "KC1HB96bqqHX",
|
"value": "bwZpz2ajCEwO",
|
||||||
"isInheritable": false,
|
"isInheritable": false,
|
||||||
"position": 120
|
"position": 120
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "relation",
|
"type": "relation",
|
||||||
"name": "internalLink",
|
"name": "internalLink",
|
||||||
"value": "0ESUbbAxVnoK",
|
"value": "KC1HB96bqqHX",
|
||||||
"isInheritable": false,
|
"isInheritable": false,
|
||||||
"position": 130
|
"position": 130
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "relation",
|
||||||
|
"name": "internalLink",
|
||||||
|
"value": "0ESUbbAxVnoK",
|
||||||
|
"isInheritable": false,
|
||||||
|
"position": 140
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "label",
|
"type": "label",
|
||||||
"name": "iconClass",
|
"name": "iconClass",
|
||||||
@ -4142,13 +4149,6 @@
|
|||||||
"value": "printing-and-pdf-export",
|
"value": "printing-and-pdf-export",
|
||||||
"isInheritable": false,
|
"isInheritable": false,
|
||||||
"position": 110
|
"position": 110
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "relation",
|
|
||||||
"name": "internalLink",
|
|
||||||
"value": "2FvYrpmOXm29",
|
|
||||||
"isInheritable": false,
|
|
||||||
"position": 140
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"format": "markdown",
|
"format": "markdown",
|
||||||
|
|||||||
@ -20,10 +20,7 @@ class ToDoListWidget extends api.RightPanelWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async refreshWithNote(note) {
|
async refreshWithNote(note) {
|
||||||
this.toggleInt(false);
|
// Do something when the note changes.
|
||||||
this.triggerCommand("reEvaluateRightPaneVisibility");
|
|
||||||
this.toggleInt(true);
|
|
||||||
this.triggerCommand("reEvaluateRightPaneVisibility");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,3 +28,13 @@ module.exports = new ToDoListWidget();
|
|||||||
```
|
```
|
||||||
|
|
||||||
The implementation is in `src/public/app/widgets/right_panel_widget.js`.
|
The implementation is in `src/public/app/widgets/right_panel_widget.js`.
|
||||||
|
|
||||||
|
## Conditionally changing visibility
|
||||||
|
|
||||||
|
In `refreshWithNote`:
|
||||||
|
|
||||||
|
```
|
||||||
|
const visible = true; // replace with your own visibility logic
|
||||||
|
this.toggleInt(visible);
|
||||||
|
this.triggerCommand("reEvaluateRightPaneVisibility");
|
||||||
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user