docs(user): add documentation on code & print improvements

This commit is contained in:
Elian Doran
2026-04-18 21:35:29 +03:00
parent 9d60bb804d
commit 8d41ba85a8
27 changed files with 491 additions and 308 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
<figure class="image image-style-align-center">
<img style="aspect-ratio:991/403;" src="1_Jump to_image.png"
<img style="aspect-ratio:991/403;" src="1_Jump to & command palette_.png"
width="991" height="403">
</figure>
<h2>Jump to Note</h2>
@@ -10,7 +10,7 @@
<ul>
<li>In the&nbsp;<a class="reference-link" href="#root/_help_xYmIYSP6wE3F">Launch Bar</a>,
press
<img src="2_Jump to_image.png">button.</li>
<img src="2_Jump to & command palette_.png">button.</li>
<li>Using the keyboard, press <kbd>Ctrl</kbd> + <kbd>J</kbd>.</li>
</ul>
<p>In addition to searching for notes, it is also possible to search for
@@ -33,7 +33,7 @@
<p>Alternatively you can click on the "time" icon on the right.</p>
<h2>Command Palette</h2>
<figure class="image image-style-align-center">
<img style="aspect-ratio:982/524;" src="Jump to_image.png"
<img style="aspect-ratio:982/524;" src="Jump to & command palette_.png"
width="982" height="524">
</figure>
<p>The command palette is a feature which allows easy execution of various
@@ -52,7 +52,8 @@
<ul>
<li>Type a few words to filter between commands.</li>
<li>Use the up and down arrows on the keyboard or the mouse to select a command.</li>
<li>Press <kbd>Enter</kbd> to execute the command.</li>
<li
>Press <kbd>Enter</kbd> to execute the command.</li>
</ul>
<p>To exit the command palette:</p>
<ul>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

After

Width:  |  Height:  |  Size: 243 KiB

View File

@@ -6,13 +6,13 @@
of notes at regular intervals.</p>
<h2>Displaying the revisions</h2>
<ul>
<li>On the&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_IjZS7iK5EXtb">New Layout</a>,
press the <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_8YBEPzcpUgxw">note context menu</a> and
select <em>Note revisions…</em>
<li>On the&nbsp;<a class="reference-link" href="#root/_help_IjZS7iK5EXtb">New Layout</a>,
press the <a href="#root/_help_8YBEPzcpUgxw">note context menu</a> and select <em>Note revisions…</em>
</li>
<li>On the old layout, press directly the
<img class="image_resized" style="aspect-ratio:27/25;width:2.32%;"
src="1_Note Revisions_image.png" width="27" height="25">button in the&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_8YBEPzcpUgxw">Note buttons</a>&nbsp;area.</li>
src="1_Note Revisions_image.png" width="27"
height="25">button in the&nbsp;<a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note buttons</a>&nbsp;area.</li>
</ul>
<h2>Interaction</h2>
<aside class="admonition note">
@@ -24,10 +24,9 @@
order.
<ul>
<li>The revisions are grouped by the date the revision was taken.</li>
<li
>This list does not contain the <em>current state</em> of the note, so it
<li>This list does not contain the <em>current state</em> of the note, so it
is possible to have notes with no revisions/snapshots saved.</li>
</ul>
</ul>
</li>
<li>The icon of a revision indicates the <em>source</em> of that revision (e.g.
a
@@ -72,14 +71,13 @@
</ul>
<p>To create a named revision, either:</p>
<ul>
<li>Go to the&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_8YBEPzcpUgxw">Note buttons</a>,
<li>Go to the&nbsp;<a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note buttons</a>,
select <em>Save named revision…</em>, enter the name of revision and confirm.</li>
<li
>Use the corresponding <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/_help_A9Oc6YKKc65v">keyboard shortcut</a> or
the&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/wArbEsdSae6g/_help_F1r9QtzQLZqm">Jump to...</a>&nbsp;command
<li>Use the corresponding <a href="#root/_help_A9Oc6YKKc65v">keyboard shortcut</a> or
the&nbsp;<a class="reference-link" href="#root/_help_F1r9QtzQLZqm">Jump to...</a>&nbsp;command
with the same name.</li>
<li>Save a revision normally, and adjust the name afterwards from the note
revision list.</li>
<li>Save a revision normally, and adjust the name afterwards from the note
revision list.</li>
</ul>
<h2>When revisions are saved</h2>
<p>Revisions are saved:</p>
@@ -88,25 +86,22 @@
below).</li>
<li>Manually, by:
<ul>
<li>Going to the press the <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_8YBEPzcpUgxw">note context menu</a> and
<li>Going to the press the <a href="#root/_help_8YBEPzcpUgxw">note context menu</a> and
select <em>Save revision.</em>
</li>
<li>Using the <em>Force Save Revision</em> <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/_help_A9Oc6YKKc65v">keyboard shortcut</a>.</li>
<li
>In the <em>Revisions</em> dialog, pressing the […] button in the top-right
<li>Using the <em>Force Save Revision</em> <a href="#root/_help_A9Oc6YKKc65v">keyboard shortcut</a>.</li>
<li>In the <em>Revisions</em> dialog, pressing the […] button in the top-right
and selecting <em>Save a revision now</em>.</li>
</ul>
</ul>
</li>
</ul>
<p>Additionally, revisions can also come from somewhere else, and this is
indicated via the icon of the revision:</p>
<ul>
<li>Generated externally, by&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_help_pgxEVkzLl1OP">ETAPI (REST API)</a>.</li>
<li
>A modification created by&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/_help_GBBMSlVSOIGP">AI</a>.</li>
<li
>A revision is restored, causing the existing note content to be saved
as a revision to prevent potential data loss.</li>
<li>Generated externally, by&nbsp;<a class="reference-link" href="#root/_help_pgxEVkzLl1OP">ETAPI (REST API)</a>.</li>
<li>A modification created by&nbsp;<a class="reference-link" href="#root/_help_GBBMSlVSOIGP">AI</a>.</li>
<li>A revision is restored, causing the existing note content to be saved
as a revision to prevent potential data loss.</li>
</ul>
<h4>Snapshot interval</h4>
<p>Time interval of taking note snapshot is configurable in the Options -&gt;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 150 B

View File

