docs(user): fix wrong page for documentation

This commit is contained in:
Elian Doran
2025-11-07 17:31:50 +02:00
parent cedd1c4789
commit e4cd946ea8
6 changed files with 93 additions and 41 deletions

View File

@@ -4,7 +4,6 @@
<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>
@@ -60,9 +59,9 @@ class="admonition note">
orientation, size. However, there are a few&nbsp;<a class="reference-link" 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> href="#root/_help_zEY4DaJG4YT5">Attributes</a>&nbsp;to adjust some of the settings:</p>
<ul> <ul>
<li>To print in landscape mode instead of portrait (useful for big diagrams <li data-list-item-id="e059818dc4b086a895efa23fdde670cb0">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>By default, the resulting PDF will be in Letter format. It is possible <li data-list-item-id="ebb801d5830e9662602ce85e96e351ee5">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>
@@ -76,9 +75,9 @@ class="admonition note">
href="#root/_help_4TIF1oA4VQRO">Options</a>&nbsp;and assigning a key combination href="#root/_help_4TIF1oA4VQRO">Options</a>&nbsp;and assigning a key combination
for:</p> for:</p>
<ul> <ul>
<li><em>Print Active Note</em> <li class="ck-list-marker-italic" data-list-item-id="ed834da40ebe17dd104c66956579e8db8"><em>Print Active Note</em>
</li> </li>
<li><em>Export Active Note as PDF</em> <li class="ck-list-marker-italic" data-list-item-id="e12469c162de60af8653a92238f286176"><em>Export Active Note as PDF</em>
</li> </li>
</ul> </ul>
<h2>Constraints &amp; limitations</h2> <h2>Constraints &amp; limitations</h2>
@@ -86,27 +85,58 @@ 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>For&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes: <li data-list-item-id="ecbc8f07fc543357dbe65e874d2812923">For&nbsp;<a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes:
<ul> <ul>
<li>Line numbers are not printed.</li> <li data-list-item-id="e5a65e990187f7457b1ef3b90b3efca65">Line numbers are not printed.</li>
<li>Syntax highlighting is enabled, however a default theme (Visual Studio) <li data-list-item-id="ed32da7175b6215d5c1461029b85310b6">Syntax highlighting is enabled, however a default theme (Visual Studio)
is enforced.</li> is enforced.</li>
</ul> </ul>
</li> </li>
<li>For&nbsp;<a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>: <li data-list-item-id="e2336e670a5137a961dbaa520180f1ca3">For&nbsp;<a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Collections</a>:
<ul> <ul>
<li>Only&nbsp;<a class="reference-link" href="#root/_help_zP3PMqaG71Ct">Presentation View</a>&nbsp;is <li data-list-item-id="e2dfe21a479e4e4574d70e3c818d3580c">Only&nbsp;<a class="reference-link" href="#root/_help_zP3PMqaG71Ct">Presentation</a>&nbsp;is
currently supported.</li> currently supported.</li>
<li>We plan to add support for all the collection types at some point.</li> <li data-list-item-id="eb710e8646deac11a960fc762ff059ffc">We plan to add support for all the collection types at some point.</li>
</ul> </ul>
</li> </li>
<li>Using&nbsp;<a class="reference-link" href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;for <li data-list-item-id="e92e4035db060328f92b290f201746687">Using&nbsp;<a class="reference-link" href="#root/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;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>We plan to introduce a new mechanism specifically for a print CSS.</li> <li data-list-item-id="e8ceb3650a468052a8728a40f05ba8ba9">We plan to introduce a new mechanism specifically for a print CSS.</li>
</ul> </ul>
</li> </li>
</ul> </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/pOsGYCXsbNQG/pKK96zzmvBGf/_help_AlhDUqhENtH7">Custom app-wide CSS</a>&nbsp;will
not work for printing.</p>
<p>To do so:</p>
<ul>
<li data-list-item-id="e9888834b45670c7ab11c0f229e38e32f">Create a CSS <a href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_6f9hih2hXXZk">code note</a>.</li>
<li
data-list-item-id="ea9e3983ea0c81ecc73c6cd73bcb3e400">On the note being printed, apply the <code>~printCss</code> relation to
point to the newly created CSS code note.</li>
<li data-list-item-id="ed4fdf9dd70c9770c03637eb4fb011654">To apply the CSS to multiple notes, consider using <a href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_bwZpz2ajCEwO">inheritable attributes</a> or&nbsp;
<a
class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/_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 {
--main-font-family: serif !important;
--detail-font-family: var(--main-font-family) !important;
}</code></pre>
<p>To remark:</p>
<ul>
<li data-list-item-id="e0fcaa62313f3f428f8243c0631a578b3">Multiple CSS notes can be add by using multiple <code>~printCss</code> relations.</li>
<li
data-list-item-id="e0388e16113a44b8200aed433f680b795">If the note pointing to the <code>printCss</code> doesn't have the right
note type or mime type, it will be ignored.</li>
<li data-list-item-id="ec4c3f5dcee6428c4a5e409f1461c2433">If migrating from a previous version where&nbsp;<a class="reference-link"
href="#root/pOsGYCXsbNQG/pKK96zzmvBGf/_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>
</ul>
<h2>Under the hood</h2> <h2>Under the hood</h2>
<p>Both printing and exporting as PDF use the same mechanism: a note is rendered <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 individually in a separate webpage that is then sent to the browser or

View File

@@ -43,7 +43,7 @@
<p>Since v0.99.2, it's no longer possible to use <code>#appCss</code> to customize <p>Since v0.99.2, it's no longer possible to use <code>#appCss</code> to customize
the printing CSS, since the printing is now done in an isolated environment.</p> the printing CSS, since the printing is now done in an isolated environment.</p>
<p>However, it's still possible to customize the CSS via <code>~printCss</code>; <p>However, it's still possible to customize the CSS via <code>~printCss</code>;
see&nbsp;<a class="reference-link" href="#root/jdjRLhLV3TtI/yeqU0zo0ZQ83/_help_W0msUwLxm40d">Printing and exporting to PDF</a>&nbsp;for see&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/BFs8mudNFgCS/_help_NRnIZmSMc5sj">Printing &amp; Exporting as PDF</a>&nbsp;for
more information.</p> more information.</p>
</aside> </aside>
<h3>Per-workspace styles</h3> <h3>Per-workspace styles</h3>

View File

@@ -16,27 +16,3 @@ Syntax highlighting for code blocks is supported as well:
* It works by injecting a Highlight.js stylesheet into the print. * It works by injecting a Highlight.js stylesheet into the print.
* The theme used is hard-coded (the _Visual Studio Light theme_, at the time of writing) in order not to have a dark background in print. * The theme used is hard-coded (the _Visual Studio Light theme_, at the time of writing) in order not to have a dark background in print.
* <a class="reference-link" href="Syntax%20highlighting.md">Syntax highlighting</a> is handled by the content renderer. * <a class="reference-link" href="Syntax%20highlighting.md">Syntax highlighting</a> is handled by the content renderer.
## Customizing the print CSS
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 <a class="reference-link" href="#root/pOsGYCXsbNQG/pKK96zzmvBGf/AlhDUqhENtH7">Custom app-wide CSS</a> will not work for printing.
To do so:
* Create a CSS [code note](#root/pOsGYCXsbNQG/KSZ04uQ2D1St/6f9hih2hXXZk).
* On the note being printed, apply the `~printCss` relation to point to the newly created CSS code note.
* To apply the CSS to multiple notes, consider using [inheritable attributes](#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/bwZpz2ajCEwO) or <a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/KC1HB96bqqHX">Templates</a>.
For example, to change the font of the document from the one defined by the theme or the user to a serif one:
```
body {
--main-font-family: serif !important;
--detail-font-family: var(--main-font-family) !important;
}
```
To remark:
* Multiple CSS notes can be add by using multiple `~printCss` relations.
* If migrating from a previous version where <a class="reference-link" href="#root/pOsGYCXsbNQG/pKK96zzmvBGf/AlhDUqhENtH7">Custom app-wide CSS</a>, there's no need for `@media print {` since the style-sheet is used only for printing.

View File

@@ -4078,6 +4078,20 @@
"value": "printing-and-pdf-export", "value": "printing-and-pdf-export",
"isInheritable": false, "isInheritable": false,
"position": 110 "position": 110
},
{
"type": "relation",
"name": "internalLink",
"value": "bwZpz2ajCEwO",
"isInheritable": false,
"position": 120
},
{
"type": "relation",
"name": "internalLink",
"value": "KC1HB96bqqHX",
"isInheritable": false,
"position": 130
} }
], ],
"format": "markdown", "format": "markdown",
@@ -11006,6 +11020,13 @@
"value": "bx bxs-file-css", "value": "bx bxs-file-css",
"isInheritable": false, "isInheritable": false,
"position": 50 "position": 50
},
{
"type": "relation",
"name": "internalLink",
"value": "NRnIZmSMc5sj",
"isInheritable": false,
"position": 60
} }
], ],
"format": "markdown", "format": "markdown",

