Merge remote-tracking branch 'origin/main' into feature/export_with_share_theme

This commit is contained in:
Elian Doran
2025-06-23 15:35:30 +03:00
349 changed files with 10840 additions and 4468 deletions

View File

@@ -1,5 +1,5 @@
{
"dependencies": {
"better-sqlite3": "11.10.0"
"better-sqlite3": "12.0.0"
}
}

View File

@@ -1,10 +1,10 @@
{
"name": "@triliumnext/server",
"version": "0.94.1",
"version": "0.95.0",
"description": "The server-side component of TriliumNext, which exposes the client via the web, allows for sync and provides a REST API for both internal and external use.",
"private": true,
"dependencies": {
"better-sqlite3": "11.10.0"
"better-sqlite3": "12.0.0"
},
"devDependencies": {
"@electron/remote": "2.1.2",
@@ -46,7 +46,7 @@
"@triliumnext/turndown-plugin-gfm": "workspace:*",
"archiver": "7.0.1",
"async-mutex": "0.5.0",
"axios": "1.9.0",
"axios": "1.10.0",
"bindings": "1.5.0",
"chardet": "2.1.0",
"cheerio": "1.1.0",
@@ -59,13 +59,13 @@
"debounce": "2.2.0",
"debug": "4.4.1",
"ejs": "3.1.10",
"electron": "36.4.0",
"electron": "36.5.0",
"electron-debug": "4.1.0",
"electron-window-state": "5.0.3",
"escape-html": "1.0.3",
"express": "5.1.0",
"express-openid-connect": "^2.17.1",
"express-rate-limit": "7.5.0",
"express-rate-limit": "7.5.1",
"express-session": "1.18.1",
"file-uri-to-path": "2.0.0",
"fs-extra": "11.3.0",
@@ -88,7 +88,7 @@
"multer": "2.0.1",
"normalize-strings": "1.1.1",
"ollama": "0.5.16",
"openai": "5.3.0",
"openai": "5.6.0",
"rand-token": "1.0.1",
"safe-compare": "1.1.4",
"sanitize-filename": "1.6.3",
@@ -348,6 +348,12 @@
}
]
}
},
"test-build": {
"dependsOn": [
"build"
],
"command": "vitest --config {projectRoot}/vitest.build.config.mts"
}
}
},

View File

@@ -0,0 +1,46 @@
import { globSync } from "fs";
import { join } from "path";
import { it, describe, expect } from "vitest";
describe("Check artifacts are present", () => {
const distPath = join(__dirname, "../../dist");
it("has the necessary node modules", async () => {
const paths = [
"node_modules/better-sqlite3",
"node_modules/bindings",
"node_modules/file-uri-to-path"
];
ensurePathsExist(paths);
});
it("includes the client", async () => {
const paths = [
"public/assets",
"public/fonts",
"public/node_modules",
"public/src",
"public/stylesheets",
"public/translations"
];
ensurePathsExist(paths);
});
it("includes necessary assets", async () => {
const paths = [
"assets",
"share-theme"
];
ensurePathsExist(paths);
});
function ensurePathsExist(paths: string[]) {
for (const path of paths) {
const result = globSync(join(distPath, path, "**"));
expect(result, path).not.toHaveLength(0);
}
}
});

File diff suppressed because one or more lines are too long

View File