@@ -1,199 +1,244 @@
<figure class="image">
<img style="aspect-ratio:951/432;" src="Printing & Exporting as PD.png"
width="951" height="432">
<figcaption>Screenshot of the note contextual menu indicating the “Export as PDF”
option.</figcaption>
<img style="aspect-ratio:2023/1488;" src="1_Printing & Exporting as PD.png"
width="2023" height="1488">
<figcaption>Screenshot of the Print preview functionality introduced in v0.103.0.</figcaption>
</figure>
<h2>Printing</h2>
<p>This feature allows printing of notes. It works on both the desktop client,
but also on the web.</p>
<p>Trilium allows printing notes to a real printer, or generating a structured
PDF for a single note or for multiple notes through&nbsp;<a class="reference-link"
href="#root/pOsGYCXsbNQG/_help_GTwFsgaA0lCt">Collections</a>.</p>
<p>Note that not all note types are printable as of now. We do plan to increase
the coverage of supported note types in the future.</p>
<p>Printing and exporting as PDF are not perfect. Due to technical limitations,
and sometimes even browser or Electron glitches the text might appear cut
off in some circumstances.&nbsp;</p>
<h2>Printing a note or exporting as PDF on the desktop</h2>
<aside class="admonition note">
<p>Versions prior to v0.103.0 had two different options, one for printing
and another one for exporting to PDF. With the introduction of the print
preview, these functions have been unified.</p>
</aside>
<p>On the desktop application of Trilium it is possible to export a note
as PDF. To print a note:</p>
<ul>
<li>Press the menu button in the&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_8YBEPzcpUgxw">Note buttons</a>&nbsp;area
and select <em>Print note</em>.</li>
<li>Alternatively, printing can be triggered from a <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/_help_A9Oc6YKKc65v">keyboard shortcut</a> (unassigned
by default) or through the <a href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/wArbEsdSae6g/_help_F1r9QtzQLZqm">command palette</a>.</li>
</ul>
<p>This will trigger the print preview screen next.</p>
<h3>Print preview &amp; print options</h3>
<p>The print preview dialog allows the following printing options to be adjusted:</p>
<ul>
<li>
<p>The printer to use</p>
<ul>
<li>
<p><em>Save as PDF</em> generates a PDF that is structured (maintains a table
of contents, keeps the text selectable). Prefer this over other virtual
PDF printers that ship with the operating system.</p>
</li>
</ul>
</li>
<li>
<p>Page orientation: <em>Portrait</em> (default) or <em>Landscape</em>.</p>
</li>
<li>
<p>Page size</p>
</li>
<li>
<p>Scale the entire content from 10% to 200% to improve the fit within the
page.</p>
</li>
<li>
<p>Margins, which can be removed completely or adjusted individually for
all the four edges.</p>
</li>
<li>
<p>Print only a subset of pages. Individual page numbers are separated by
colons and hyphen-based ranges are supported (e.g. 3-5 for pages 3 to 5).</p>
</li>
</ul>
<p>Additional interaction:</p>
<ul>
<li><em>Print using system dialog</em> allows setting more options that are
otherwise not available in Trilium.</li>
</ul>
<aside class="admonition note">
<p>Most of the options here (expect printer &amp; which pages to print) are
managed at note level through&nbsp;<a class="reference-link" href="#root/_help_zEY4DaJG4YT5">Attributes</a>&nbsp;(such
as <code spellcheck="false">#printLandscape</code>, <code spellcheck="false">#printPageSize</code>,
<code
spellcheck="false">#printScale</code>, <code spellcheck="false">#printMargins</code>).</p>
<p>This means that the print settings will be restored when printing the
same note. There are no default settings that can be configured for all
the notes, but this can be achieved via <a href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_bwZpz2ajCEwO">inheritable attributes</a>.</p>
</aside>
<h2>Printing on the browser</h2>
<p>This feature allows printing of notes. It works on both the desktop client,
but also on the web.</p>
<p>To print a note, select the
<img src="1_Printing & Exporting as PD.png"
<img src="Printing & Exporting as PD.png"
width="29" height="31">button to the right of the note and select <em>Print note</em>. Depending
on the size and type of the note, this can take up to a few seconds. Afterwards
you will be redirected to the system/browser printing dialog.</p>
<aside
class="admonition note">
<p>Printing and exporting as PDF are not perfect. Due to technical limitations,
and sometimes even browser glitches the text might appear cut off in some
circumstances.&nbsp;</p>
</aside>
<h2>Reporting issues with the rendering</h2>
<p>Should you encounter any visual issues in the resulting PDF file (e.g.
a table does not fit properly, there is cut off text, etc.) feel free to
<p>On the server or PWA (mobile), the option is not available due to technical
constraints and it will be hidden.</p>
<h2>Reporting issues with the rendering</h2>
<p>Should you encounter any visual issues in the resulting PDF file (e.g.
a table does not fit properly, there is cut off text, etc.) feel free to
<a
href="#root/_help_wy8So3yZZlH9">report the issue</a>. In this case, it's best to offer a sample note (click
on the
<img src="Printing & Exporting as PD.png"
width="29" height="31">button, select Export note → This note and all of its descendants → HTML
in ZIP archive). Make sure not to accidentally leak any personal information.</p>
<p>Consider adjusting font sizes and using <a href="#root/_help_CohkqWQC1iBv">page breaks</a> to
work around the layout.</p>
<aside class="admonition tip">
<p>Although direct export as PDF is not available in the browser version
of the application, it's still possible to generate a PDF by selecting
the <em>Print</em> option instead and selecting “Save to PDF” as the printer
(depending on the browser). Generally, Mozilla Firefox has better printing
capabilities.</p>
</aside>
<h3>Automatic opening of the file</h3>
<p>When the PDF is exported, it is automatically opened with the system default
application for easy preview.</p>
<p>Note that if you are using Linux with the GNOME desktop environment, sometimes
the default application might seem incorrect (such as opening in GIMP).
This is because it uses Gnome's “Recommended applications” list.</p>
<p>To solve this, you can change the recommended application for PDFs via
this command line. First, list the available applications via <code spellcheck="false">gio mime application/pdf</code> and
then set the desired one. For example to use GNOME's Evince:</p><pre><code class="language-text-x-trilium-auto">gio mime application/pdf</code></pre>
<h2>Printing multiple notes</h2>
<p>Since v0.100.0, it is possible to print more than one note at the time
by using&nbsp;<a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>:</p>
<ol>
<li>First create a collection.</li>
<li>Configure it to use&nbsp;<a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>.</li>
<li
>Print the collection note normally.</li>
</ol>
<p>The resulting collection will contain all the children of the collection,
while maintaining the hierarchy.</p>
<aside class="admonition note">
<p>Not all note types are supported when printing or exporting to PDF. When
an unsupported note is encountered, it is skipped. At the end, if any of
the notes were skipped, a message will be displayed with the possibility
of viewing the full list of skipped notes. The same limitations as the
ones described in <em>Constraints &amp; limitations</em> apply.</p>
</aside>
<h2>Keyboard shortcut</h2>
<p>It's possible to trigger both printing and export as PDF from the keyboard
by going to&nbsp;<em>Keyboard shortcuts</em>&nbsp;in&nbsp;<a class="reference-link"
href="#root/_help_4TIF1oA4VQRO">Options</a>&nbsp;and assigning a key combination
for:</p>
<ul>
<li class="ck-list-marker-italic"><em>Print Active Note</em>
</li>
<li class="ck-list-marker-italic"><em>Export Active Note as PDF</em>
</li>
</ul>
<h2>Constraints &amp; limitations</h2>
<p>Not all&nbsp;<a class="reference-link" href="#root/_help_KSZ04uQ2D1St">Note Types</a>&nbsp;are
supported when printing, in which case the <em>Print</em> and <em>Export as PDF</em> options
will be disabled.</p>
<ul>
<li>For&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes:
<ul>
<li>Line numbers are not printed.</li>
<li>Syntax highlighting is enabled, however a default theme (Visual Studio)
is enforced.</li>
</ul>
</li>
<li>For&nbsp;<a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>,
the following are supported:
<ul>
<li><a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>, allowing
to print multiple notes at once while preserving hierarchy (similar to
a book).</li>
<li><a class="reference-link" href="#root/_help_zP3PMqaG71Ct">Presentation</a>,
where each slide/sub-note is displayed.
<ul>
<li>Most note types are supported, especially the ones that have an image
representation such as&nbsp;<a class="reference-link" href="#root/_help_grjYqerjn243">Canvas</a>&nbsp;and&nbsp;
<a
class="reference-link" href="#root/_help_gBbsAeiuUxI5">Mind Map</a>.</li>
</ul>
</li>
<li><a class="reference-link" href="#root/_help_2FvYrpmOXm29">Table</a>, where the
table is rendered in a print-friendly way.
<ul>
<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
supported thanks to pagination.</li>
<li>Consider printing in landscape mode, or using <code spellcheck="false">#printLandscape</code> if
exporting to PDF.</li>
</ul>
</li>
<li>The rest of the collections are not supported, but we plan to add support
for all the collection types at some point.</li>
</ul>
</li>
<li>Using&nbsp;<a class="reference-link" href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;for
printing is no longer supported, instead a custom <code spellcheck="false">printCss</code> relation
needs to be used (see below).</li>
</ul>
<h2>Customizing the print CSS</h2>
<p>As an advanced use case, it's possible to customize the CSS used for printing
such as adjusting the fonts, sizes or margins. Note that&nbsp;<a class="reference-link"
href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;will not work for
printing.</p>
<p>To do so:</p>
<ul>
<li>Create a CSS <a href="#root/_help_6f9hih2hXXZk">code note</a>.</li>
<li>On the note being printed, apply the <code spellcheck="false">~printCss</code> relation
to point to the newly created CSS code note.</li>
<li>To apply the CSS to multiple notes, consider using <a href="#root/_help_bwZpz2ajCEwO">inheritable attributes</a> or&nbsp;
<a
href="#root/_help_wy8So3yZZlH9">report the issue</a>. In this case, it's best to offer a sample note (click
on the
<img src="1_Printing & Exporting as PD.png"
width="29" height="31">button, select Export note → This note and all of its descendants → HTML
in ZIP archive). Make sure not to accidentally leak any personal information.</p>
<p>Consider adjusting font sizes and using <a href="#root/_help_CohkqWQC1iBv">page breaks</a> to
work around the layout.</p>
<h2>Exporting as PDF</h2>
<p>On the desktop application of Trilium it is possible to export a note
as PDF. On the server or PWA (mobile), the option is not available due
to technical constraints and it will be hidden.</p>
<p>To print a note, select the
<img src="1_Printing & Exporting as PD.png">button to the right of the note and select <em>Export as PDF</em>. Afterwards
you will be prompted to select where to save the PDF file.</p>
<aside class="admonition tip">
<p>Although direct export as PDF is not available in the browser version
of the application, it's still possible to generate a PDF by selecting
the <em>Print</em> option instead and selecting “Save to PDF” as the printer
(depending on the browser). Generally, Mozilla Firefox has better printing
capabilities.</p>
</aside>
<h3>Automatic opening of the file</h3>
<p>When the PDF is exported, it is automatically opened with the system default
application for easy preview.</p>
<p>Note that if you are using Linux with the GNOME desktop environment, sometimes
the default application might seem incorrect (such as opening in GIMP).
This is because it uses Gnome's “Recommended applications” list.</p>
<p>To solve this, you can change the recommended application for PDFs via
this command line. First, list the available applications via <code spellcheck="false">gio mime application/pdf</code> and
then set the desired one. For example to use GNOME's Evince:</p><pre><code class="language-text-x-trilium-auto">gio mime application/pdf</code></pre>
<h3>Customizing exporting as PDF</h3>
<p>When exporting to PDF, there are no customizable settings such as page
orientation, size. However, there are a few&nbsp;<a class="reference-link"
href="#root/_help_zEY4DaJG4YT5">Attributes</a>&nbsp;to adjust some of the settings:</p>
<ul>
<li>To print in landscape mode instead of portrait (useful for big diagrams
or slides), add <code spellcheck="false">#printLandscape</code>.</li>
<li>By default, the resulting PDF will be in Letter format. It is possible
to adjust it to another page size via the <code spellcheck="false">#printPageSize</code> attribute,
with one of the following values: <code spellcheck="false">A0</code>,
<code
spellcheck="false">A1</code>, <code spellcheck="false">A2</code>, <code spellcheck="false">A3</code>,
<code
spellcheck="false">A4</code>, <code spellcheck="false">A5</code>, <code spellcheck="false">A6</code>,
<code
spellcheck="false">Legal</code>, <code spellcheck="false">Letter</code>, <code spellcheck="false">Tabloid</code>,
<code
spellcheck="false">Ledger</code>.</li>
</ul>
<aside class="admonition note">
<p>These options have no effect when used with the printing feature, since
the user-defined settings are used instead.</p>
</aside>
<h2>Printing multiple notes</h2>
<p>Since v0.100.0, it is possible to print more than one note at the time
by using&nbsp;<a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>:</p>
<ol>
<li>First create a collection.</li>
<li>Configure it to use&nbsp;<a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>.</li>
<li>Print the collection note normally.</li>
</ol>
<p>The resulting collection will contain all the children of the collection,
while maintaining the hierarchy.</p>
<aside class="admonition note">
<p>Not all note types are supported when printing or exporting to PDF. When
an unsupported note is encountered, it is skipped. At the end, if any of
the notes were skipped, a message will be displayed with the possibility
of viewing the full list of skipped notes. The same limitations as the
ones described in <em>Constraints &amp; limitations</em> apply.</p>
</aside>
<h2>Keyboard shortcut</h2>
<p>It's possible to trigger both printing and export as PDF from the keyboard
by going to&nbsp;<em>Keyboard shortcuts</em>&nbsp;in&nbsp;<a class="reference-link"
href="#root/_help_4TIF1oA4VQRO">Options</a>&nbsp;and assigning a key combination
for:</p>
<ul>
<li><em>Print Active Note</em>
</li>
<li><em>Export Active Note as PDF</em>
</li>
</ul>
<h2>Constraints &amp; limitations</h2>
<p>Not all&nbsp;<a class="reference-link" href="#root/_help_KSZ04uQ2D1St">Note Types</a>&nbsp;are
supported when printing, in which case the <em>Print</em> and <em>Export as PDF</em> options
will be disabled.</p>
<ul>
<li>For&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes:
<ul>
<li>Line numbers are not printed.</li>
<li>Syntax highlighting is enabled, however a default theme (Visual Studio)
is enforced.</li>
</ul>
</li>
<li>For&nbsp;<a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>,
the following are supported:
<ul>
<li><a class="reference-link" href="#root/_help_mULW0Q3VojwY">List View</a>, allowing
to print multiple notes at once while preserving hierarchy (similar to
a book).</li>
<li><a class="reference-link" href="#root/_help_zP3PMqaG71Ct">Presentation</a>,
where each slide/sub-note is displayed.
<ul>
<li>Most note types are supported, especially the ones that have an image
representation such as&nbsp;<a class="reference-link" href="#root/_help_grjYqerjn243">Canvas</a>&nbsp;and&nbsp;
<a
class="reference-link" href="#root/_help_gBbsAeiuUxI5">Mind Map</a>.</li>
</ul>
</li>
<li><a class="reference-link" href="#root/_help_2FvYrpmOXm29">Table</a>, where the
table is rendered in a print-friendly way.
<ul>
<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
supported thanks to pagination.</li>
<li>Consider printing in landscape mode, or using <code spellcheck="false">#printLandscape</code> if
exporting to PDF.</li>
</ul>
</li>
<li>The rest of the collections are not supported, but we plan to add support
for all the collection types at some point.</li>
</ul>
</li>
<li>Using&nbsp;<a class="reference-link" href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;for
printing is no longer supported, instead a custom <code spellcheck="false">printCss</code> relation
needs to be used (see below).</li>
</ul>
<h2>Customizing the print CSS</h2>
<p>As an advanced use case, it's possible to customize the CSS used for printing
such as adjusting the fonts, sizes or margins. Note that&nbsp;<a class="reference-link"
href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;will not work for
printing.</p>
<p>To do so:</p>
<ul>
<li>Create a CSS <a href="#root/_help_6f9hih2hXXZk">code note</a>.</li>
<li>On the note being printed, apply the <code spellcheck="false">~printCss</code> relation
to point to the newly created CSS code note.</li>
<li>To apply the CSS to multiple notes, consider using <a href="#root/_help_bwZpz2ajCEwO">inheritable attributes</a> or&nbsp;
<a
class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>.</li>
</ul>
<p>For example, to change the font of the document from the one defined by
the theme or the user to a serif one:</p><pre><code class="language-text-x-trilium-auto">body{
class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>.</li>
</ul>
<p>For example, to change the font of the document from the one defined by
the theme or the user to a serif one:</p><pre><code class="language-text-x-trilium-auto">body{
--print-font-family: serif;
--print-font-size: 11pt;
}</code></pre>
<aside class="admonition important">
<p>When altering <code spellcheck="false">--print-font-family</code>, make
sure the change is done at <code spellcheck="false">body</code> level and
not <code spellcheck="false">:root</code>, since otherwise it won't be picked
up due to specificity rules.</p>
</aside>
<p>To remark:</p>
<ul>
<li>Multiple CSS notes can be add by using multiple <code spellcheck="false">~printCss</code> relations.</li>
<li>If the note pointing to the <code spellcheck="false">printCss</code> doesn't
have the right note type or mime type, it will be ignored.</li>
<aside class="admonition important">
<p>When altering <code spellcheck="false">--print-font-family</code>, make
sure the change is done at <code spellcheck="false">body</code> level and
not <code spellcheck="false">:root</code>, since otherwise it won't be picked
up due to specificity rules.</p>
</aside>
<p>To remark:</p>
<ul>
<li>Multiple CSS notes can be add by using multiple <code spellcheck="false">~printCss</code> relations.</li>
<li
>If the note pointing to the <code spellcheck="false">printCss</code> doesn't
have the right note type or mime type, it will be ignored.</li>
<li>If migrating from a previous version where&nbsp;<a class="reference-link"
href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>, there's no need for
<code
spellcheck="false">@media print {</code>since the style-sheet is used only for printing.</li>
</ul>
<h2>Under the hood</h2>
<p>Both printing and exporting as PDF use the same mechanism: a note is rendered
individually in a separate webpage that is then sent to the browser or
the Electron application either for printing or exporting as PDF.</p>
<p>The webpage that renders a single note can actually be accessed in a web
browser. For example <code spellcheck="false">http://localhost:8080/#root/WWRGzqHUfRln/RRZsE9Al8AIZ?ntxId=0o4fzk</code> becomes
<code
spellcheck="false">http://localhost:8080/?print#root/WWRGzqHUfRln/RRZsE9Al8AIZ</code>.</p>
<p>Accessing the print note in a web browser allows for easy debugging to
understand why a particular note doesn't render well. The mechanism for
rendering is similar to the one used in&nbsp;<a class="reference-link"
href="#root/_help_0ESUbbAxVnoK">Note List</a>.</p>
</ul>
<h2>Under the hood</h2>
<p>Both printing and exporting as PDF use the same mechanism: a note is rendered
individually in a separate webpage that is then sent to the browser or
the Electron application either for printing or exporting as PDF.</p>
<p>The webpage that renders a single note can actually be accessed in a web
browser. For example <code spellcheck="false">http://localhost:8080/#root/WWRGzqHUfRln/RRZsE9Al8AIZ?ntxId=0o4fzk</code> becomes
<code
spellcheck="false">http://localhost:8080/?print#root/WWRGzqHUfRln/RRZsE9Al8AIZ</code>.</p>
<p>Accessing the print note in a web browser allows for easy debugging to
understand why a particular note doesn't render well. The mechanism for
rendering is similar to the one used in&nbsp;<a class="reference-link"
href="#root/_help_0ESUbbAxVnoK">Note List</a>.</p>
<ol class="footnote-section footnotes"
data-footnote-section="" role="doc-endnotes">
<li class="footnote-item" data-footnote-item="" data-footnote-index="1"
data-footnote-id="sr779u3zm6" role="doc-endnote" id="fnsr779u3zm6"><span class="footnote-back-link" data-footnote-back-link="" data-footnote-id="sr779u3zm6"><sup><strong><a href="#fnrefsr779u3zm6">^</a></strong></sup></span>
<div
class="footnote-content" data-footnote-content="">
<p>&nbsp;</p>
</div>
</li>
</ol>

View File

@@ -54,7 +54,8 @@
hide the Mermaid source code and display the diagram preview in full-size.
In this case, the read-only mode can be easily toggled on or off via a
dedicated button in the&nbsp;<a class="reference-link" href="#root/_help_XpOYSgsLkTJy">Floating buttons</a>&nbsp;area.</li>
<li><a class="reference-link" href="#root/_help_81SGnPGMk7Xc">Geo Map View</a>&nbsp;will
<li
><a class="reference-link" href="#root/_help_81SGnPGMk7Xc">Geo Map</a>&nbsp;will
disallow all interaction that would otherwise change the map (dragging
notes, adding new items).</li>
</ul>

View File

@@ -4,15 +4,16 @@
<p>This can be useful for a few things:</p>
<ul>
<li>computer programmers can store code snippets as notes with syntax highlighting</li>
<li>JavaScript code notes can be executed inside Trilium for some extra functionality
<li
>JavaScript code notes can be executed inside Trilium for some extra functionality
<ul>
<li>we call such JavaScript code notes "scripts" - see&nbsp;<a class="reference-link"
href="#root/_help_CdNpE2pqjmI6">Scripting</a>
</li>
</ul>
</li>
<li>JSON, XML etc. can be used as storage for structured data (typically used
in conjunction with scripting)</li>
</li>
<li>JSON, XML etc. can be used as storage for structured data (typically used
in conjunction with scripting)</li>
</ul>
<p>For shorter snippets of code that can be embedded in&nbsp;<a href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes,
see&nbsp;<a href="#root/_help_QxEyIjRBizuC">Code blocks</a>.</p>
@@ -37,6 +38,54 @@
to manually <a href="#root/_help_s8alTXmpFR61">refresh the application</a>.</p>
<p>The list of languages is also shared with the&nbsp;<a href="#root/_help_QxEyIjRBizuC">Code blocks</a>&nbsp;feature
of&nbsp;<a href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes.</p>
<h2>Word wrap</h2>
<p>Long lines can be displayed on multiple lines:</p>
<ul>
<li>Globally for all code notes, from&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_4TIF1oA4VQRO">Options</a>&nbsp;<em>Code Notes.</em>
</li>
<li>For a particular note, by going to the menu in&nbsp;<a class="reference-link"
href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_8YBEPzcpUgxw">Note buttons</a>&nbsp;and
selecting <em>Word wrap</em> and selecting the appropriate option:
<ul>
<li><em>Auto</em>, to respect the global word wrap for code notes.</li>
<li
><em>On</em> or <em>Off</em>, to change the state of the word wrap for this
note regardless of the global option.</li>
</ul>
</li>
</ul>
<h2>Adjusting options using the status bar</h2>
<aside class="admonition note">
<p>This feature is only available for the&nbsp;<a class="reference-link"
href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/Vc8PjrjAGuOp/_help_IjZS7iK5EXtb">New Layout</a>.
For the old layout, the tab width can be adjusted at note level using the
<code
spellcheck="false">#tabWidth</code>attribute, but re-indentation is not available.</p>
</aside>
<p>The status bar at the bottom of the editor shows the current indentation
settings and language. Clicking on the indentation indicator opens a menu
with three sections:</p>
<ol>
<li><strong>Indent Using</strong> — switch between Spaces and Tabs. If a per-note
override is active, a "Reset to default" option appears.</li>
<li><strong>Display Width</strong> — choose from preset widths (1, 2, 3, 4,
6, 8). Changes are saved as a per-note <code spellcheck="false">#tabWidth</code> label.</li>
<li
><strong>Re-indent Content To</strong> — convert existing indentation to
a different style. For example, re-indent a file from 4 spaces to 2 spaces,
or from spaces to tabs. This rewrites the leading whitespace on every line
while preserving alignment remainders.</li>
</ol>
<p>Clicking the language indicator lets you change the note's MIME type.</p>
<h3>Re-indentation</h3>
<p>When you re-indent content, the editor:</p>
<ul>
<li>Measures the visual column width of each line's leading whitespace using
the current style</li>
<li>Calculates indent levels and any alignment remainder</li>
<li>Rebuilds the leading whitespace in the target style</li>
<li>Preserves non-leading whitespace, blank lines, and content without indentation</li>
</ul>
<h2>Color schemes</h2>
<p>Since Trilium 0.94.0 the colors of code notes can be customized by going&nbsp;
<a

View File

@@ -62,8 +62,10 @@
<ul>
<li>It is possible to disable the syntax highlighting for all the notes by
selecting “No syntax highlighting” in the “Color scheme” option.</li>
<li>Word wrapping is disabled by default, but can be configured from the same
<li
>Word wrapping is disabled by default, but can be configured from the same
section.</li>
<li>The tab width can also be adjusted from Options.</li>
</ul>
<aside class="admonition note">
<p><strong>Context regarding syntax highlighting</strong>

View File

@@ -1,5 +1,5 @@
# Documentation
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/88cjtiwxfR49/Documentation_image.png" width="205" height="162">
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/HWpeC3cnbb1K/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.

View File

@@ -4522,10 +4522,52 @@
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"value": "IjZS7iK5EXtb",
"isInheritable": false,
"position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "8YBEPzcpUgxw",
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "A9Oc6YKKc65v",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "F1r9QtzQLZqm",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "pgxEVkzLl1OP",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "GBBMSlVSOIGP",
"isInheritable": false,
"position": 60
},
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 70
},
{
"type": "label",
"name": "shareAlias",
@@ -4539,48 +4581,6 @@
"value": "bx bx-history",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "IjZS7iK5EXtb",
"isInheritable": false,
"position": 40
},
{
"type": "relation",
"name": "internalLink",
"value": "8YBEPzcpUgxw",
"isInheritable": false,
"position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "pgxEVkzLl1OP",
"isInheritable": false,
"position": 70
},
{
"type": "relation",
"name": "internalLink",
"value": "GBBMSlVSOIGP",
"isInheritable": false,
"position": 80
},
{
"type": "relation",
"name": "internalLink",
"value": "A9Oc6YKKc65v",
"isInheritable": false,
"position": 90
},
{
"type": "relation",
"name": "internalLink",
"value": "F1r9QtzQLZqm",
"isInheritable": false,
"position": 100
}
],
"format": "markdown",
@@ -4691,13 +4691,6 @@
"isInheritable": false,
"position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 30
},
{
"type": "relation",
"name": "internalLink",
@@ -4802,13 +4795,41 @@
"value": "printing-and-pdf-export",
"isInheritable": false,
"position": 110
},
{
"type": "relation",
"name": "internalLink",
"value": "8YBEPzcpUgxw",
"isInheritable": false,
"position": 170
},
{
"type": "relation",
"name": "internalLink",
"value": "A9Oc6YKKc65v",
"isInheritable": false,
"position": 180
},
{
"type": "relation",
"name": "internalLink",
"value": "F1r9QtzQLZqm",
"isInheritable": false,
"position": 190
},
{
"type": "relation",
"name": "internalLink",
"value": "zEY4DaJG4YT5",
"isInheritable": false,
"position": 200
}
],
"format": "markdown",
"dataFileName": "Printing & Exporting as PDF.md",
"attachments": [
{
"attachmentId": "NfSjRsArIQHy",
"attachmentId": "Om2EmdZr54vy",
"title": "image.png",
"role": "image",
"mime": "image/png",
@@ -4816,7 +4837,7 @@
"dataFileName": "Printing & Exporting as PD.png"
},
{
"attachmentId": "Om2EmdZr54vy",
"attachmentId": "V7LPRqK96Vjy",
"title": "image.png",
"role": "image",
"mime": "image/png",
@@ -5228,7 +5249,7 @@
"wArbEsdSae6g",
"F1r9QtzQLZqm"
],
"title": "Jump to...",
"title": "Jump to & command palette",
"notePosition": 50,
"prefix": null,
"isExpanded": false,
@@ -5265,7 +5286,7 @@
}
],
"format": "markdown",
"dataFileName": "Jump to.md",
"dataFileName": "Jump to & command palette.md",
"attachments": [
{
"attachmentId": "7IU5WrneDsfi",
@@ -5273,7 +5294,7 @@
"role": "image",
"mime": "image/png",
"position": 10,
"dataFileName": "Jump to_image.png"
"dataFileName": "Jump to & command palette_.png"
},
{
"attachmentId": "P9veX5eFZdPp",
@@ -5281,7 +5302,7 @@
"role": "image",
"mime": "image/png",
"position": 10,
"dataFileName": "1_Jump to_image.png"
"dataFileName": "1_Jump to & command palette_.png"
},
{
"attachmentId": "y8yxomaf1Gkz",
@@ -5289,7 +5310,7 @@
"role": "image",
"mime": "image/png",
"position": 10,
"dataFileName": "2_Jump to_image.png"
"dataFileName": "2_Jump to & command palette_.png"
}
]
},
@@ -9856,6 +9877,20 @@
"value": "bx bx-code",
"isInheritable": false,
"position": 90
},
{
"type": "relation",
"name": "internalLink",
"value": "8YBEPzcpUgxw",
"isInheritable": false,
"position": 100
},
{
"type": "relation",
"name": "internalLink",
"value": "IjZS7iK5EXtb",
"isInheritable": false,
"position": 110
}
],
"format": "markdown",

