diff --git a/apps/client/src/services/link.ts b/apps/client/src/services/link.ts
index 9af93b3135..a596e71366 100644
--- a/apps/client/src/services/link.ts
+++ b/apps/client/src/services/link.ts
@@ -467,28 +467,30 @@ function getReferenceLinkTitleSync(href: string) {
}
}
-// TODO: Check why the event is not supported.
-//@ts-ignore
-$(document).on("click", "a", goToLink);
-// TODO: Check why the event is not supported.
-//@ts-ignore
-$(document).on("auxclick", "a", goToLink); // to handle the middle button
-// TODO: Check why the event is not supported.
-//@ts-ignore
-$(document).on("contextmenu", "a", linkContextMenu);
-// TODO: Check why the event is not supported.
-//@ts-ignore
-$(document).on("dblclick", "a", goToLink);
+if (glob.device !== "print") {
+ // TODO: Check why the event is not supported.
+ //@ts-ignore
+ $(document).on("click", "a", goToLink);
+ // TODO: Check why the event is not supported.
+ //@ts-ignore
+ $(document).on("auxclick", "a", goToLink); // to handle the middle button
+ // TODO: Check why the event is not supported.
+ //@ts-ignore
+ $(document).on("contextmenu", "a", linkContextMenu);
+ // TODO: Check why the event is not supported.
+ //@ts-ignore
+ $(document).on("dblclick", "a", goToLink);
-$(document).on("mousedown", "a", (e) => {
- if (e.which === 2) {
- // prevent paste on middle click
- // https://github.com/zadam/trilium/issues/2995
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event#preventing_default_actions
- e.preventDefault();
- return false;
- }
-});
+ $(document).on("mousedown", "a", (e) => {
+ if (e.which === 2) {
+ // prevent paste on middle click
+ // https://github.com/zadam/trilium/issues/2995
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event#preventing_default_actions
+ e.preventDefault();
+ return false;
+ }
+ });
+}
export default {
getNotePathFromUrl,
diff --git a/apps/client/src/widgets/collections/NoteList.tsx b/apps/client/src/widgets/collections/NoteList.tsx
index 1d5a968106..04c03b0e8a 100644
--- a/apps/client/src/widgets/collections/NoteList.tsx
+++ b/apps/client/src/widgets/collections/NoteList.tsx
@@ -13,6 +13,7 @@ import { subscribeToMessages, unsubscribeToMessage as unsubscribeFromMessage } f
import { WebSocketMessage } from "@triliumnext/commons";
import froca from "../../services/froca";
import PresentationView from "./presentation";
+import { ListPrintView } from "./legacy/ListPrintView";
interface NoteListProps {
note: FNote | null | undefined;
@@ -103,7 +104,11 @@ export function CustomNoteList({ note, viewType, isEnabled: shouldEnable, notePa
function getComponentByViewType(viewType: ViewTypeOptions, props: ViewModeProps This feature allows printing of notes. It works on both the desktop client,
but also on the web.{note.title}
+
+ {notesWithContent?.map(({ note: childNote, contentEl }) => (
+
+ ))}
+ Printing
#printLandscape.#printPageSize attribute,
with one of the following values: A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, Ledger.These options have no effect when used with the printing feature, since the user-defined settings are used instead.
+Since v0.100.0, it is possible to print more than one note at the time + by using Collections:
+The resulting collection will contain all the children of the collection, + while maintaining the hierarchy.
It's possible to trigger both printing and export as PDF from the keyboard by going to Keyboard shortcuts in Options and assigning a key combination for:
To do so:
~printCss relation to
+ ~printCss relation to
point to the newly created CSS code note.To remark:
~printCss relations.printCss doesn't have the right
+ ~printCss relations.printCss doesn't have the right
note type or mime type, it will be ignored.@media print { since
- the style-sheet is used only for printing.@media print { since
+ the style-sheet is used only for printing.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/Collections/List View.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/List View.html index f3e4926b46..64c09e0241 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/List View.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/List View.html @@ -12,9 +12,22 @@ as a single continuous document.
Since v0.100.0, list collections can be printed or exported to PDF.
+A printed list collection will print all the notes in the collection, + in the right order and preserving the full hierarchy.
+If exported to PDF within the desktop application, there is additional + functionality:
+doRender must not be overridden, instead doRenderBody() has
+ doRender must not be overridden, instead doRenderBody() has
to be overridden.
doRenderBody can optionally be async.doRenderBody can optionally be async.parentWidget() must be set to “rightPane”.widgetTitle() getter can optionally be overriden, otherwise
+ parentWidget() must be set to “rightPane”.widgetTitle() getter can optionally be overriden, otherwise
the widget will be displayed as “Untitled widget”.const template = `<div>Hi</div>`;
diff --git a/docs/Developer Guide/Developer Guide/Documentation.md b/docs/Developer Guide/Developer Guide/Documentation.md
index 93ee33d7a9..b8eca125b2 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 91af437e1d..7b77cb46aa 100644
--- a/docs/User Guide/!!!meta.json
+++ b/docs/User Guide/!!!meta.json
@@ -4135,6 +4135,13 @@
"value": "printing-and-pdf-export",
"isInheritable": false,
"position": 110
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "mULW0Q3VojwY",
+ "isInheritable": false,
+ "position": 130
}
],
"format": "markdown",
@@ -10478,6 +10485,13 @@
"value": "list",
"isInheritable": false,
"position": 30
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "NRnIZmSMc5sj",
+ "isInheritable": false,
+ "position": 40
}
],
"format": "markdown",
diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md
index 21fbe12e68..083ad6ec78 100644
--- a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md
+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Printing & Exporting as PDF.md
@@ -49,6 +49,16 @@ When exporting to PDF, there are no customizable settings such as page orientati
> [!NOTE]
> These options have no effect when used with the printing feature, since the user-defined settings are used instead.
+## Printing multiple notes
+
+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. Configure it to use List View.
+3. Print the collection note normally.
+
+The resulting collection will contain all the children of the collection, while maintaining the hierarchy.
+
## Keyboard shortcut
It's possible to trigger both printing and export as PDF from the keyboard by going to _Keyboard shortcuts_ in Options and assigning a key combination for:
@@ -64,8 +74,9 @@ Not all Note Types
* Line numbers are not printed.
* Syntax highlighting is enabled, however a default theme (Visual Studio) is enforced.
* For Collections:
- * Only Presentation is currently supported.
- * We plan to add support for all the collection types at some point.
+ * List View is supported, allowing to print multiple notes at once while preserving hierarchy (similar to a book).
+ * Presentation is also supported, where each slide/subnote is displayed.
+ * The rest of the collections are not supported, but we plan to add support for all the collection types at some point.
* Using Custom app-wide CSS for printing is not longer supported, due to a more stable but isolated mechanism.
* We plan to introduce a new mechanism specifically for a print CSS.
diff --git a/docs/User Guide/User Guide/Collections/List View.md b/docs/User Guide/User Guide/Collections/List View.md
index 76fd158205..86cb59806e 100644
--- a/docs/User Guide/User Guide/Collections/List View.md
+++ b/docs/User Guide/User Guide/Collections/List View.md
@@ -8,4 +8,15 @@ In the example above, the "Node.js" note on the left panel contains several chil
## Interaction
* Each note can be expanded or collapsed by clicking on the arrow to the left of the title.
-* In the Ribbon, in the _Collection_ tab there are options to expand and to collapse all notes easily.
\ No newline at end of file
+* In the Ribbon, in the _Collection_ tab there are options to expand and to collapse all notes easily.
+
+## Printing and exporting to PDF
+
+Since v0.100.0, list collections can be [printed or exported to PDF](../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md).
+
+A printed list collection will print all the notes in the collection, in the right order and preserving the full hierarchy.
+
+If exported to PDF within the desktop application, there is additional functionality:
+
+* The table of contents of the PDF will reflect the structure of the notes.
+* Reference and inline links to other notes within the same hierarchy will be functional (will jump to the corresponding page). If a link refers to a note that is not in the printed hierarchy, it will be unlinked.
\ No newline at end of file