From 664d28f1054b4e598aa7cd71b16f852ab63076a7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 22 Nov 2025 11:03:00 +0200 Subject: [PATCH] docs(scripting): remove workaround for sidebar visibility --- .../Notes/Printing & Exporting as PDF.html | 61 +++++++++---------- .../Custom Widgets/Right pane widget.html | 20 +++--- .../Developer Guide/Documentation.md | 2 +- docs/User Guide/!!!meta.json | 22 +++---- .../Custom Widgets/Right pane widget.md | 17 ++++-- 5 files changed, 65 insertions(+), 57 deletions(-) diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html index 2e3b2c92c..744d1d5e5 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.html @@ -4,6 +4,7 @@
Screenshot of the note contextual menu indicating the “Export as PDF” option.
+

Printing

This feature allows printing of notes. It works on both the desktop client, but also on the web.

@@ -59,9 +60,9 @@ class="admonition note"> orientation, size. However, there are a few Attributes to adjust some of the settings:

@@ -73,10 +74,9 @@ class="admonition note">

Since v0.100.0, it is possible to print more than one note at the time by using Collections:

    -
  1. First create a collection.
  2. -
  3. Configure it to use List View.
  4. -
  5. Print the collection note normally.
  6. +
  7. First create a collection.
  8. +
  9. Configure it to use List View.
  10. +
  11. Print the collection note normally.

The resulting collection will contain all the children of the collection, while maintaining the hierarchy.

@@ -86,9 +86,9 @@ class="admonition note"> href="#root/_help_4TIF1oA4VQRO">Options and assigning a key combination for:

Constraints & limitations

@@ -96,39 +96,39 @@ class="admonition note"> supported when printing, in which case the Print and Export as PDF options will be disabled.

@@ -139,10 +139,10 @@ class="admonition note"> printing.

To do so:

@@ -153,13 +153,12 @@ class="admonition note"> }

To remark:

Under the hood

Both printing and exporting as PDF use the same mechanism: a note is rendered diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.html index 27437786f..e4706e317 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.html @@ -1,12 +1,13 @@

const template = `<div>Hi</div>`;
 
@@ -23,12 +24,13 @@ class ToDoListWidget extends api.RightPanelWidget {
     }   
     
     async refreshWithNote(note) {
-        this.toggleInt(false);                
-        this.triggerCommand("reEvaluateRightPaneVisibility");
-        this.toggleInt(true);
-        this.triggerCommand("reEvaluateRightPaneVisibility");
+    	// Do something when the note changes.
     }
 }
 
 module.exports = new ToDoListWidget();
-

The implementation is in src/public/app/widgets/right_panel_widget.js.

\ No newline at end of file +

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");
\ No newline at end of file diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md index 6e7ea215f..f891e39c9 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: +There are multiple types of documentation for Trilium: * The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing F1. * 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 014f86614..9932db6be 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -4104,31 +4104,38 @@ { "type": "relation", "name": "internalLink", - "value": "AlhDUqhENtH7", + "value": "2FvYrpmOXm29", "isInheritable": false, "position": 100 }, { "type": "relation", "name": "internalLink", - "value": "bwZpz2ajCEwO", + "value": "AlhDUqhENtH7", "isInheritable": false, "position": 110 }, { "type": "relation", "name": "internalLink", - "value": "KC1HB96bqqHX", + "value": "bwZpz2ajCEwO", "isInheritable": false, "position": 120 }, { "type": "relation", "name": "internalLink", - "value": "0ESUbbAxVnoK", + "value": "KC1HB96bqqHX", "isInheritable": false, "position": 130 }, + { + "type": "relation", + "name": "internalLink", + "value": "0ESUbbAxVnoK", + "isInheritable": false, + "position": 140 + }, { "type": "label", "name": "iconClass", @@ -4142,13 +4149,6 @@ "value": "printing-and-pdf-export", "isInheritable": false, "position": 110 - }, - { - "type": "relation", - "name": "internalLink", - "value": "2FvYrpmOXm29", - "isInheritable": false, - "position": 140 } ], "format": "markdown", diff --git a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.md b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.md index 7a8cf8cd4..e64364fc8 100644 --- a/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.md +++ b/docs/User Guide/User Guide/Scripting/Frontend Basics/Custom Widgets/Right pane widget.md @@ -20,14 +20,21 @@ class ToDoListWidget extends api.RightPanelWidget { } async refreshWithNote(note) { - this.toggleInt(false); - this.triggerCommand("reEvaluateRightPaneVisibility"); - this.toggleInt(true); - this.triggerCommand("reEvaluateRightPaneVisibility"); + // Do something when the note changes. } } module.exports = new ToDoListWidget(); ``` -The implementation is in `src/public/app/widgets/right_panel_widget.js`. \ No newline at end of file +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"); +``` \ No newline at end of file