View File

@@ -1,5 +1,5 @@
# Jump to...
<figure class="image image-style-align-center"><img style="aspect-ratio:991/403;" src="1_Jump to_image.png" width="991" height="403"></figure>
# Jump to & command palette
<figure class="image image-style-align-center"><img style="aspect-ratio:991/403;" src="1_Jump to &amp; command palette_.png" width="991" height="403"></figure>
## Jump to Note
@@ -7,7 +7,7 @@ The _Jump to Note_ function allows easy navigation between notes by searching fo
To enter the “Jump to” dialog:
* In the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>, press ![](2_Jump%20to_image.png) button.
* In the <a class="reference-link" href="../UI%20Elements/Launch%20Bar.md">Launch Bar</a>, press ![](2_Jump%20to%20&%20command%20palette_.png) button.
* Using the keyboard, press <kbd>Ctrl</kbd> + <kbd>J</kbd>.
In addition to searching for notes, it is also possible to search for commands. See the dedicated section below for more information.
@@ -28,7 +28,7 @@ Alternatively you can click on the "time" icon on the right.
## Command Palette
<figure class="image image-style-align-center"><img style="aspect-ratio:982/524;" src="Jump to_image.png" width="982" height="524"></figure>
<figure class="image image-style-align-center"><img style="aspect-ratio:982/524;" src="Jump to &amp; command palette_.png" width="982" height="524"></figure>
The command palette is a feature which allows easy execution of various commands that can be found throughout the application, such as from menus or keyboard shortcuts. This feature integrates directly into the “Jump to” dialog.