View File

@@ -64,11 +64,36 @@ Not all <a class="reference-link" href="../../Note%20Types.md">Note Types</a> 
* Line numbers are not printed. * Line numbers are not printed.
* Syntax highlighting is enabled, however a default theme (Visual Studio) is enforced. * Syntax highlighting is enabled, however a default theme (Visual Studio) is enforced.
* For <a class="reference-link" href="../../Collections.md">Collections</a>: * For <a class="reference-link" href="../../Collections.md">Collections</a>:
* Only <a class="reference-link" href="../../Collections/Presentation.md">Presentation View</a> is currently supported. * Only <a class="reference-link" href="../../Collections/Presentation.md">Presentation</a> is currently supported.
* We plan to add support for all the collection types at some point. * We plan to add support for all the collection types at some point.
* Using <a class="reference-link" href="../../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a> for printing is not longer supported, due to a more stable but isolated mechanism. * Using <a class="reference-link" href="../../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a> 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. * We plan to introduce a new mechanism specifically for a print CSS.
## Customizing the print CSS
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 <a class="reference-link" href="../../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a> will not work for printing.
To do so:
* Create a CSS [code note](../../Note%20Types/Code.md).
* On the note being printed, apply the `~printCss` relation to point to the newly created CSS code note.
* To apply the CSS to multiple notes, consider using [inheritable attributes](../../Advanced%20Usage/Attributes/Attribute%20Inheritance.md) or <a class="reference-link" href="../../Advanced%20Usage/Templates.md">Templates</a>.
For example, to change the font of the document from the one defined by the theme or the user to a serif one:
```
body {
--main-font-family: serif !important;
--detail-font-family: var(--main-font-family) !important;
}
```
To remark:
* Multiple CSS notes can be add by using multiple `~printCss` relations.
* If the note pointing to the `printCss` doesn't have the right note type or mime type, it will be ignored.
* If migrating from a previous version where <a class="reference-link" href="../../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a>, there's no need for `@media print {` since the style-sheet is used only for printing.
## Under the hood ## Under the hood
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. 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.

View File

@@ -18,7 +18,7 @@ Adding a new _app CSS note_ or modifying an existing one does not immediately ap
> [!TIP] > [!TIP]
> Since v0.99.2, it's no longer possible to use `#appCss` to customize the printing CSS, since the printing is now done in an isolated environment. > Since v0.99.2, it's no longer possible to use `#appCss` to customize the printing CSS, since the printing is now done in an isolated environment.
> >
> However, it's still possible to customize the CSS via `~printCss`; see <a class="reference-link" href="#root/jdjRLhLV3TtI/yeqU0zo0ZQ83/W0msUwLxm40d">Printing and exporting to PDF</a> for more information. > However, it's still possible to customize the CSS via `~printCss`; see <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md">Printing &amp; Exporting as PDF</a> for more information.
### Per-workspace styles ### Per-workspace styles