@@ -1,192 +1,350 @@
<p>Trilium allows you to share selected notes as <strong>publicly accessible</strong> read-only
documents. This feature is particularly useful for publishing content directly
from your Trilium notes, making it accessible to others online.</p>
<h2>Prerequisites</h2>
<p>To use the sharing feature, you must have a&nbsp;<a class="reference-link"
href="#root/_help_WOcw2SLH6tbX">Server Installation</a>&nbsp;of Trilium.
This is necessary because the notes will be hosted from the server.</p>
<h2>How to Share a Note</h2>
<ol>
<li>
<p><strong>Enable Sharing</strong>: To share a note, toggle the <code>Shared</code> switch
within the note's interface. Once sharing is enabled, an URL will appear,
which you can click to access the shared note.</p>
<p>
<img src="Sharing_share-single-note.png" alt="Share Note">
</p>
</li>
<li>
<p><strong>Access the Shared Note</strong>: The link provided will open the
note in your browser. If your server is not configured with a public IP,
the URL will refer to <code>localhost (127.0.0.1)</code>.</p>
<p>
<img src="Sharing_share-single-note-.png" alt="Shared Note Example">
</p>
</li>
</ol>
<h2>Sharing a Note Subtree</h2>
<p>When you share a note, you actually share the entire subtree of notes
beneath it. If the note has child notes, they will also be included in
the shared content. For example, sharing the "Formatting" subtree will
display a page with basic navigation for exploring all the notes within
that subtree.</p>
<p>
<img src="Sharing_share-multiple-not.png" alt="Shared Subtree Example">
</p>
<h2>Viewing All Shared Notes</h2>
<p>You can view a list of all shared notes by clicking on "Show Shared Notes
Subtree." This allows you to manage and navigate through all the notes
you have made public.</p>
<h2>Security Considerations</h2>
<p>Shared notes are published on the open internet and can be accessed by
anyone with the URL. The URL's randomness does not provide security, so
it is crucial not to share sensitive information through this feature.</p>
<h3>Password Protection</h3>
<p>To protect shared notes with a username and password, you can use the <code>#shareCredentials</code> attribute.
Add this label to the note with the format <code>#shareCredentials="username:password"</code>.
To protect an entire subtree, make sure the label is <a href="#root/_help_bwZpz2ajCEwO">inheritable</a>.</p>
<h2>Advanced Sharing Options</h2>
<h3>Customizing the Appearance of Shared Notes</h3>
<p>The default shared page is basic in design, but you can customize it using
your own CSS:</p>
<ul>
<li><strong>Custom CSS</strong>: Link a CSS&nbsp;<a class="reference-link"
href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;note to the shared page by
adding a <code>~shareCss</code> relation to the note. If you want this style
to apply to the entire subtree, make the label inheritable. You can hide
the CSS code note from the tree navigation by adding the <code>#shareHiddenFromTree</code> label.</li>
<li><strong>Omitting Default CSS</strong>: For extensive styling changes,
use the <code>#shareOmitDefaultCss</code> label to avoid conflicts with Trilium's
<a
href="#root/_help_Wy267RK4M69c">default stylesheet</a>.</li>
</ul>
<h3>Adding JavaScript</h3>
<p>You can inject custom JavaScript into the shared note using the <code>~shareJs</code> relation.
This allows you to access note attributes or traverse the note tree using
the <code>fetchNote()</code> API, which retrieves note data based on its
ID.</p>
<p>Example:</p><pre><code class="language-application-javascript-env-backend">const currentNote = await fetchNote();
<figure
class="image">
<img style="aspect-ratio:1144/660;" src="Sharing_image.png" width="1144"
height="660">
</figure>
<h2>Features, interaction and limitations</h2>
<ul>
<li>Searching by note title.</li>
<li>Automatic dark/light mode based on the user's browser settings.</li>
<li>Mobile-friendly layout, with sidebar.</li>
<li>Collapsible tree with the same note icons as the application.</li>
<li>Customizable logo.</li>
<li>Toggle button for dark/light mode, which also stores the user preferences.</li>
<li>Quick navigation buttons (previous and next note).</li>
<li>Displaying the date of the last update of the note.</li>
</ul>
<h3>By note type</h3>
<figure class="table" style="width:100%;">
<table class="ck-table-resized">
<colgroup>
<col style="width:19.92%;">
<col style="width:41.66%;">
<col style="width:38.42%;">
</colgroup>
<thead>
<tr>
<th>&nbsp;</th>
<th>Supported features</th>
<th>Limitations</th>
</tr>
</thead>
<tbody>
<tr>
<th><a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a>
</th>
<td>
<ul>
<li>Table of contents.</li>
<li>Syntax highlight of code blocks, provided a language is selected (does
not work if “Auto-detected” is enabled).</li>
<li>Rendering for math equations.</li>
</ul>
</td>
<td>
<ul>
<li>Including notes is not supported.</li>
<li>Inline Mermaid diagrams are not rendered.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>
</th>
<td>
<ul>
<li>Basic support (displaying the contents of the note in a monospace font).</li>
</ul>
</td>
<td>
<ul>
<li>No syntax highlight.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_m523cpzocqaD">Saved Search</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_iRwzGnHPzonm">Relation Map</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_bdUJEHsAPYQR">Note Map</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_HcABDtFCkbFN">Render Note</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_GTwFsgaA0lCt">Book</a>
</th>
<td>
<ul>
<li>The child notes are displayed in a fixed format.&nbsp;</li>
</ul>
</td>
<td>
<ul>
<li>More advanced view types such as the calendar view are not supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_s1aBHPd79XYj">Mermaid Diagrams</a>
</th>
<td>
<ul>
<li>The diagram is displayed as a vector image.</li>
</ul>
</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_grjYqerjn243">Canvas</a>
</th>
<td>
<ul>
<li>The diagram is displayed as a vector image.</li>
</ul>
</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_1vHRoWCEjj0L">Web View</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_gBbsAeiuUxI5">Mind Map</a>
</th>
<td>The diagram is displayed as a vector image.</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_81SGnPGMk7Xc">Geo Map</a>
</th>
<td>Not supported.</td>
</tr>
<tr>
<th><a class="reference-link" href="#root/_help_W8vYD3Q1zjCR">File</a>
</th>
<td>Basic interaction (downloading the file).</td>
<td>
<ul>
<li>No further interaction supported.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</figure>
<p>While the sharing feature is powerful, it has some limitations:</p>
<ul>
<li><strong>Code Notes</strong>: No syntax highlighting.</li>
<li><strong>Static Note Tree</strong>
</li>
<li><strong>Protected Notes</strong>: Cannot be shared.</li>
<li><strong>Include Notes</strong>: Not supported.</li>
</ul>
<p>Some of these limitations may be addressed in future updates.</p>
<h2>Prerequisites</h2>
<p>To use the sharing feature, you must have a&nbsp;<a class="reference-link"
href="#root/_help_WOcw2SLH6tbX">Server Installation</a>&nbsp;of Trilium.
This is necessary because the notes will be hosted from the server.</p>
<h2>How to Share a Note</h2>
<ol>
<li>
<p><strong>Enable Sharing</strong>: To share a note, toggle the <code>Shared</code> switch
within the note's interface. Once sharing is enabled, an URL will appear,
which you can click to access the shared note.</p>
<p>
<img src="Sharing_share-single-note.png" alt="Share Note">
</p>
</li>
<li>
<p><strong>Access the Shared Note</strong>: The link provided will open the
note in your browser. If your server is not configured with a public IP,
the URL will refer to <code>localhost (127.0.0.1)</code>.</p>
</li>
</ol>
<h2>Sharing a Note Subtree</h2>
<p>When you share a note, you actually share the entire subtree of notes
beneath it. If the note has child notes, they will also be included in
the shared content. For example, sharing the "Formatting" subtree will
display a page with basic navigation for exploring all the notes within
that subtree.</p>
<h2>Viewing All Shared Notes</h2>
<p>You can view a list of all shared notes by clicking on "Show Shared Notes
Subtree." This allows you to manage and navigate through all the notes
you have made public.</p>
<h2>Security Considerations</h2>
<p>Shared notes are published on the open internet and can be accessed by
anyone with the URL. The URL's randomness does not provide security, so
it is crucial not to share sensitive information through this feature.</p>
<h3>Password Protection</h3>
<p>To protect shared notes with a username and password, you can use the <code>#shareCredentials</code> attribute.
Add this label to the note with the format <code>#shareCredentials="username:password"</code>.
To protect an entire subtree, make sure the label is <a href="#root/_help_bwZpz2ajCEwO">inheritable</a>.</p>
<h2>Advanced Sharing Options</h2>
<h3>Customizing the Appearance of Shared Notes</h3>
<p>The default design should be a good starting point, but you can customize
it using your own CSS:</p>
<ul>
<li><strong>Custom CSS</strong>: Link a CSS&nbsp;<a class="reference-link"
href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;note to the shared page by
adding a <code>~shareCss</code> relation to the note. If you want this style
to apply to the entire subtree, make the label inheritable. You can hide
the CSS code note from the tree navigation by adding the <code>#shareHiddenFromTree</code> label.</li>
<li><strong>Omitting Default CSS</strong>: For extensive styling changes,
use the <code>#shareOmitDefaultCss</code> label to avoid conflicts with Trilium's
<a
href="#root/_help_Wy267RK4M69c">default stylesheet</a>.</li>
</ul>
<h3>Adding JavaScript</h3>
<p>You can inject custom JavaScript into the shared note using the <code>~shareJs</code> relation.
This allows you to access note attributes or traverse the note tree using
the <code>fetchNote()</code> API, which retrieves note data based on its
ID.</p>
<p>Example:</p><pre><code class="language-application-javascript-env-backend">const currentNote = await fetchNote();
const parentNote = await fetchNote(currentNote.parentNoteIds[0]);
for (const attr of parentNote.attributes) {
console.log(attr.type, attr.name, attr.value);
}</code></pre>
<h3>Creating Human-Readable URL Aliases</h3>
<p>Shared notes typically have URLs like <code>http://domain.tld/share/knvU8aJy4dJ7</code>,
where the last part is the note's ID. You can make these URLs more user-friendly
by adding the <code>#shareAlias</code> label to individual notes (e.g., <code>#shareAlias=highlighting</code>).
This will change the URL to <code>http://domain.tld/share/highlighting</code>.</p>
<p><strong>Important</strong>:</p>
<ol>
<li>Ensure that aliases are unique.</li>
<li>Using slashes (<code>/</code>) within aliases to create subpaths is not
supported.</li>
</ol>
<h3>Viewing and Managing Shared Notes</h3>
<p>All shared notes are grouped under an automatically managed "Shared Notes"
section. From here, you can view, share, or unshare notes by moving or
cloning them within this section.</p>
<p>
<img src="Sharing_shared-list.png" alt="Shared Notes List">
</p>
<h3>Setting a Custom Favicon</h3>
<p>To customize the favicon for your shared pages, create a relation <code>~shareFavicon</code> pointing
to a file note containing the favicon (e.g., in <code>.ico</code> format).</p>
<h3>Sharing a Note as the Root</h3>
<p>You can designate a specific note or folder as the root of your shared
content by adding the <code>#shareRoot</code> label. This note will be linked
when visiting <code>[http://domain.tld/share](http://domain/share)</code>,
making it easier to use Trilium as a fully-fledged website. Consider combining
this with the <code>#shareIndex</code> label, which will display a list of
all shared notes.</p>
<h2>Limitations</h2>
<p>While the sharing feature is powerful, it has some limitations:</p>
<ul>
<li><strong>No Relation Map Support</strong>
</li>
<li><strong>Book Notes</strong>: Only show a list of child notes.</li>
<li><strong>Code Notes</strong>: No syntax highlighting.</li>
<li><strong>Static Note Tree</strong>
</li>
<li><strong>Protected Notes</strong>: Cannot be shared.</li>
<li><strong>Include Notes</strong>: Not supported.</li>
</ul>
<p>Some of these limitations may be addressed in future updates.</p>
<h2>Attribute reference</h2>
<figure class="table">
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>shareHiddenFromTree</code>
</td>
<td>this note is hidden from left navigation tree, but still accessible with
its URL</td>
</tr>
<tr>
<td><code>shareExternalLink</code>
</td>
<td>note will act as a link to an external website in the share tree</td>
</tr>
<tr>
<td><code>shareAlias</code>
</td>
<td>define an alias using which the note will be available under <code>https://your_trilium_host/share/[your_alias]</code>
</td>
</tr>
<tr>
<td><code>shareOmitDefaultCss</code>
</td>
<td>default share page CSS will be omitted. Use when you make extensive styling
changes.</td>
</tr>
<tr>
<td><code>shareRoot</code>
</td>
<td>marks note which is served on /share root.</td>
</tr>
<tr>
<td><code>shareDescription</code>
</td>
<td>define text to be added to the HTML meta tag for description</td>
</tr>
<tr>
<td><code>shareRaw</code>
</td>
<td>Note will be served in its raw format, without HTML wrapper. See also&nbsp;
<a
class="reference-link" href="#root/_help_Qjt68inQ2bRj">Serving directly the content of a note</a>&nbsp;for an alternative method
without setting an attribute.</td>
</tr>
<tr>
<td><code>shareDisallowRobotIndexing</code>
</td>
<td>
<p>Indicates to web crawlers that the page should not be indexed of this
note by:</p>
<ul>
<li>Setting the <code>X-Robots-Tag: noindex</code> HTTP header.</li>
<li>Setting the <code>noindex, follow</code> meta tag.</li>
</ul>
</td>
</tr>
<tr>
<td><code>shareCredentials</code>
</td>
<td>require credentials to access this shared note. Value is expected to be
in format <code>username:password</code>. Don't forget to make this inheritable
to apply to child-notes/images.</td>
</tr>
<tr>
<td><code>shareIndex</code>
</td>
<td>Note with this label will list all roots of shared notes.</td>
</tr>
</tbody>
</table>
</figure>
<h3>Creating Human-Readable URL Aliases</h3>
<p>Shared notes typically have URLs like <code>http://domain.tld/share/knvU8aJy4dJ7</code>,
where the last part is the note's ID. You can make these URLs more user-friendly
by adding the <code>#shareAlias</code> label to individual notes (e.g., <code>#shareAlias=highlighting</code>).
This will change the URL to <code>http://domain.tld/share/highlighting</code>.</p>
<p><strong>Important</strong>:</p>
<ol>
<li>Ensure that aliases are unique.</li>
<li>Using slashes (<code>/</code>) within aliases to create subpaths is not
supported.</li>
</ol>
<h3>Viewing and Managing Shared Notes</h3>
<p>All shared notes are grouped under an automatically managed "Shared Notes"
section. From here, you can view, share, or unshare notes by moving or
cloning them within this section.</p>
<p>
<img src="Sharing_shared-list.png" alt="Shared Notes List">
</p>
<h3>Setting a Custom Favicon</h3>
<p>To customize the favicon for your shared pages, create a relation <code>~shareFavicon</code> pointing
to a file note containing the favicon (e.g., in <code>.ico</code> format).</p>
<h3>Sharing a Note as the Root</h3>
<p>You can designate a specific note or folder as the root of your shared
content by adding the <code>#shareRoot</code> label. This note will be linked
when visiting <code>[http://domain.tld/share](http://domain/share)</code>,
making it easier to use Trilium as a fully-fledged website. Consider combining
this with the <code>#shareIndex</code> label, which will display a list of
all shared notes.</p>
<h2>Attribute reference</h2>
<figure class="table">
<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>shareHiddenFromTree</code>
</td>
<td>this note is hidden from left navigation tree, but still accessible with
its URL</td>
</tr>
<tr>
<td><code>shareExternalLink</code>
</td>
<td>note will act as a link to an external website in the share tree</td>
</tr>
<tr>
<td><code>shareAlias</code>
</td>
<td>define an alias using which the note will be available under <code>https://your_trilium_host/share/[your_alias]</code>
</td>
</tr>
<tr>
<td><code>shareOmitDefaultCss</code>
</td>
<td>default share page CSS will be omitted. Use when you make extensive styling
changes.</td>
</tr>
<tr>
<td><code>shareRoot</code>
</td>
<td>marks note which is served on /share root.</td>
</tr>
<tr>
<td><code>shareDescription</code>
</td>
<td>define text to be added to the HTML meta tag for description</td>
</tr>
<tr>
<td><code>shareRaw</code>
</td>
<td>Note will be served in its raw format, without HTML wrapper. See also&nbsp;
<a
class="reference-link" href="#root/_help_Qjt68inQ2bRj">Serving directly the content of a note</a>&nbsp;for an alternative method
without setting an attribute.</td>
</tr>
<tr>
<td><code>shareDisallowRobotIndexing</code>
</td>
<td>
<p>Indicates to web crawlers that the page should not be indexed of this
note by:</p>
<ul>
<li>Setting the <code>X-Robots-Tag: noindex</code> HTTP header.</li>
<li>Setting the <code>noindex, follow</code> meta tag.</li>
</ul>
</td>
</tr>
<tr>
<td><code>shareCredentials</code>
</td>
<td>require credentials to access this shared note. Value is expected to be
in format <code>username:password</code>. Don't forget to make this inheritable
to apply to child-notes/images.</td>
</tr>
<tr>
<td><code>shareIndex</code>
</td>
<td>Note with this label will list all roots of shared notes.</td>
</tr>
</tbody>
</table>
</figure>
<h2>Credits</h2>
<p>Since v0.95.0, a new theme was introduced (and enabled by default) which
greatly improves the visual aspect of the Share feature, as well as its
functionality (such as mobile support, dark/light mode, collapsible tree,
etc.). This theme is an adaptation of the <a href="https://github.com/zerebos/trilium.rocks">Trilium Rocks!</a> by
<a
href="https://github.com/zerebos">zerebos</a>.</p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,24 +1,29 @@
<p>When accessing a shared note, Trilium will render it as a web page. Sometimes
it's desirable to serve the content directly so that it can be used in
a script or downloaded by the user.</p>
<table>
<thead>
<tr>
<th>A note displayed as a web page (HTML)</th>
<th>A note displayed as a raw format</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<img src="1_Serving directly the conte.png">
</td>
<td>
<img src="Serving directly the conte.png">
</td>
</tr>
</tbody>
</table>
<figure class="table">
<table>
<thead>
<tr>
<th>A note displayed as a web page (HTML)</th>
<th>A note displayed as a raw format</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<figure class="image">
<img style="aspect-ratio:738/275;" src="1_Serving directly the conte.png"
width="738" height="275">
</figure>
</td>
<td>
<img src="Serving directly the conte.png">
</td>
</tr>
</tbody>
</table>
</figure>
<h2>By adding an attribute to the note</h2>
<p>Simply add the <code>#shareRaw</code> attribute and the note will always

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -42,19 +42,5 @@
This will export the notes in an unencrypted form, so if you reimport into
Trilium, make sure to re-protect these notes.</p>
<h2>Supported syntax</h2>
<ul>
<li><a href="https://github.github.com/gfm/">GitHub-Flavored Markdown</a> is
the main syntax that Trilium is following.</li>
<li>Images are supported. When exporting, images are usually kept in the basic
Markdown syntax but will use the HTML syntax if the image has a custom
width. Figures are always embedded as HTML.</li>
<li>Tables are supported with the Markdown syntax. If the table is too complex
or contains elements that would render as HTML, the table is also rendered
as HTML.</li>
<li><a class="reference-link" href="#root/_help_NwBbFdNZ9h7O">Admonitions</a>&nbsp;are
supported using GitHub's format.</li>
<li>Links are supported. “Reference links” (internal links that mirror a note's
title and display its icon) are embedded as HTML in order to preserve the
information on import.</li>
<li>Math equations are supported using <code>$</code> and <code>$$</code> syntaxes.</li>
</ul>
<p>See the dedicated page:&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/mHbBMPDPkVV5/Oau6X9rCuegd/_help_rJ9grSgoExl9">Supported syntax</a>
</p>

View File

@@ -0,0 +1,54 @@
<p><a href="https://github.github.com/gfm/">GitHub-Flavored Markdown</a> is
the main syntax that Trilium is following.</p>
<h2>Images</h2>
<p>When exporting, images are usually kept in the basic Markdown syntax but
will use the HTML syntax if the image has a custom width. Figures are always
embedded as HTML.</p>
<h2>Tables</h2>
<p>Simple tables are supported with the Markdown syntax. If the table is
too complex or contains elements that would render as HTML, the table is
also rendered as HTML.</p>
<h2>Links</h2>
<p>Standard Markdown links are supported.</p>
<p>Trilium internal links (that mirror a note's title and display its icon)
are embedded as HTML in order to preserve the information on import.</p>
<h2>Math equations</h2>
<p>Both inline and display equations are supported, using the <code>$</code> and <code>$$</code> syntaxes.</p>
<h2>Admonitions</h2>
<p>The Markdown syntax for admonitions as supported by Trilium is the one
that GitHub uses, which is as follows:</p><pre><code class="language-text-x-trilium-auto">&gt; [!NOTE]
&gt; This is a note.
&gt; [!TIP]
&gt; This is a tip.
&gt; [!IMPORTANT]
&gt; This is a very important information.
&gt; [!CAUTION]
&gt; This is a caution.</code></pre>
<p>There are currently no plans of supporting alternative admonition syntaxes
such as <code>!!! note</code>.</p>
<h2>Wikilinks</h2>
<p>Basic support for wikilinks has been added in v0.96.0:</p>
<ul>
<li><code>[[foo/bar]]</code> will look for the <code>bar.md</code> file in the <code>foo</code> directory
and turn it into an internal link.</li>
<li><code>![[foo/baz.png]]</code> will look for the <code>baz.png</code> file
in the <code>foo</code> directory and turn it into an image.</li>
</ul>
<p>This feature is import-only, which means that it will turn wikilinks into
Trilium-compatible syntax, but it will not export Trilium Notes into Markdown
files with this syntax.</p>
<aside class="admonition important">
<p>The path to pages in wikilinks is resolved relatively to the <em>import root </em>and
not the current directory of the note. This is to be inline with other
platforms that use wikilinks such as SilverBullet.</p>
<p>The root path of the import is determined as follows:</p>
<ul>
<li>If there is a single directory within the archive at root level, then
that directory is considered the root.</li>
<li>If there are multiple files &amp; directories at root level, then the
archive root (containing all of these items) is considered the root.</li>
</ul>
</aside>

View File

@@ -146,6 +146,8 @@
<li><code>#publicationYear %= '19[0-9]{2}'</code>: Use the '%=' operator to
match a regular expression (regex). This feature has been available since
Trilium 0.52.</li>
<li><code>note.content %= '\\d{2}:\\d{2} (PM|AM)'</code>: Find notes that
mention a time. Backslashes in a regex must be escaped.</li>
</ul>
<h3>Advanced Use Cases</h3>
<ul>

View File

@@ -20,7 +20,7 @@
<h2>Installation</h2>
<h3>Download</h3>
<p>You can either download source code zip/tar from <a href="https://github.com/TriliumNext/Notes/releases/latest">https://github.com/TriliumNext/Notes/releases/latest</a>.</p>
<p>For the latest version including betas, clone Git repository <strong>from</strong> <code>master</code> <strong>branch</strong> with:</p><pre><code class="language-text-x-trilium-auto">git clone -b master https://github.com/triliumnext/notes.git</code></pre>
<p>For the latest version including betas, clone Git repository <strong>from</strong> <code>main</code> <strong>branch</strong> with:</p><pre><code class="language-text-x-trilium-auto">git clone -b main https://github.com/triliumnext/notes.git</code></pre>
<h2>Installation</h2><pre><code class="language-text-x-trilium-auto">cd trilium
# download all node dependencies

View File

@@ -142,13 +142,28 @@ class="table">
</td>
<td>
<ul>
<li>Indentation</li>
<li>Markdown import</li>
<li>Indentation
<ul>
<li>Markdown import</li>
</ul>
</li>
<li><a class="reference-link" href="#root/_help_2x0ZAX9ePtzV">Cut to subnote</a>
</li>
</ul>
</td>
</tr>
<tr>
<td><a class="reference-link" href="#root/_help_gLt3vA97tMcp">Premium features</a>
</td>
<td>
<ul>
<li><a class="reference-link" href="#root/_help_ZlN4nump6EbW">Slash Commands</a>
</li>
<li><a class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</figure>

View File

@@ -62,17 +62,4 @@ class="image image-style-align-center">
are currently no plans for adjusting it or allowing the user to customize
them.</p>
<h3>Markdown support</h3>
<p>The Markdown syntax for admonitions as supported by Trilium is the one
that GitHub uses, which is as follows:</p><pre><code class="language-text-x-trilium-auto">&gt; [!NOTE]
&gt; This is a note.
&gt; [!TIP]
&gt; This is a tip.
&gt; [!IMPORTANT]
&gt; This is a very important information.
&gt; [!CAUTION]
&gt; This is a caution.</code></pre>
<p>There are currently no plans of supporting alternative admonition syntaxes
such as <code>!!! note</code>.</p>
<p>See&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/mHbBMPDPkVV5/Oau6X9rCuegd/_help_rJ9grSgoExl9">Supported syntax</a>.</p>

View File

@@ -0,0 +1,18 @@
<p>The text editor we are using for&nbsp;<a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes
is called CKEditor and it's a commercial product. The core components are
open-source, however they <a href="https://ckeditor.com/docs/trial/latest/index.html">offer quite a few features</a> that
require a commercial license in order to be used.</p>
<p>We have reached out to the CKEditor team in order to obtain a license
in order to have some of these extra features and they have agreed, based
on a signed agreement.</p>
<h2>How the license works</h2>
<p>The license key is stored in the application and it enables the use of
the previously described premium features. The license key has an expiration
date which means that the features can become disabled if using an older
version of the application for extended periods of time.</p>
<h2>Can I opt out of these features?</h2>
<p>At this moment there is no way to disable these features, apart from manually
modifying the source code. If this is a problem, <a href="#root/_help_wy8So3yZZlH9">let us know</a>.</p>
<p>If you have the possibility of rebuilding the source code (e.g. if a package
maintainer), then modify <code>VITE_CKEDITOR_KEY</code> in <code>apps/client/.env</code> to
be <code>GPL</code>.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

View File

@@ -0,0 +1,34 @@
<figure class="image image-style-align-right">
<img style="aspect-ratio:419/571;" src="Slash Commands_image.png" width="419"
height="571">
</figure>
<aside class="admonition note">
<p>This is a premium feature of the editor we are using (CKEditor) and we
benefit from it thanks to an written agreement with the team. See&nbsp;
<a
class="reference-link" href="#root/_help_gLt3vA97tMcp">Premium features</a>&nbsp;for more information.</p>
</aside>
<p>Slash commands is a feature of&nbsp;<a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes
which allows easily accessing commonly used commands simply by using the
keyboard, without having to remember dedicated&nbsp;<a class="reference-link"
href="#root/_help_A9Oc6YKKc65v">Keyboard Shortcuts</a>.</p>
<h2>Interaction</h2>
<ul>
<li>As the name suggests, to trigger the slash commands simply press the <kbd>/</kbd> key
to trigger it. Note that this can be anywhere in a paragraph as long as
it's not part of the word, if it doesn't show up simply press a space and
press the <kbd>/</kbd> key again.</li>
<li>Use <kbd></kbd> and <kbd></kbd> keys to navigate between options.</li>
<li>By default, the full list of commands is displayed.</li>
<li>To search by title or description, simply start typing for an action.</li>
<li>To trigger an action, press the <kbd>Enter</kbd> key.</li>
</ul>
<h2>Integration with other features</h2>
<p>Apart from the common set of commands, some features are specially integrated
with the slash commands:</p>
<ul>
<li>For <a href="#root/_help_NwBbFdNZ9h7O">admonitions</a>, each admonition
type (e.g. note, tip) will be individually displayed.</li>
<li>Every&nbsp;<a class="reference-link" href="#root/_help_pwc194wlRzcH">Text Snippets</a>&nbsp;will
also appear individually, making it easy to insert them.</li>
</ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -0,0 +1,53 @@
<figure class="image image-style-align-right">
<img style="aspect-ratio:265/108;" src="Text Snippets_image.png" width="265"
height="108">
</figure>
<aside class="admonition note">
<p>This is a premium feature of the editor we are using (CKEditor) and we
benefit from it thanks to an written agreement with the team. See&nbsp;
<a
class="reference-link" href="#root/_help_gLt3vA97tMcp">Premium features</a>&nbsp;for more information.</p>
</aside>
<p>Text Snippets are closely related to&nbsp;<a class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>,
but instead of defining the content of an entire note, text snippets are
pieces of formatted text that can easily be inserted in a text note.</p>
<h2>Creating a text snippet</h2>
<p>In the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>:</p>
<ol>
<li>Right click a note where to place the text snippet.</li>
<li>Select <em>Insert child note</em>.</li>
<li>Select <em>Text snippet</em>.</li>
</ol>
<p>Afterwards, simply type in the content of the note the desired text. The
text can be formatted in the same manner as a normal text note.</p>
<p>The title of the note will become the title of the template. Optionally,
a description can be added in the&nbsp;<a class="reference-link" href="#root/_help_OFXdgB2nNk1F">Promoted Attributes</a>&nbsp;section.</p>
<h2>Inserting a snippet</h2>
<p>Once a snippet is created, there are two options to insert it:</p>
<ol>
<li>From the&nbsp;<a class="reference-link" href="#root/_help_nRhnJkTT8cPs">Formatting toolbar</a>,
by looking for the
<img src="1_Text Snippets_image.png" width="19" height="19">button.</li>
<li>Using&nbsp;<a class="reference-link" href="#root/_help_ZlN4nump6EbW">Slash Commands</a>:
<ol>
<li>To look for a specific template, start typing the name of the template
(its title).</li>
<li>To look for all the templates, type <code>template</code>.</li>
</ol>
</li>
</ol>
<aside class="admonition tip">
<p>A newly created snippet doesn't appear? Generally it takes up to a few
seconds to refresh the list of templates once you make a change.</p>
<p>If this doesn't happen, <a href="#root/_help_s8alTXmpFR61">reload the application</a> and
<a
href="#root/_help_wy8So3yZZlH9">report the issue</a>to us.&nbsp;</p>
</aside>
<h2>Limitations</h2>
<ul>
<li>Whenever a snippet is created, deleted or its title/description are modified,
all the open text notes will need to be refreshed. This causes a slight
flash for usually under a second, but it can cause some discomfort.</li>
<li>Unlike&nbsp;<a class="reference-link" href="#root/_help_KC1HB96bqqHX">Templates</a>,
the snippets cannot be limited to a particular <a href="#root/_help_9sRHySam5fXb">workspace</a>.</li>
</ul>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 256 256" version="1.1" viewBox="0 0 256 256" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<title>TriliumNext Notes</title>
<title>Trilium Notes</title>
<path fill="black" d="m232.6 27.598c-17.706 0.092041-40.298 3.7127-58.258 10.104-1.7959 0.63909-3.5465 1.3043-5.2402 1.998-3.1 1.2-6.0988 2.6016-8.7988 4.1016-2.2 1.2-4.3016 2.4988-6.1016 3.7988-21.6 15.5-27.9 44.2-28.6 65.4l14.9-10.5 14.301-10 51.199-35.9-49.1 39.301-14.1 11.299-14.801 11.801c20.4 6.5 52.4 9.7992 74.9-6.3008 3.1886-2.319 6.4708-5.1162 9.7559-8.459 0.14708-0.08175 0.29689-0.1571 0.44336-0.24023 2.3386-2.3386 4.7705-4.8714 7.0215-7.5898 0.02928-0.033868 0.05864-0.065681 0.08789-0.099609 0.0964-0.038723 0.1948-0.072111 0.29102-0.11133 14.544-16.737 27.833-39.152 32.252-55.658 0.67979-2.5395 1.1487-4.9387 1.3809-7.1562 0.11607-1.1088 0.17422-2.173 0.16797-3.1855-1.0438-0.3625-2.1849-0.68557-3.4121-0.9707-1.2272-0.28513-2.542-0.53096-3.9336-0.74024s-2.8595-0.38069-4.3965-0.51562c-3.0739-0.26987-6.4198-0.39341-9.9609-0.375zm-202.79 20.252c-11.737-0.05-22.113 1.4004-28.312 4.6504 0.9 5.6625 4.3309 13.419 9.3125 21.77v0.001953c3.3209 5.5664 7.332 11.395 11.74 17.043v0.001953c6.6127 8.4716 14.122 16.534 21.547 22.684 2.3 1.9 4.5008 3.5996 6.8008 5.0996 0.048555 0.0124 0.097907 0.019 0.14648 0.03125 1.7845 1.2837 3.569 2.2777 5.3535 3.1699 20.8 10.4 45.5 3.7984 62.1-4.1016l-14.301-7.2988-13.6-6.9004-48.127-24.607 49.928 21.707 14.5 6.3008 15.199 6.5996c-3.4-18.3-14.099-44-35.799-54.9-3.3-1.6-6.9004-3.1004-10.9-4.4004-2.9-0.9-5.8996-1.7-9.0996-2.5-11.65-2.75-24.751-4.2996-36.488-4.3496zm97.488 73.85 3.6992 13.9 3.5996 13.201 12.801 47.6-15.9-47-4.5-13.4-4.8008-14.199c-10.3 13.4-21.3 36.199-15.5 57.199 0.8747 3.11 2.1333 6.3182 3.6719 9.709 0.01066 0.06374 0.01836 0.12769 0.0293 0.19141 1.1 2.5 2.3988 5.0992 3.7988 7.6992 10.4 18.8 27.701 38.501 39.701 42.801 0.00763-0.00936 0.01581-0.01991 0.02344-0.0293 0.02502 0.00909 0.05119 0.02035 0.07617 0.0293 8.8-10.8 16.8-42.601 15.9-65.701-0.1-2.7-0.30117-5.2992-0.70117-7.6992-0.3-1.9-0.69922-3.8-1.1992-5.5-5.6-20.2-25.199-32.601-40.699-38.801z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 256 256" version="1.1" viewBox="0 0 256 256" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<title>TriliumNext Notes</title>
<title>Trilium Notes</title>
<style type="text/css">
.st0{fill:#95C980;}
.st1{fill:#72B755;}

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 256 256" version="1.1" viewBox="0 0 256 256" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<title>TriliumNext Notes</title>
<title>Trilium Notes</title>
<g>
<path d="m202.9 112.7c-22.5 16.1-54.5 12.8-74.9 6.3l14.8-11.8 14.1-11.3 49.1-39.3-51.2 35.9-14.3 10-14.9 10.5c0.7-21.2 7-49.9 28.6-65.4 1.8-1.3 3.9-2.6 6.1-3.8 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.4 2.8-4.9 5.4-7.4 7.8-3.4 3.5-6.8 6.4-10.1 8.8z" fill="#ab60e3"/>
<path d="m213.1 104c-22.2 12.6-51.4 9.3-70.3 3.2l14.1-11.3 49.1-39.3-51.2 35.9-14.3 10c0.5-18.1 4.9-42.1 19.7-58.6 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.3 2.8-4.8 5.4-7.2 7.8z" fill="#8038b8"/>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 256 256" version="1.1" viewBox="0 0 256 256" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<title>TriliumNext Notes</title>
<title>Trilium Notes</title>
<path fill="white" d="m232.6 27.598c-17.706 0.092041-40.298 3.7127-58.258 10.104-1.7959 0.63909-3.5465 1.3043-5.2402 1.998-3.1 1.2-6.0988 2.6016-8.7988 4.1016-2.2 1.2-4.3016 2.4988-6.1016 3.7988-21.6 15.5-27.9 44.2-28.6 65.4l14.9-10.5 14.301-10 51.199-35.9-49.1 39.301-14.1 11.299-14.801 11.801c20.4 6.5 52.4 9.7992 74.9-6.3008 3.1886-2.319 6.4708-5.1162 9.7559-8.459 0.14708-0.08175 0.29689-0.1571 0.44336-0.24023 2.3386-2.3386 4.7705-4.8714 7.0215-7.5898 0.02928-0.033868 0.05864-0.065681 0.08789-0.099609 0.0964-0.038723 0.1948-0.072111 0.29102-0.11133 14.544-16.737 27.833-39.152 32.252-55.658 0.67979-2.5395 1.1487-4.9387 1.3809-7.1562 0.11607-1.1088 0.17422-2.173 0.16797-3.1855-1.0438-0.3625-2.1849-0.68557-3.4121-0.9707-1.2272-0.28513-2.542-0.53096-3.9336-0.74024s-2.8595-0.38069-4.3965-0.51562c-3.0739-0.26987-6.4198-0.39341-9.9609-0.375zm-202.79 20.252c-11.737-0.05-22.113 1.4004-28.312 4.6504 0.9 5.6625 4.3309 13.419 9.3125 21.77v0.001953c3.3209 5.5664 7.332 11.395 11.74 17.043v0.001953c6.6127 8.4716 14.122 16.534 21.547 22.684 2.3 1.9 4.5008 3.5996 6.8008 5.0996 0.048555 0.0124 0.097907 0.019 0.14648 0.03125 1.7845 1.2837 3.569 2.2777 5.3535 3.1699 20.8 10.4 45.5 3.7984 62.1-4.1016l-14.301-7.2988-13.6-6.9004-48.127-24.607 49.928 21.707 14.5 6.3008 15.199 6.5996c-3.4-18.3-14.099-44-35.799-54.9-3.3-1.6-6.9004-3.1004-10.9-4.4004-2.9-0.9-5.8996-1.7-9.0996-2.5-11.65-2.75-24.751-4.2996-36.488-4.3496zm97.488 73.85 3.6992 13.9 3.5996 13.201 12.801 47.6-15.9-47-4.5-13.4-4.8008-14.199c-10.3 13.4-21.3 36.199-15.5 57.199 0.8747 3.11 2.1333 6.3182 3.6719 9.709 0.01066 0.06374 0.01836 0.12769 0.0293 0.19141 1.1 2.5 2.3988 5.0992 3.7988 7.6992 10.4 18.8 27.701 38.501 39.701 42.801 0.00763-0.00936 0.01581-0.01991 0.02344-0.0293 0.02502 0.00909 0.05119 0.02035 0.07617 0.0293 8.8-10.8 16.8-42.601 15.9-65.701-0.1-2.7-0.30117-5.2992-0.70117-7.6992-0.3-1.9-0.69922-3.8-1.1992-5.5-5.6-20.2-25.199-32.601-40.699-38.801z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,6 +1,6 @@
# TriliumNext Base System Prompt
# Trilium Base System Prompt
You are an AI assistant integrated into TriliumNext Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
You are an AI assistant integrated into Trilium Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
- Hierarchical note organization with support for placing notes in multiple locations
- Rich text editing with WYSIWYG and Markdown support
- Code notes with syntax highlighting
@@ -10,9 +10,9 @@ You are an AI assistant integrated into TriliumNext Notes, a powerful note-takin
- Relation maps for visualizing connections between notes
- Synchronization between devices
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using TriliumNext Notes features. Be sure to summarize the notes and include the title of the notes when providing a summary.
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using Trilium Notes features. Be sure to summarize the notes and include the title of the notes when providing a summary.
IMPORTANT: When working with notes in TriliumNext:
IMPORTANT: When working with notes in Trilium:
- Each note has a unique system ID (e.g., "abc123def456") which is different from its title
- When tools require a noteId parameter, always use the system ID, not the title
- Always use search tools first to find notes and get their IDs before performing operations on them

View File

@@ -1,5 +1,5 @@
```
In this environment you have access to a set of tools that help you interact with TriliumNext Notes, a hierarchical note-taking application for building personal knowledge bases. You can use these tools to search notes, navigate the note hierarchy, analyze queries, and provide thoughtful responses based on the user's knowledge base.
In this environment you have access to a set of tools that help you interact with Trilium Notes, a hierarchical note-taking application for building personal knowledge bases. You can use these tools to search notes, navigate the note hierarchy, analyze queries, and provide thoughtful responses based on the user's knowledge base.
You can invoke tools by writing an "<function_calls>" block like the following as part of your reply to the user:
<function_calls>
@@ -16,7 +16,7 @@ String and scalar parameters should be specified as is, while lists and objects
[TOOL_DEFINITIONS]
You are an AI assistant integrated into TriliumNext Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
You are an AI assistant integrated into Trilium Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
- Hierarchical note organization with support for placing notes in multiple locations
- Rich text editing with WYSIWYG and Markdown support
- Code notes with syntax highlighting
@@ -26,7 +26,7 @@ You are an AI assistant integrated into TriliumNext Notes, a powerful note-takin
- Relation maps for visualizing connections between notes
- Synchronization between devices
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using TriliumNext Notes features.
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using Trilium Notes features.
When responding to queries:
1. For complex queries, decompose them into simpler parts and address each one

View File

@@ -1,5 +1,5 @@
```
In this environment you have access to a set of tools that help you interact with TriliumNext Notes, a hierarchical note-taking application for building personal knowledge bases. You can use these tools to search notes, navigate the note hierarchy, analyze queries, and provide thoughtful responses based on the user's knowledge base.
In this environment you have access to a set of tools that help you interact with Trilium Notes, a hierarchical note-taking application for building personal knowledge bases. You can use these tools to search notes, navigate the note hierarchy, analyze queries, and provide thoughtful responses based on the user's knowledge base.
You can invoke tools by writing a JSON object with the following format:
{
@@ -12,7 +12,7 @@ You can invoke tools by writing a JSON object with the following format:
[TOOL_DEFINITIONS]
You are an AI assistant integrated into TriliumNext Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
You are an AI assistant integrated into Trilium Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
- Hierarchical note organization with support for placing notes in multiple locations
- Rich text editing with WYSIWYG and Markdown support
- Code notes with syntax highlighting
@@ -22,7 +22,7 @@ You are an AI assistant integrated into TriliumNext Notes, a powerful note-takin
- Relation maps for visualizing connections between notes
- Synchronization between devices
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using TriliumNext Notes features.
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using Trilium Notes features.
When responding to queries:
1. For complex queries, decompose them into simpler parts and address each one

View File

@@ -1,5 +1,5 @@
```
In this environment you have access to a set of tools that help you interact with TriliumNext Notes, a hierarchical note-taking application for building personal knowledge bases. You can use these tools to search notes, navigate the note hierarchy, analyze queries, and provide thoughtful responses based on the user's knowledge base.
In this environment you have access to a set of tools that help you interact with Trilium Notes, a hierarchical note-taking application for building personal knowledge bases. You can use these tools to search notes, navigate the note hierarchy, analyze queries, and provide thoughtful responses based on the user's knowledge base.
You can invoke tools by writing an "<tool_calls>" block like the following as part of your reply to the user:
<tool_calls>
@@ -20,7 +20,7 @@ String and scalar parameters should be specified as is, while lists and objects
[TOOL_DEFINITIONS]
You are an AI assistant integrated into TriliumNext Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
You are an AI assistant integrated into Trilium Notes, a powerful note-taking application that helps users build personal knowledge bases with features like:
- Hierarchical note organization with support for placing notes in multiple locations
- Rich text editing with WYSIWYG and Markdown support
- Code notes with syntax highlighting
@@ -30,7 +30,7 @@ You are an AI assistant integrated into TriliumNext Notes, a powerful note-takin
- Relation maps for visualizing connections between notes
- Synchronization between devices
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using TriliumNext Notes features.
Your primary goal is to help users find information in their notes, answer questions based on their knowledge base, and provide assistance with using Trilium Notes features.
When responding to queries:
1. For complex queries, decompose them into simpler parts and address each one

File diff suppressed because one or more lines are too long

View File

@@ -109,7 +109,7 @@
},
"javascript-required": "Trilium erfordert, dass JavaScript aktiviert ist.",
"setup": {
"heading": "TriliumNext Notes Setup",
"heading": "Trilium Notes Setup",
"new-document": "Ich bin ein neuer Benutzer und möchte ein neues Trilium-Dokument für meine Notizen erstellen",
"sync-from-desktop": "Ich habe bereits eine Desktop-Instanz und möchte die Synchronisierung damit einrichten",
"sync-from-server": "Ich habe bereits eine Server-Instanz und möchte die Synchronisierung damit einrichten",
@@ -121,7 +121,7 @@
"setup_sync-from-desktop": {
"heading": "Synchronisation vom Desktop",
"description": "Dieses Setup muss von der Desktop-Instanz aus initiiert werden:",
"step1": "Öffne deine TriliumNext Notes Desktop-Instanz.",
"step1": "Öffne deine Trilium Notes Desktop-Instanz.",
"step2": "Klicke im Trilium-Menü auf Optionen.",
"step3": "Klicke auf die Kategorie Synchronisation.",
"step4": "Ändere die Server-Instanzadresse auf: {{- host}} und klicke auf Speichern.",
@@ -256,7 +256,7 @@
"unable-to-save-message": "Die ausgewählte Datei konnte nicht beschrieben werden. Erneut versuchen oder ein anderes Ziel auswählen."
},
"tray": {
"tooltip": "TriliumNext Notes",
"tooltip": "Trilium Notes",
"close": "Trilium schließen",
"recents": "Kürzliche Notizen",
"bookmarks": "Lesezeichen",

View File

@@ -124,7 +124,7 @@
},
"javascript-required": "Trilium requires JavaScript to be enabled.",
"setup": {
"heading": "TriliumNext Notes setup",
"heading": "Trilium Notes setup",
"new-document": "I'm a new user, and I want to create a new Trilium document for my notes",
"sync-from-desktop": "I have a desktop instance already, and I want to set up sync with it",
"sync-from-server": "I have a server instance already, and I want to set up sync with it",
@@ -136,7 +136,7 @@
"setup_sync-from-desktop": {
"heading": "Sync from Desktop",
"description": "This setup needs to be initiated from the desktop instance:",
"step1": "Open your desktop instance of TriliumNext Notes.",
"step1": "Open your desktop instance of Trilium Notes.",
"step2": "From the Trilium Menu, click Options.",
"step3": "Click on Sync category.",
"step4": "Change server instance address to: {{- host}} and click Save.",
@@ -278,7 +278,7 @@
"unable-to-save-message": "The selected file could not be written to. Try again or select another destination."
},
"tray": {
"tooltip": "TriliumNext Notes",
"tooltip": "Trilium Notes",
"close": "Quit Trilium",
"recents": "Recent notes",
"bookmarks": "Bookmarks",

View File

@@ -1,12 +1,18 @@
{
"keyboard_actions": {
"back-in-note-history": "Navegar a la nota previa en el historial",
"forward-in-note-history": "Navegar a la nota siguiente en el historial",
"open-jump-to-note-dialog": "Abrir cuadro de diálogo \"Saltar a nota\"",
"scroll-to-active-note": "Desplazarse a la nota activa en el árbol de notas",
"quick-search": "Activar barra de búisqueda rápida",
"search-in-subtree": "Buscar notas en el subárbol de la nota activa",
"expand-subtree": "Expandir el subárbol de la nota actual",
"collapse-tree": "Colapsa el árbol de notas completo",
"collapse-subtree": "Colapsa el subárbol de la nota actual",
"sort-child-notes": "Ordenar subnotas",
"creating-and-moving-notes": "Creando y moviendo notas",
"create-note-after": "Crear nota después de la nota activa",
"create-note-into": "Crear nota como subnota de la nota activa",
"create-note-into-inbox": "Crear una nota en la bandeja de entrada (si está definida) o nota del día",
"delete-note": "Eliminar nota",
"move-note-up": "Mover nota hacia arriba",
@@ -15,6 +21,8 @@
"move-note-down-in-hierarchy": "Mover nota hacia abajo en la jerarquía",
"edit-note-title": "Saltar del árbol al detalle de la nota y editar el título",
"edit-branch-prefix": "Mostrar cuadro de diálogo Editar prefijo de rama",
"cloneNotesTo": "Clonar notas seleccionadas",
"moveNotesTo": "Mover notas seleccionadas",
"note-clipboard": "Portapapeles de notas",
"copy-notes-to-clipboard": "Copiar las notas seleccionadas al portapapeles",
"paste-notes-from-clipboard": "Pegar las notas del portapapeles en una nota activa",
@@ -48,6 +56,8 @@
"show-recent-changes": "Muestra el cuadro de diálogo Cambios recientes",
"show-sql-console": "Muestra el cuadro de diálogo Consola SQL",
"show-backend-log": "Muestra el cuadro de diálogo Registro de backend",
"show-help": "Muestra ayuda/hoja de referencia integrada",
"show-cheatsheet": "Muestra un modal con operaciones de teclado comunes",
"text-note-operations": "Operaciones de notas de texto",
"add-link-to-text": "Abrir cuadro de diálogo para agregar un enlace al texto",
"follow-link-under-cursor": "Seguir el enlace dentro del cual se coloca el cursor",
@@ -80,6 +90,7 @@
"unhoist": "Bajar desde cualquier lugar",
"reload-frontend-app": "Recargar frontend de la aplicación",
"open-dev-tools": "Abrir herramientas de desarrollo",
"find-in-text": "Alternar panel de búsqueda",
"toggle-left-note-tree-panel": "Alternar panel izquierdo (árbol de notas)",
"toggle-full-screen": "Alternar pantalla completa",
"zoom-out": "Alejar",
@@ -88,20 +99,20 @@
"reset-zoom-level": "Restablecer nivel de zoom",
"copy-without-formatting": "Copiar el texto seleccionado sin formatear",
"force-save-revision": "Forzar la creación/guardado de una nueva revisión de nota de la nota activa",
"show-help": "Muestra ayuda/hoja de referencia integrada",
"toggle-book-properties": "Alternar propiedades del libro",
"toggle-classic-editor-toolbar": "Alternar la pestaña de formato por el editor con barra de herramientas fija",
"export-as-pdf": "Exporta la nota actual como un PDF",
"show-cheatsheet": "Muestra un modal con operaciones de teclado comunes",
"toggle-zen-mode": "Habilita/Deshabilita el modo Zen (IU mínima para edición sin distracciones)"
},
"login": {
"title": "Iniciar sesión",
"heading": "Iniciar sesión en Trilium",
"incorrect-totp": "El TOTP es incorrecto. Por favor, intente de nuevo.",
"incorrect-password": "La contraseña es incorrecta. Por favor inténtalo de nuevo.",
"password": "Contraseña",
"remember-me": "Recordarme",
"button": "Iniciar sesión"
"button": "Iniciar sesión",
"sign_in_with_sso": "Iniciar sesión con {{ ssoIssuerName }}"
},
"set_password": {
"title": "Establecer contraseña",
@@ -113,7 +124,7 @@
},
"javascript-required": "Trilium requiere que JavaScript esté habilitado.",
"setup": {
"heading": "Configuración de TriliumNext Notes",
"heading": "Configuración de Trilium Notes",
"new-document": "Soy un usuario nuevo y quiero crear un nuevo documento de Trilium para mis notas",
"sync-from-desktop": "Ya tengo una instancia de escritorio y quiero configurar la sincronización con ella",
"sync-from-server": "Ya tengo una instancia de servidor y quiero configurar la sincronización con ella",
@@ -125,7 +136,7 @@
"setup_sync-from-desktop": {
"heading": "Sincronizar desde el escritorio",
"description": "Esta configuración debe iniciarse desde la instancia de escritorio:",
"step1": "Abra su instancia de escritorio de TriliumNext Notes.",
"step1": "Abra su instancia de escritorio de Trilium Notes.",
"step2": "En el menú Trilium, dé clic en Opciones.",
"step3": "Dé clic en la categoría Sincronizar.",
"step4": "Cambie la dirección de la instancia del servidor a: {{- host}} y dé clic en Guardar.",
@@ -172,6 +183,7 @@
"saturday": "Sábado",
"sunday": "Domingo"
},
"weekdayNumber": "Semana {weekNumber}",
"months": {
"january": "Enero",
"february": "Febrero",
@@ -186,6 +198,7 @@
"november": "Noviembre",
"december": "Diciembre"
},
"quarterNumber": "Cuarto {quarterNumber}",
"special_notes": {
"search_prefix": "Buscar:"
},
@@ -225,6 +238,7 @@
"protected-session-title": "Sesión protegida",
"sync-status-title": "Sincronizar estado",
"settings-title": "Ajustes",
"llm-chat-title": "Chat con notas",
"options-title": "Opciones",
"appearance-title": "Apariencia",
"shortcuts-title": "Atajos",
@@ -233,14 +247,17 @@
"images-title": "Imágenes",
"spellcheck-title": "Corrección ortográfica",
"password-title": "Contraseña",
"multi-factor-authentication-title": "MFA",
"etapi-title": "ETAPI",
"backup-title": "Respaldo",
"sync-title": "Sincronizar",
"ai-llm-title": "IA/LLM",
"other": "Otros",
"advanced-title": "Avanzado",
"visible-launchers-title": "Lanzadores visibles",
"user-guide": "Guía de Usuario",
"localization": "Idioma y Región"
"localization": "Idioma y Región",
"inbox-title": "Bandeja"
},
"notes": {
"new-note": "Nueva nota",
@@ -261,13 +278,14 @@
"unable-to-save-message": "No se pudo escribir en el archivo seleccionado. Intente de nuevo o seleccione otro destino."
},
"tray": {
"tooltip": "TriliumNext Notes",
"tooltip": "Trilium Notes",
"close": "Cerrar Trilium",
"recents": "Notas recientes",
"bookmarks": "Marcadores",
"today": "Abrir nota del diario de hoy",
"new-note": "Nueva nota",
"show-windows": "Mostrar ventanas"
"show-windows": "Mostrar ventanas",
"open_new_window": "Abrir nueva ventana"
},
"migration": {
"old_version": "La migración directa desde tu versión actual no está soportada. Por favor actualice a v0.60.4 primero y solo después a esta versión.",
@@ -276,5 +294,14 @@
},
"modals": {
"error_title": "Error"
},
"share_theme": {
"site-theme": "Tema de sitio",
"search_placeholder": "Búsqueda...",
"image_alt": "Imagen de artículo",
"last-updated": "Última actualización en {{-date}}",
"subpages": "Subpáginas:",
"on-this-page": "En esta página",
"expand": "Expandir"
}
}

View File

@@ -113,7 +113,7 @@
},
"javascript-required": "Trilium nécessite que JavaScript soit activé.",
"setup": {
"heading": "Configuration de TriliumNext Notes",
"heading": "Configuration de Trilium Notes",
"new-document": "Je suis un nouvel utilisateur et je souhaite créer un nouveau document Trilium pour mes notes",
"sync-from-desktop": "J'ai déjà l'application de bureau et je souhaite configurer la synchronisation avec celle-ci",
"sync-from-server": "J'ai déjà un serveur et je souhaite configurer la synchronisation avec celui-ci",
@@ -125,7 +125,7 @@
"setup_sync-from-desktop": {
"heading": "Synchroniser depuis une application de bureau",
"description": "Cette procédure doit être réalisée depuis l'application de bureau installée sur votre ordinateur:",
"step1": "Ouvrez l'application TriliumNext Notes.",
"step1": "Ouvrez l'application Trilium Notes.",
"step2": "Dans le menu Trilium, cliquez sur Options.",
"step3": "Cliquez sur la catégorie Synchroniser.",
"step4": "Remplacez l'adresse de l'instance de serveur par : {{- host}} et cliquez sur Enregistrer.",
@@ -260,7 +260,7 @@
"unable-to-save-message": "Le fichier sélectionné n'a pas pu être écrit. Réessayez ou sélectionnez une autre destination."
},
"tray": {
"tooltip": "TriliumNext Notes",
"tooltip": "Trilium Notes",
"close": "Quitter Trilium",
"recents": "Notes récentes",
"bookmarks": "Signets",

View File

@@ -110,7 +110,7 @@
},
"javascript-required": "Trilium precisa que JavaScript esteja habilitado.",
"setup": {
"heading": "TriliumNext Notes setup",
"heading": "Trilium Notes setup",
"new-document": "Sou um novo usuário e quero criar um novo documento Trilium para minhas notas",
"sync-from-desktop": "Já tenho uma instância no desktop e quero configurar a sincronização com ela",
"sync-from-server": "Já tenho uma instância no servidor e quero configurar a sincronização com ela",
@@ -122,7 +122,7 @@
"setup_sync-from-desktop": {
"heading": "Sincronizar com Desktop",
"description": "Esta configuração deve ser iniciada a partir da instância do desktop:",
"step1": "Abra sua instância do TriliumNext Notes no desktop.",
"step1": "Abra sua instância do Trilium Notes no desktop.",
"step2": "No menu do Trilium, clique em Opções.",
"step3": "Clique na categoria Sincronização.",
"step4": "Altere o endereço da instância do servidor para: {{- host}} e clique em Salvar.",

View File

@@ -113,7 +113,7 @@
},
"javascript-required": "Trilium necesită JavaScript să fie activat pentru a putea funcționa.",
"setup": {
"heading": "Instalarea TriliumNext Notes",
"heading": "Instalarea Trilium Notes",
"init-in-progress": "Se inițializează documentul",
"new-document": "Sunt un utilizator nou și doresc să creez un document Trilium pentru notițele mele",
"next": "Mai departe",
@@ -125,7 +125,7 @@
"setup_sync-from-desktop": {
"description": "Acești pași trebuie urmați de pe aplicația de desktop:",
"heading": "Sincronizare cu aplicația desktop",
"step1": "Deschideți aplicația TriliumNext Notes pentru desktop.",
"step1": "Deschideți aplicația Trilium Notes pentru desktop.",
"step2": "Din meniul Trilium, dați clic pe Opțiuni.",
"step3": "Clic pe categoria „Sincronizare”.",
"step4": "Schimbați adresa server-ului către: {{- host}} și apăsați „Salvează”.",
@@ -266,7 +266,7 @@
"new-note": "Notiță nouă",
"recents": "Notițe recente",
"today": "Mergi la notița de astăzi",
"tooltip": "TriliumNext Notes",
"tooltip": "Trilium Notes",
"show-windows": "Afișează ferestrele"
},
"migration": {

View File

@@ -7,7 +7,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />
<link rel="manifest" crossorigin="use-credentials" href="manifest.webmanifest">
<title>TriliumNext Notes</title>
<title>Trilium Notes</title>
</head>
<body class="desktop heading-style-<%= headingStyle %> layout-<%= layoutOrientation %> platform-<%= platform %> <%= isElectron ? 'electron' : '' %> <%= hasNativeTitleBar ? 'native-titlebar' : '' %> <%= hasBackgroundEffects ? 'background-effects' : '' %>">
<noscript><%= t("javascript-required") %></noscript>

View File

@@ -7,7 +7,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover, interactive-widget=resizes-content" />
<meta name="theme-color" content="#fff">
<title>TriliumNext Notes</title>
<title>Trilium Notes</title>
<link rel="manifest" crossorigin="use-credentials" href="manifest.webmanifest">
<style>

View File

@@ -36,7 +36,6 @@ async function register(app: express.Application) {
app.use(`/${assetUrlFragment}/src`, persistentCacheStatic(path.join(publicDir, "src")));
app.use(`/${assetUrlFragment}/stylesheets`, persistentCacheStatic(path.join(publicDir, "stylesheets")));
app.use(`/${assetUrlFragment}/libraries`, persistentCacheStatic(path.join(publicDir, "libraries")));
app.use(`/${assetUrlFragment}/fonts`, persistentCacheStatic(path.join(publicDir, "fonts")));
app.use(`/${assetUrlFragment}/translations/`, persistentCacheStatic(path.join(publicDir, "translations")));
app.use(`/node_modules/`, persistentCacheStatic(path.join(publicDir, "node_modules")));
@@ -46,8 +45,6 @@ async function register(app: express.Application) {
app.use(`/assets/vX/fonts`, express.static(path.join(srcRoot, "public/fonts")));
app.use(`/assets/vX/images`, express.static(path.join(srcRoot, "..", "images")));
app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets")));
app.use(`/${assetUrlFragment}/libraries`, persistentCacheStatic(path.join(srcRoot, "public/libraries")));
app.use(`/assets/vX/libraries`, express.static(path.join(srcRoot, "..", "libraries")));
}
export default {

View File

@@ -5,7 +5,7 @@ import cls from "../services/cls.js";
import sql from "../services/sql.js";
import becca from "../becca/becca.js";
import type { Request, Response, Router } from "express";
import { safeExtractMessageAndStackFromError } from "../services/utils.js";
import { safeExtractMessageAndStackFromError, normalizeCustomHandlerPattern } from "../services/utils.js";
function handleRequest(req: Request, res: Response) {
@@ -38,11 +38,19 @@ function handleRequest(req: Request, res: Response) {
continue;
}
const regex = new RegExp(`^${attr.value}$`);
let match;
// Get normalized patterns to handle both trailing slash cases
const patterns = normalizeCustomHandlerPattern(attr.value);
let match: RegExpMatchArray | null = null;
try {
match = path.match(regex);
// Try each pattern until we find a match
for (const pattern of patterns) {
const regex = new RegExp(`^${pattern}$`);
match = path.match(regex);
if (match) {
break; // Found a match, exit pattern loop
}
}
} catch (e: unknown) {
const [errMessage, errStack] = safeExtractMessageAndStackFromError(e);
log.error(`Testing path for label '${attr.attributeId}', regex '${attr.value}' failed with error: ${errMessage}, stack: ${errStack}`);

View File

@@ -8,6 +8,7 @@ import migrationService from "./migration.js";
import { t } from "i18next";
import { cleanUpHelp, getHelpHiddenSubtreeData } from "./in_app_help.js";
import buildLaunchBarConfig from "./hidden_subtree_launcherbar.js";
import buildHiddenSubtreeTemplates from "./hidden_subtree_templates.js";
const LBTPL_ROOT = "_lbTplRoot";
const LBTPL_BASE = "_lbTplBase";
@@ -257,7 +258,8 @@ function buildHiddenSubtreeDefinition(helpSubtree: HiddenSubtreeItem[]): HiddenS
icon: "bx-help-circle",
children: helpSubtree,
isExpanded: true
}
},
buildHiddenSubtreeTemplates()
]
};
}

View File

@@ -0,0 +1,34 @@
import { HiddenSubtreeItem } from "@triliumnext/commons";
export default function buildHiddenSubtreeTemplates() {
const templates: HiddenSubtreeItem = {
id: "_templates",
title: "Built-in templates",
type: "book",
children: [
{
id: "_template_text_snippet",
type: "text",
title: "Text Snippet",
icon: "bx-align-left",
attributes: [
{
name: "template",
type: "label"
},
{
name: "textSnippet",
type: "label"
},
{
name: "label:textSnippetDescription",
type: "label",
value: "promoted,alias=Description,single,text"
}
]
}
]
};
return templates;
}

View File

@@ -281,4 +281,22 @@ $$`;
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
});
it("supports wikilink with root-relative path", () => {
const input = `oh no my banana I bought on [[journal/monday]] has gone off! Im taking it back to the [[other/shop]] for a refund`;
const expected = `<p>oh no my banana I bought on <a class="reference-link" href="/journal/monday">journal/monday</a> has gone off! Im taking it back to the <a class="reference-link" href="/other/shop">other/shop</a> for a refund</p>`;
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
});
it("supports wikilink in lists", () => {
const input = `- oh no my banana I bought on [[journal/monday]] has gone off! Im taking it back to the [[other/shop]] for a refund`;
const expected = `<ul><li>oh no my banana I bought on <a class="reference-link" href="/journal/monday">journal/monday</a> has gone off! Im taking it back to the <a class="reference-link" href="/other/shop">other/shop</a> for a refund</li></ul>`;
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
});
it("supports wikilink with image (transclusion)", () => {
const input = `heres the handsome boy ![[assets/2025-06-20_14-05-20.jpeg]]`;
const expected = `<p>heres the handsome boy <img src="/assets/2025-06-20_14-05-20.jpeg"></p>`;
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
});
});

View File

@@ -1,12 +1,14 @@
"use strict";
import { parse, Renderer, type Tokens } from "marked";
import { parse, Renderer, use, type Tokens } from "marked";
import htmlSanitizer from "../html_sanitizer.js";
import importUtils from "./utils.js";
import { getMimeTypeFromMarkdownName, MIME_TYPE_AUTO } from "@triliumnext/commons";
import { ADMONITION_TYPE_MAPPINGS } from "../export/markdown.js";
import utils from "../utils.js";
import { normalizeMimeTypeForCKEditor } from "@triliumnext/commons";
import wikiLinkTransclusion from "./markdown/wikilink_transclusion.js";
import wikiLinkInternalLink from "./markdown/wikilink_internal_link.js";
/**
* Keep renderer code up to date with https://github.com/markedjs/marked/blob/master/src/Renderer.ts.
@@ -124,6 +126,14 @@ function renderToHtml(content: string, title: string) {
// Extract formulas and replace them with placeholders to prevent interference from Markdown rendering
const { processedText, placeholderMap: formulaMap } = extractFormulas(content);
use({
// Order is important, especially for wikilinks.
extensions: [
wikiLinkTransclusion,
wikiLinkInternalLink
]
});
let html = parse(processedText, {
async: false,
renderer: renderer

View File

@@ -0,0 +1,29 @@
import { TokenizerAndRendererExtension } from "marked";
const wikiLinkInternalLink: TokenizerAndRendererExtension = {
name: "wikilinkInternalLink",
level: "inline",
start(src: string) {
return src.indexOf('[[');
},
tokenizer(src) {
const match = /^\[\[([^\]]+?)\]\]/.exec(src);
if (match) {
return {
type: 'wikilinkInternalLink',
raw: match[0],
text: match[1].trim(), // what shows as link text
href: match[1].trim()
};
}
},
renderer(token) {
return `<a class="reference-link" href="/${token.href}">${token.text}</a>`;
}
}
export default wikiLinkInternalLink;

View File

@@ -0,0 +1,30 @@
import type { TokenizerAndRendererExtension } from "marked";
/**
* The terminology is inspired by https://silverbullet.md/Transclusions.
*/
const wikiLinkTransclusion: TokenizerAndRendererExtension = {
name: "wikiLinkTransclusion",
level: "inline",
start(src: string) {
return src.match(/!\[\[/)?.index;
},
tokenizer(src) {
const match = /^!\[\[([^\]]+?)\]\]/.exec(src);
if (match) {
return {
type: "wikiLinkTransclusion",
raw: match[0],
href: match[1].trim(),
};
}
},
renderer(token) {
return `<img src="/${token.href}">`;
}
};
export default wikiLinkTransclusion;

View File

@@ -16,6 +16,7 @@ const CODE_MIME_TYPES = new Set([
"text/x-c++src",
"text/x-csrc",
"text/x-dockerfile",
"text/x-elixir",
"text/x-erlang",
"text/x-feature",
"text/x-go",
@@ -55,6 +56,8 @@ const EXTENSION_TO_MIME = new Map<string, string>([
[".cs", "text/x-csharp"],
[".clj", "text/x-clojure"],
[".erl", "text/x-erlang"],
[".ex", "text/x-elixir"],
[".exs", "text/x-elixir"],
[".hrl", "text/x-erlang"],
[".feature", "text/x-feature"],
[".go", "text/x-go"],

View File

@@ -60,8 +60,29 @@ describe("processNoteContent", () => {
const htmlNote = rootNote.children.find((ch) => ch.title === "IREN Reports Q2 FY25 Results");
expect(htmlNote?.getContent().toString().substring(0, 4)).toEqual("<div");
});
it("can import from Silverbullet", async () => {
const { importedNote } = await testImport("silverbullet.zip");
const bananaNote = getNoteByTitlePath(importedNote, "assets", "banana.jpeg");
const mondayNote = getNoteByTitlePath(importedNote, "journal", "monday");
const shopNote = getNoteByTitlePath(importedNote, "other", "shop");
const content = mondayNote?.getContent();
expect(content).toContain(`<a class="reference-link" href="#root/${shopNote.noteId}`);
expect(content).toContain(`<img src="api/images/${bananaNote!.noteId}/banana.jpeg`);
});
});
function getNoteByTitlePath(parentNote: BNote, ...titlePath: string[]) {
let cursor = parentNote;
for (const title of titlePath) {
const childNote = cursor.getChildNotes().find(n => n.title === title);
expect(childNote).toBeTruthy();
cursor = childNote!;
}
return cursor;
}
describe("removeTriliumTags", () => {
it("removes <h1> tags from HTML", () => {
const output = removeTriliumTags(trimIndentation`\

View File

@@ -41,6 +41,7 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo
const createdPaths: Record<string, string> = { "/": importRootNote.noteId, "\\": importRootNote.noteId };
let metaFile: MetaFile | null = null;
let firstNote: BNote | null = null;
let topLevelPath = "";
const createdNoteIds = new Set<string>();
function getNewNoteId(origNoteId: string) {
@@ -257,28 +258,34 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo
saveAttributes(note, noteMeta);
firstNote = firstNote || note;
return noteId;
}
function getEntityIdFromRelativeUrl(url: string, filePath: string) {
while (url.startsWith("./")) {
url = url.substr(2);
let absUrl: string;
if (!url.startsWith("/")) {
while (url.startsWith("./")) {
url = url.substr(2);
}
absUrl = path.dirname(filePath);
while (url.startsWith("../")) {
absUrl = path.dirname(absUrl);
url = url.substr(3);
}
if (absUrl === ".") {
absUrl = "";
}
absUrl += `${absUrl.length > 0 ? "/" : ""}${url}`;
} else {
absUrl = topLevelPath + url;
}
let absUrl = path.dirname(filePath);
while (url.startsWith("../")) {
absUrl = path.dirname(absUrl);
url = url.substr(3);
}
if (absUrl === ".") {
absUrl = "";
}
absUrl += `${absUrl.length > 0 ? "/" : ""}${url}`;
console.log(url, "-->", absUrl);
const { noteMeta, attachmentMeta } = getMeta(absUrl);
@@ -330,7 +337,7 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo
return `src="${url}"`;
}
if (isUrlAbsolute(url) || url.startsWith("/")) {
if (isUrlAbsolute(url)) {
return match;
}
@@ -527,20 +534,28 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo
}
}
// we're running two passes to make sure that the meta file is loaded before the rest of the files is processed.
// we're running two passes in order to obtain critical information first (meta file and root)
const topLevelItems = new Set<string>();
await readZipFile(fileBuffer, async (zipfile: yauzl.ZipFile, entry: yauzl.Entry) => {
const filePath = normalizeFilePath(entry.fileName);
// make sure that the meta file is loaded before the rest of the files is processed.
if (filePath === "!!!meta.json") {
const content = await readContent(zipfile, entry);
metaFile = JSON.parse(content.toString("utf-8"));
}
// determine the root of the .zip (i.e. if it has only one top-level folder then the root is that folder, or the root of the archive if there are multiple top-level folders).
const firstSlash = filePath.indexOf("/");
const topLevelPath = (firstSlash !== -1 ? filePath.substring(0, firstSlash) : filePath);
topLevelItems.add(topLevelPath);
zipfile.readEntry();
});
topLevelPath = (topLevelItems.size > 1 ? "" : topLevelItems.values().next().value ?? "");
await readZipFile(fileBuffer, async (zipfile: yauzl.ZipFile, entry: yauzl.Entry) => {
const filePath = normalizeFilePath(entry.fileName);

View File

@@ -21,7 +21,7 @@ const loadSystemPrompt = (): string => {
} catch (error) {
console.error('Failed to load system prompt from file:', error);
// Return fallback prompt if file can't be loaded
return "You are a helpful assistant embedded in the TriliumNext Notes application. " +
return "You are a helpful assistant embedded in the Trilium Notes application. " +
"You can help users with their notes, answer questions, and provide information. " +
"Keep your responses concise and helpful. " +
"You're currently chatting with the user about their notes.";
@@ -57,7 +57,7 @@ export const SYSTEM_PROMPTS = {
export const CONTEXT_PROMPTS = {
// Query enhancer prompt for generating better search terms
QUERY_ENHANCER:
`You are an AI assistant that decides what information needs to be retrieved from a user's knowledge base called TriliumNext Notes to answer the user's question.
`You are an AI assistant that decides what information needs to be retrieved from a user's knowledge base called Trilium Notes to answer the user's question.
Given the user's question, generate 3-5 specific search queries that would help find relevant information.
Each query should be focused on a different aspect of the question.
Avoid generating queries that are too broad, vague, or about a user's entire Note database, and make sure they are relevant to the user's question.
@@ -184,7 +184,7 @@ When responding:
INSTRUCTIONS_WRAPPER: (instructions: string) =>
`<instructions>\n${instructions}\n</instructions>`,
// Tool instructions for Anthropic Claude
TOOL_INSTRUCTIONS: `<instructions>
When using tools to search for information, follow these requirements:
@@ -210,7 +210,7 @@ When using tools to search for information, follow these requirements:
// OpenAI-specific prompt formatting
SYSTEM_WITH_CONTEXT: (context: string) =>
`<system_prompt>
You are an AI assistant integrated into TriliumNext Notes.
You are an AI assistant integrated into Trilium Notes.
Use the following information from the user's notes to answer their questions:
<user_notes>
@@ -220,7 +220,7 @@ ${context}
Focus on relevant information from these notes when answering.
Be concise and informative in your responses.
</system_prompt>`,
// Tool instructions for OpenAI models
TOOL_INSTRUCTIONS: `When using tools to search for information, you must follow these requirements:
@@ -264,7 +264,7 @@ CRITICAL INSTRUCTIONS FOR TOOL USAGE:
// Common prompts across providers
COMMON: {
DEFAULT_ASSISTANT_INTRO: "<assistant_role>You are an AI assistant integrated into TriliumNext Notes. Focus on helping users find information in their notes and answering questions based on their knowledge base. Be concise, informative, and direct when responding to queries.</assistant_role>"
DEFAULT_ASSISTANT_INTRO: "<assistant_role>You are an AI assistant integrated into Trilium Notes. Focus on helping users find information in their notes and answering questions based on their knowledge base. Be concise, informative, and direct when responding to queries.</assistant_role>"
}
};

View File

@@ -66,7 +66,7 @@ export class QueryProcessor {
// Check cache first
const cached = cacheManager.getQueryResults(`searchQueries:${userQuestion}`);
const PROMPT = `You are an AI assistant that decides what information needs to be retrieved from a user's knowledge base called TriliumNext Notes to answer the user's question.
const PROMPT = `You are an AI assistant that decides what information needs to be retrieved from a user's knowledge base called Trilium Notes to answer the user's question.
Given the user's question, generate 3-5 specific search queries that would help find relevant information.
Each query should be focused on a different aspect of the question.
Avoid generating queries that are too broad, vague, or about a user's entire Note database, and make sure they are relevant to the user's question.
@@ -308,7 +308,7 @@ Example: ["exact topic mentioned", "related concept 1", "related concept 2"]`
): Promise<SubQuery[]> {
try {
// Use the proven prompt format that was working before
const prompt = `You are an AI assistant that decides what information needs to be retrieved from a user's knowledge base called TriliumNext Notes to answer the user's question.
const prompt = `You are an AI assistant that decides what information needs to be retrieved from a user's knowledge base called Trilium Notes to answer the user's question.
Given the user's question, generate 3-5 specific search queries that would help find relevant information.
Each query should be focused on a different aspect of the question.
Avoid generating queries that are too broad, vague, or about a user's entire Note database, and make sure they are relevant to the user's question.

View File

@@ -11,7 +11,7 @@ vi.mock('../../log.js', () => ({
}
}));
describe('Provider Streaming Integration Tests', () => {
describe.skip('Provider Streaming Integration Tests', () => {
let mockProviderOptions: ProviderStreamOptions;
beforeEach(() => {
@@ -70,7 +70,7 @@ describe('Provider Streaming Integration Tests', () => {
expect(result.completeText).toBe('Hello world!');
expect(result.chunkCount).toBe(4);
expect(receivedChunks.length).toBeGreaterThan(0);
// Verify callback received content chunks
const contentChunks = receivedChunks.filter(c => c.text);
expect(contentChunks.length).toBe(3);
@@ -101,10 +101,10 @@ describe('Provider Streaming Integration Tests', () => {
choices: [{ delta: { content: 'The answer is 4' } }],
model: 'gpt-3.5-turbo'
},
{
{
choices: [{ finish_reason: 'stop' }],
model: 'gpt-3.5-turbo',
done: true
done: true
}
];
@@ -174,7 +174,7 @@ describe('Provider Streaming Integration Tests', () => {
expect(result.completeText).toBe('The weather today is sunny.');
expect(result.chunkCount).toBe(4);
// Verify final chunk has usage stats
expect(result.finalChunk.prompt_eval_count).toBe(15);
expect(result.finalChunk.eval_count).toBe(8);
@@ -319,7 +319,7 @@ describe('Provider Streaming Integration Tests', () => {
);
expect(result.completeText).toBe('Based on my analysis, the answer is 42.');
// Verify thinking states were captured
const thinkingChunks = receivedChunks.filter(c => c.chunk?.message?.thinking);
expect(thinkingChunks.length).toBe(2);
@@ -332,7 +332,7 @@ describe('Provider Streaming Integration Tests', () => {
async *[Symbol.asyncIterator]() {
yield { message: { content: 'Starting...' } };
// Simulate timeout
await new Promise((_, reject) =>
await new Promise((_, reject) =>
setTimeout(() => reject(new Error('Request timeout')), 100)
);
}
@@ -479,9 +479,9 @@ describe('Provider Streaming Integration Tests', () => {
});
describe('Memory Management', () => {
it('should not leak memory during long streaming sessions', async () => {
it.skip('should not leak memory during long streaming sessions', async () => {
// Reduced chunk count for CI stability - still tests memory management
const chunkCount = 1000; // Reduced from 10000
const chunkCount = 500; // Reduced from 10000
const longSessionIterator = {
async *[Symbol.asyncIterator]() {
for (let i = 0; i < chunkCount; i++) {
@@ -489,7 +489,7 @@ describe('Provider Streaming Integration Tests', () => {
message: { content: `Chunk ${i} with some additional content to increase memory usage` },
done: i === (chunkCount - 1)
};
// Periodic yield to event loop to prevent blocking
if (i % 50 === 0) { // More frequent yields for shorter test
await new Promise(resolve => setImmediate(resolve));
@@ -499,16 +499,16 @@ describe('Provider Streaming Integration Tests', () => {
};
const initialMemory = process.memoryUsage();
const result = await processProviderStream(
longSessionIterator,
mockProviderOptions
);
const finalMemory = process.memoryUsage();
expect(result.chunkCount).toBe(chunkCount);
// Memory increase should be reasonable (less than 20MB for smaller test)
const memoryIncrease = finalMemory.heapUsed - initialMemory.heapUsed;
expect(memoryIncrease).toBeLessThan(20 * 1024 * 1024);
@@ -581,4 +581,4 @@ describe('Provider Streaming Integration Tests', () => {
)).rejects.toThrow('Invalid stream iterator');
});
});
});
});

View File

@@ -73,7 +73,7 @@ function error(message: string | Error | unknown) {
log(`ERROR: ${message}`);
}
const requestBlacklist = ["/libraries", "/app", "/images", "/stylesheets", "/api/recent-notes"];
const requestBlacklist = ["/app", "/images", "/stylesheets", "/api/recent-notes"];
function request(req: Request, res: Response, timeMs: number, responseLength: number | string = "?") {
for (const bl of requestBlacklist) {

View File

@@ -98,7 +98,7 @@ const defaultOptions: DefaultOption[] = [
{ name: "codeLineWrapEnabled", value: "true", isSynced: false },
{
name: "codeNotesMimeTypes",
value: '["text/x-csrc","text/x-c++src","text/x-csharp","text/css","text/x-go","text/x-groovy","text/x-haskell","text/html","message/http","text/x-java","application/javascript;env=frontend","application/javascript;env=backend","application/json","text/x-kotlin","text/x-markdown","text/x-perl","text/x-php","text/x-python","text/x-ruby",null,"text/x-sql","text/x-sqlite;schema=trilium","text/x-swift","text/xml","text/x-yaml","text/x-sh","application/typescript"]',
value: '["text/x-csrc","text/x-c++src","text/x-csharp","text/css","text/x-elixir","text/x-go","text/x-groovy","text/x-haskell","text/html","message/http","text/x-java","application/javascript;env=frontend","application/javascript;env=backend","application/json","text/x-kotlin","text/x-markdown","text/x-perl","text/x-php","text/x-python","text/x-ruby",null,"text/x-sql","text/x-sqlite;schema=trilium","text/x-swift","text/xml","text/x-yaml","text/x-sh","application/typescript"]',
isSynced: true
},
{ name: "leftPaneWidth", value: "25", isSynced: false },

View File

@@ -2,6 +2,7 @@
import optionService from "./options.js";
import config from "./config.js";
import { normalizeUrl } from "./utils.js";
/*
* Primary configuration for sync is in the options (document), but we allow to override
@@ -17,7 +18,10 @@ function get(name: keyof typeof config.Sync) {
export default {
// env variable is the easiest way to guarantee we won't overwrite prod data during development
// after copying prod document/data directory
getSyncServerHost: () => get("syncServerHost"),
getSyncServerHost: () => {
const host = get("syncServerHost");
return host ? normalizeUrl(host) : host;
},
isSyncSetup: () => {
const syncServerHost = get("syncServerHost");

View File

@@ -628,3 +628,56 @@ describe("#formatDownloadTitle", () => {
});
});
});
describe("#normalizeUrl", () => {
const testCases: TestCase<typeof utils.normalizeUrl>[] = [
[ "should remove trailing slash from simple URL", [ "https://example.com/" ], "https://example.com" ],
[ "should remove trailing slash from URL with path", [ "https://example.com/path/" ], "https://example.com/path" ],
[ "should preserve URL without trailing slash", [ "https://example.com" ], "https://example.com" ],
[ "should preserve URL without trailing slash with path", [ "https://example.com/path" ], "https://example.com/path" ],
[ "should preserve protocol-only URLs", [ "https://" ], "https://" ],
[ "should preserve protocol-only URLs", [ "http://" ], "http://" ],
[ "should fix double slashes in path", [ "https://example.com//api//test" ], "https://example.com/api/test" ],
[ "should handle multiple double slashes", [ "https://example.com///api///test" ], "https://example.com/api/test" ],
[ "should handle trailing slash with double slashes", [ "https://example.com//api//" ], "https://example.com/api" ],
[ "should preserve protocol double slash", [ "https://example.com/api" ], "https://example.com/api" ],
[ "should handle empty string", [ "" ], "" ],
[ "should handle whitespace-only string", [ " " ], "" ],
[ "should trim whitespace", [ " https://example.com/ " ], "https://example.com" ],
[ "should handle null as empty", [ null as any ], null ],
[ "should handle undefined as empty", [ undefined as any ], undefined ]
];
testCases.forEach((testCase) => {
const [ desc, fnParams, expected ] = testCase;
it(desc, () => {
const result = utils.normalizeUrl(...fnParams);
expect(result).toStrictEqual(expected);
});
});
});
describe("#normalizeCustomHandlerPattern", () => {
const testCases: TestCase<typeof utils.normalizeCustomHandlerPattern>[] = [
[ "should handle pattern without ending - add both versions", [ "foo" ], [ "foo", "foo/" ] ],
[ "should handle pattern with trailing slash - add both versions", [ "foo/" ], [ "foo", "foo/" ] ],
[ "should handle pattern ending with $ - add optional slash", [ "foo$" ], [ "foo/?$" ] ],
[ "should handle pattern with trailing slash and $ - add both versions", [ "foo/$" ], [ "foo$", "foo/$" ] ],
[ "should preserve existing optional slash pattern", [ "foo/?$" ], [ "foo/?$" ] ],
[ "should preserve existing optional slash pattern (alternative)", [ "foo/?)" ], [ "foo/?)" ] ],
[ "should handle regex pattern with special chars", [ "api/[a-z]+$" ], [ "api/[a-z]+/?$" ] ],
[ "should handle complex regex pattern", [ "user/([0-9]+)/profile$" ], [ "user/([0-9]+)/profile/?$" ] ],
[ "should handle empty string", [ "" ], [ "" ] ],
[ "should handle whitespace-only string", [ " " ], [ "" ] ],
[ "should handle null", [ null as any ], [ null ] ],
[ "should handle undefined", [ undefined as any ], [ undefined ] ]
];
testCases.forEach((testCase) => {
const [ desc, fnParams, expected ] = testCase;
it(desc, () => {
const result = utils.normalizeCustomHandlerPattern(...fnParams);
expect(result).toStrictEqual(expected);
});
});
});

View File

@@ -375,6 +375,85 @@ export function safeExtractMessageAndStackFromError(err: unknown): [errMessage:
return (err instanceof Error) ? [err.message, err.stack] as const : ["Unknown Error", undefined] as const;
}
/**
* Normalizes URL by removing trailing slashes and fixing double slashes.
* Preserves the protocol (http://, https://) but removes trailing slashes from the rest.
*
* @param url The URL to normalize
* @returns The normalized URL without trailing slashes
*/
export function normalizeUrl(url: string | null | undefined): string | null | undefined {
if (!url || typeof url !== 'string') {
return url;
}
// Trim whitespace
url = url.trim();
if (!url) {
return url;
}
// Fix double slashes (except in protocol) first
url = url.replace(/([^:]\/)\/+/g, '$1');
// Remove trailing slash, but preserve protocol
if (url.endsWith('/') && !url.match(/^https?:\/\/$/)) {
url = url.slice(0, -1);
}
return url;
}
/**
* Normalizes a path pattern for custom request handlers.
* Ensures both trailing slash and non-trailing slash versions are handled.
*
* @param pattern The original pattern from customRequestHandler attribute
* @returns An array of patterns to match both with and without trailing slash
*/
export function normalizeCustomHandlerPattern(pattern: string | null | undefined): (string | null | undefined)[] {
if (!pattern || typeof pattern !== 'string') {
return [pattern];
}
pattern = pattern.trim();
if (!pattern) {
return [pattern];
}
// If pattern already ends with optional trailing slash, return as-is
if (pattern.endsWith('/?$') || pattern.endsWith('/?)')) {
return [pattern];
}
// If pattern ends with $, handle it specially
if (pattern.endsWith('$')) {
const basePattern = pattern.slice(0, -1);
// If already ends with slash, create both versions
if (basePattern.endsWith('/')) {
const withoutSlash = basePattern.slice(0, -1) + '$';
const withSlash = pattern;
return [withoutSlash, withSlash];
} else {
// Add optional trailing slash
const withSlash = basePattern + '/?$';
return [withSlash];
}
}
// For patterns without $, add both versions
if (pattern.endsWith('/')) {
const withoutSlash = pattern.slice(0, -1);
return [withoutSlash, pattern];
} else {
const withSlash = pattern + '/';
return [pattern, withSlash];
}
}
export default {
compareVersions,
@@ -400,6 +479,8 @@ export default {
md5,
newEntityId,
normalize,
normalizeCustomHandlerPattern,
normalizeUrl,
quoteRegex,
randomSecureToken,
randomString,

View File

@@ -45,7 +45,7 @@ async function createExtraWindow(extraWindowHash: string) {
const win = new BrowserWindow({
width: 1000,
height: 800,
title: "TriliumNext Notes",
title: "Trilium Notes",
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
@@ -155,7 +155,7 @@ async function createMainWindow(app: App) {
height: mainWindowState.height,
minWidth: 500,
minHeight: 400,
title: "TriliumNext Notes",
title: "Trilium Notes",
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
@@ -257,7 +257,7 @@ async function configureWebContents(webContents: WebContents, spellcheckEnabled:
}
function getIcon() {
return path.join(RESOURCE_DIR, "images/app-icons/png/256x256" + (isDev ? "-dev" : "") + ".png");
return path.join(RESOURCE_DIR, "../public/assets/icon.png");
}
async function createSetupWindow() {
@@ -268,7 +268,7 @@ async function createSetupWindow() {
width,
height,
resizable: false,
title: "TriliumNext Notes Setup",
title: "Trilium Notes Setup",
icon: getIcon(),
webPreferences: {
// necessary for e.g. utils.isElectron()

View File

@@ -11,10 +11,17 @@ export default defineConfig(() => ({
setupFiles: ["./spec/setup.ts"],
environment: "node",
include: ['{src,spec}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: [
"spec/build-checks/**",
],
reporters: [
"verbose"
],
coverage: {
reportsDirectory: './test-output/vitest/coverage',
provider: 'v8' as const,
reporter: [ "text", "html" ]
}
},
pool: "threads"
},
}));

View File

@@ -0,0 +1,18 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';
export default defineConfig(() => ({
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/server',
plugins: [],
test: {
watch: false,
globals: true,
setupFiles: ["./spec/setup.ts"],
environment: "node",
include: ['spec/build-checks/**'],
reporters: [
"verbose"
]
},
}));