View File

@@ -13,4 +13,4 @@ This works identically to browser backwards / forwards, it's actually using buil
This is useful to quickly find and view arbitrary notes - click on `Jump to` button on the top or press <kbd>Ctrl</kbd> + <kbd>J</kbd> . Then type part of the note name and autocomplete will help you pick the desired note.
See <a class="reference-link" href="Jump%20to.md">Jump to Note</a> for more information.
See <a class="reference-link" href="Jump%20to%20%26%20command%20palette.md">Jump to Note</a> for more information.

View File

@@ -5,7 +5,7 @@ The _Quick search_ function does a full-text search (that is, it searches throug
The alternative to the quick search is the <a class="reference-link" href="Search.md">Search</a> function, which opens in a dedicated tab and has support for advanced queries.
For even faster navigation, it's possible to use <a class="reference-link" href="Jump%20to.md">Jump to...</a> which will only search through the note titles instead of the content.
For even faster navigation, it's possible to use <a class="reference-link" href="Jump%20to%20%26%20command%20palette.md">Jump to...</a> which will only search through the note titles instead of the content.
## Layout

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

After

Width:  |  Height:  |  Size: 243 KiB

View File

@@ -40,7 +40,7 @@ In the list of note revisions:
To create a named revision, either:
* Go to the <a class="reference-link" href="../UI%20Elements/Note%20buttons.md">Note buttons</a>, select _Save named revision…_, enter the name of revision and confirm.
* Use the corresponding [keyboard shortcut](../Keyboard%20Shortcuts.md) or the <a class="reference-link" href="../Navigation/Jump%20to.md">Jump to...</a> command with the same name.
* Use the corresponding [keyboard shortcut](../Keyboard%20Shortcuts.md) or the <a class="reference-link" href="../Navigation/Jump%20to%20%26%20command%20palette.md">Jump to...</a> command with the same name.
* Save a revision normally, and adjust the name afterwards from the note revision list.
## When revisions are saved

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 150 B

View File

@@ -1,29 +1,60 @@
# Printing & Exporting as PDF
<figure class="image"><img style="aspect-ratio:951/432;" src="Printing &amp; Exporting as PD.png" width="951" height="432"><figcaption>Screenshot of the note contextual menu indicating the “Export as PDF” option.</figcaption></figure>
<figure class="image"><img style="aspect-ratio:2023/1488;" src="1_Printing &amp; Exporting as PD.png" width="2023" height="1488"><figcaption>Screenshot of the Print preview functionality introduced in v0.103.0.</figcaption></figure>
## Printing
This feature allows printing of notes. It works on both the desktop client, but also on the web.
Trilium allows printing notes to a real printer, or generating a structured PDF for a single note or for multiple notes through <a class="reference-link" href="../../Collections.md">Collections</a>.
Note that not all note types are printable as of now. We do plan to increase the coverage of supported note types in the future.
To print a note, select the <img src="1_Printing &amp; Exporting as PD.png" width="29" height="31"> button to the right of the note and select _Print note_. Depending on the size and type of the note, this can take up to a few seconds. Afterwards you will be redirected to the system/browser printing dialog.
Printing and exporting as PDF are not perfect. Due to technical limitations, and sometimes even browser or Electron glitches the text might appear cut off in some circumstances. 
## Printing a note or exporting as PDF on the desktop
> [!NOTE]
> Printing and exporting as PDF are not perfect. Due to technical limitations, and sometimes even browser glitches the text might appear cut off in some circumstances. 
> Versions prior to v0.103.0 had two different options, one for printing and another one for exporting to PDF. With the introduction of the print preview, these functions have been unified.
On the desktop application of Trilium it is possible to export a note as PDF. To print a note:
* Press the menu button in the <a class="reference-link" href="../UI%20Elements/Note%20buttons.md">Note buttons</a> area and select _Print note_.
* Alternatively, printing can be triggered from a [keyboard shortcut](../Keyboard%20Shortcuts.md) (unassigned by default) or through the [command palette](../Navigation/Jump%20to%20%26%20command%20palette.md).
This will trigger the print preview screen next.
### Print preview & print options
The print preview dialog allows the following printing options to be adjusted:
* The printer to use
* _Save as PDF_ generates a PDF that is structured (maintains a table of contents, keeps the text selectable). Prefer this over other virtual PDF printers that ship with the operating system.
* Page orientation: _Portrait_ (default) or _Landscape_.
* Page size
* Scale the entire content from 10% to 200% to improve the fit within the page.
* Margins, which can be removed completely or adjusted individually for all the four edges.
* Print only a subset of pages. Individual page numbers are separated by colons and hyphen-based ranges are supported (e.g. 3-5 for pages 3 to 5).
Additional interaction:
* _Print using system dialog_ allows setting more options that are otherwise not available in Trilium.
> [!NOTE]
> Most of the options here (expect printer & which pages to print) are managed at note level through <a class="reference-link" href="../../Advanced%20Usage/Attributes.md">Attributes</a> (such as `#printLandscape`, `#printPageSize`, `#printScale`, `#printMargins`).
>
> This means that the print settings will be restored when printing the same note. There are no default settings that can be configured for all the notes, but this can be achieved via [inheritable attributes](../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md).
## Printing on the browser
This feature allows printing of notes. It works on both the desktop client, but also on the web.
To print a note, select the <img src="Printing &amp; Exporting as PD.png" width="29" height="31"> button to the right of the note and select _Print note_. Depending on the size and type of the note, this can take up to a few seconds. Afterwards you will be redirected to the system/browser printing dialog.
On the server or PWA (mobile), the option is not available due to technical constraints and it will be hidden.
## Reporting issues with the rendering
Should you encounter any visual issues in the resulting PDF file (e.g. a table does not fit properly, there is cut off text, etc.) feel free to [report the issue](../../Troubleshooting/Reporting%20issues.md). In this case, it's best to offer a sample note (click on the <img src="1_Printing &amp; Exporting as PD.png" width="29" height="31"> button, select Export note → This note and all of its descendants → HTML in ZIP archive). Make sure not to accidentally leak any personal information.
Should you encounter any visual issues in the resulting PDF file (e.g. a table does not fit properly, there is cut off text, etc.) feel free to [report the issue](../../Troubleshooting/Reporting%20issues.md). In this case, it's best to offer a sample note (click on the <img src="Printing &amp; Exporting as PD.png" width="29" height="31"> button, select Export note → This note and all of its descendants → HTML in ZIP archive). Make sure not to accidentally leak any personal information.
Consider adjusting font sizes and using [page breaks](../../Note%20Types/Text/Insert%20buttons.md) to work around the layout.
## Exporting as PDF
On the desktop application of Trilium it is possible to export a note as PDF. On the server or PWA (mobile), the option is not available due to technical constraints and it will be hidden.
To print a note, select the ![](1_Printing%20&%20Exporting%20as%20PD.png) button to the right of the note and select _Export as PDF_. Afterwards you will be prompted to select where to save the PDF file.
> [!TIP]
> Although direct export as PDF is not available in the browser version of the application, it's still possible to generate a PDF by selecting the _Print_ option instead and selecting “Save to PDF” as the printer (depending on the browser). Generally, Mozilla Firefox has better printing capabilities.
@@ -39,16 +70,6 @@ To solve this, you can change the recommended application for PDFs via this comm
gio mime application/pdf
```
### Customizing exporting as PDF
When exporting to PDF, there are no customizable settings such as page orientation, size. However, there are a few <a class="reference-link" href="../../Advanced%20Usage/Attributes.md">Attributes</a> to adjust some of the settings:
* To print in landscape mode instead of portrait (useful for big diagrams or slides), add `#printLandscape`.
* By default, the resulting PDF will be in Letter format. It is possible to adjust it to another page size via the `#printPageSize` attribute, with one of the following values: `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`.
> [!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 <a class="reference-link" href="../../Collections.md">Collections</a>:
@@ -120,4 +141,6 @@ Both printing and exporting as PDF use the same mechanism: a note is rendered in
The webpage that renders a single note can actually be accessed in a web browser. For example `http://localhost:8080/#root/WWRGzqHUfRln/RRZsE9Al8AIZ?ntxId=0o4fzk` becomes `http://localhost:8080/?print#root/WWRGzqHUfRln/RRZsE9Al8AIZ`.
Accessing the print note in a web browser allows for easy debugging to understand why a particular note doesn't render well. The mechanism for rendering is similar to the one used in <a class="reference-link" href="Note%20List.md">Note List</a>.
Accessing the print note in a web browser allows for easy debugging to understand why a particular note doesn't render well. The mechanism for rendering is similar to the one used in <a class="reference-link" href="Note%20List.md">Note List</a>.
1. <sup><strong><a href="#fnrefsr779u3zm6">^</a></strong></sup>

View File

@@ -40,4 +40,4 @@ When pressed, the note will become editable but will become read-only again afte
Some note types have a special behavior based on whether the read-only mode is enabled:
* <a class="reference-link" href="../../Note%20Types/Mermaid%20Diagrams.md">Mermaid Diagrams</a> will hide the Mermaid source code and display the diagram preview in full-size. In this case, the read-only mode can be easily toggled on or off via a dedicated button in the <a class="reference-link" href="../UI%20Elements/Floating%20buttons.md">Floating buttons</a> area.
* <a class="reference-link" href="../../Collections/Geo%20Map.md">Geo Map View</a> will disallow all interaction that would otherwise change the map (dragging notes, adding new items).
* <a class="reference-link" href="../../Collections/Geo%20Map.md">Geo Map</a> will disallow all interaction that would otherwise change the map (dragging notes, adding new items).

View File

@@ -26,6 +26,37 @@ Note that the list of languages is not immediately refreshed, you'd have to manu
The list of languages is also shared with the [Code blocks](Text/Developer-specific%20formatting/Code%20blocks.md) feature of [Text](Text.md) notes.
## Word wrap
Long lines can be displayed on multiple lines:
* Globally for all code notes, from <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → _Code Notes._
* For a particular note, by going to the menu in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20buttons.md">Note buttons</a> and selecting _Word wrap_ and selecting the appropriate option:
* _Auto_, to respect the global word wrap for code notes.
* _On_ or _Off_, to change the state of the word wrap for this note regardless of the global option.
## Adjusting options using the status bar
> [!NOTE]
> This feature is only available for the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/New%20Layout.md">New Layout</a>. For the old layout, the tab width can be adjusted at note level using the `#tabWidth` attribute, but re-indentation is not available.
The status bar at the bottom of the editor shows the current indentation settings and language. Clicking on the indentation indicator opens a menu with three sections:
1. **Indent Using** — switch between Spaces and Tabs. If a per-note override is active, a "Reset to default" option appears.
2. **Display Width** — choose from preset widths (1, 2, 3, 4, 6, 8). Changes are saved as a per-note `#tabWidth` label.
3. **Re-indent Content To** — convert existing indentation to a different style. For example, re-indent a file from 4 spaces to 2 spaces, or from spaces to tabs. This rewrites the leading whitespace on every line while preserving alignment remainders.
Clicking the language indicator lets you change the note's MIME type.
### Re-indentation
When you re-indent content, the editor:
* Measures the visual column width of each line's leading whitespace using the current style
* Calculates indent levels and any alignment remainder
* Rebuilds the leading whitespace in the target style
* Preserves non-leading whitespace, blank lines, and content without indentation
## Color schemes
Since Trilium 0.94.0 the colors of code notes can be customized by going <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Options.md">Options</a> → Code Notes and looking for the _Appearance_ section.

View File

@@ -36,6 +36,7 @@ In order to configure this new feature, a section has been added in Options →
* It is possible to disable the syntax highlighting for all the notes by selecting “No syntax highlighting” in the “Color scheme” option.
* Word wrapping is disabled by default, but can be configured from the same section.
* The tab width can also be adjusted from Options.
> [!NOTE]
> **Context regarding syntax highlighting**