Skip to content

Build your personal knowledge base with Trilium Notes

Merge remote-tracking branch 'origin/main' into add-multisort

Elian Doran1479d842c443
diff --cc apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.html
index 70893bf2f2,ae02964c95..277867cddb
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.html
@@@ -29,43 -27,30 +29,38 @@@
</td>
<td>
<p>Keeps child notes sorted by title alphabetically.</p>
- <p>When given a value, it will sort by the value of another label instead.
- If one of the child notes doesn't have the specified label, the title will
- be used for them instead.</p>
+ <p>When given a value, it will sort by other criteria instead: a comma-separated
- list of levels, each <code spellcheck="false">title</code>, <code spellcheck="false">dateCreated</code>, <code
- spellcheck="false">dateModified</code> or the name of a label on the child
- notes, optionally followed by <code spellcheck="false">asc</code> or <code
- spellcheck="false">desc</code>, as in a search's <code spellcheck="false">orderBy</code>.
- For example <code spellcheck="false">#sorted="priority desc, dueDate"</code> sorts
++ list of levels, each <code>title</code>, <code>dateCreated</code>, <code>dateModified</code> or the name of a label on the child
++ notes, optionally followed by <code>asc</code> or <code>desc</code>, as in a search's <code>orderBy</code>.
++ For example <code>#sorted="priority desc, dueDate"</code> sorts
+ by priority, highest first, and notes of equal priority by due date. A
+ child note without a level's label sorts after every child that has it,
+ whichever direction the level runs in. When neither note has the label,
+ the next level decides.</p>
</td>
</tr>
<tr>
- <td><code spellcheck="false">#sortDirection</code>
+ <td><code>#sortDirection</code>
</td>
<td>
- <p>If <code spellcheck="false">sorted</code> is applied, specifies the direction
- of the sort:</p>
+ <p>If <code>sorted</code> is applied, specifies the direction of the sort:</p>
<ul>
- <li><code spellcheck="false">ASC</code>, ascending (default)</li>
- <li><code spellcheck="false">DESC</code>, descending</li>
+ <li><code>ASC</code>, ascending (default)</li>
+ <li><code>DESC</code>, descending</li>
</ul>
- <p>A level of <code spellcheck="false">sorted</code> followed by its own <code
- spellcheck="false">asc</code> or <code spellcheck="false">desc</code> keeps
++ <p>A level of <code>sorted</code> followed by its own <code>asc</code> or <code>desc</code> keeps
+ that direction regardless.</p>
</td>
</tr>
<tr>
- <td><code spellcheck="false">#sortFoldersFirst</code>
+ <td><code>#sortFoldersFirst</code>
</td>
- <td>If <code spellcheck="false">sorted</code> is applied, folders (notes with
- children) will be sorted as a group at the top (at the bottom when <code
- spellcheck="false">#sortDirection</code> is <code spellcheck="false">desc</code>),
- <td>If <code>sorted</code> is applied, folders (notes with children) will be
- sorted as a group at the top, and the rest will be sorted.</td>
++ <td>If <code>sorted</code> is applied, folders (notes with
++ children) will be sorted as a group at the top (at the bottom when <code>#sortDirection</code> is <code>desc</code>),
+ and the rest will be sorted.</td>
</tr>
<tr>
- <td><code spellcheck="false">#sortNatural</code>
+ <td><code>#sortNatural</code>
</td>
<td>Sort numbers naturally instead of alphabetically, so 2 comes before 10.</td>
</tr>
@@@ -95,33 -80,23 +90,30 @@@
priority. Lower priority levels are applied only if higher priority comparisons
result in equality.</p>
<ol>
- <li><strong>Top Label Sorting</strong>: Child notes with the <code spellcheck="false">#top</code> label
+ <li><strong>Top Label Sorting</strong>: Child notes with the <code>#top</code> label
will appear at the top of the folder.</li>
<li><strong>Bottom Label Sorting</strong>: (Introduced in Trilium 0.62) Child
- notes with the <code spellcheck="false">#bottom</code> label will appear
- at the bottom of the folder.</li>
+ notes with the <code>#bottom</code> label will appear at the bottom of the
+ folder.</li>
<li><strong>Property/Label-Based Sorting</strong>: Sorting is based on the
- parent note's <code spellcheck="false">#sorted</code> label:
+ parent note's <code>#sorted</code> label:
<ul>
- <li><strong>Default Sorting</strong>: If <code spellcheck="false">#sorted</code> has
- no value, notes are sorted alphabetically.</li>
- <li><strong>Property Sorting</strong>: If <code spellcheck="false">#sorted</code> is
- set to <code spellcheck="false">title</code>, <code spellcheck="false">dateModified</code>,
- or <code spellcheck="false">dateCreated</code>, notes are sorted based on
- the specified property.</li>
- <li><strong>Label Sorting</strong>: If <code spellcheck="false">#sorted</code> has
- any other value, this value is treated as the name of a child note's label,
- and sorting is based on the values of this label. For example, setting <code
- spellcheck="false">#sorted=myOrder</code> on the parent note and using <code
- spellcheck="false">#myOrder=001</code>, <code spellcheck="false">#myOrder=002</code>,
+ <li><strong>Default Sorting</strong>: If <code>#sorted</code> has no value,
+ notes are sorted alphabetically.</li>
+ <li><strong>Property Sorting</strong>: If <code>#sorted</code> is set to <code>title</code>, <code>dateModified</code>,
+ or <code>dateCreated</code>, notes are sorted based on the specified property.</li>
+ <li><strong>Label Sorting</strong>: If <code>#sorted</code> has any other value,
+ this value is treated as the name of a child note's label, and sorting
+ is based on the values of this label. For example, setting <code>#sorted=myOrder</code> on
+ the parent note and using <code>#myOrder=001</code>, <code>#myOrder=002</code>,
etc., on child notes.</li>
+ <li><strong>Multi-Level Sorting</strong>: Several of the above can be combined,
+ separated by commas; each level is applied only where the previous ones
+ are equal. Every level can carry its own direction as a word after the
- name, <code spellcheck="false">asc</code> or <code spellcheck="false">desc</code>,
- otherwise it follows <code spellcheck="false">#sortDirection</code>. For
- example <code spellcheck="false">#sorted="priority desc, area, dateCreated"</code> sorts
++ name, <code>asc</code> or <code>desc</code>,
++ otherwise it follows <code>#sortDirection</code>. For
++ example <code>#sorted="priority desc, area, dateCreated"</code> sorts
+ by priority, highest first, then by area, then by creation date.</li>
</ul>
</li>
<li><strong>Alphabetical Sorting</strong>: Used as a last resort when other
diff --cc docs/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.md
index ce752ef7f9,c905f11473..f68cd0bbf9
--- a/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.md
+++ b/docs/User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes.md
@@@ -23,19 -23,19 +23,19 @@@ Child notes can be automatically sorte
</thead>
<tbody>
<tr>
- <td><code spellcheck="false">#sorted</code></td>
- <td><p>Keeps child notes sorted by title alphabetically.</p><p>When given a value, it will sort by other criteria instead: a comma-separated list of levels, each <code spellcheck="false">title</code>, <code spellcheck="false">dateCreated</code>, <code spellcheck="false">dateModified</code> or the name of a label on the child notes, optionally followed by <code spellcheck="false">asc</code> or <code spellcheck="false">desc</code>, as in a search's <code spellcheck="false">orderBy</code>. For example <code spellcheck="false">#sorted="priority desc, dueDate"</code> sorts by priority, highest first, and notes of equal priority by due date. A child note without a level's label sorts after every child that has it, whichever direction the level runs in. When neither note has the label, the next level decides.</p></td>
+ <td><code>#sorted</code></td>
- <td><p>Keeps child notes sorted by title alphabetically.</p><p>When given a value, it will sort by the value of another label instead. If one of the child notes doesn't have the specified label, the title will be used for them instead.</p></td>
++ <td><p>Keeps child notes sorted by title alphabetically.</p><p>When given a value, it will sort by other criteria instead: a comma-separated list of levels, each <code>title</code>, <code>dateCreated</code>, <code>dateModified</code> or the name of a label on the child notes, optionally followed by <code>asc</code> or <code>desc</code>, as in a search's <code>orderBy</code>. For example <code>#sorted="priority desc, dueDate"</code> sorts by priority, highest first, and notes of equal priority by due date. A child note without a level's label sorts after every child that has it, whichever direction the level runs in. When neither note has the label, the next level decides.</p></td>
</tr>
<tr>
- <td><code spellcheck="false">#sortDirection</code></td>
- <td><p>If <code spellcheck="false">sorted</code> is applied, specifies the direction of the sort:</p><ul><li><code spellcheck="false">ASC</code>, ascending (default)</li><li><code spellcheck="false">DESC</code>, descending</li></ul><p>A level of <code spellcheck="false">sorted</code> followed by its own <code spellcheck="false">asc</code> or <code spellcheck="false">desc</code> keeps that direction regardless.</p></td>
+ <td><code>#sortDirection</code></td>
- <td><p>If <code>sorted</code> is applied, specifies the direction of the sort:</p><ul><li><code>ASC</code>, ascending (default)</li><li><code>DESC</code>, descending</li></ul></td>
++ <td><p>If <code>sorted</code> is applied, specifies the direction of the sort:</p><ul><li><code>ASC</code>, ascending (default)</li><li><code>DESC</code>, descending</li></ul><p>A level of <code>sorted</code> followed by its own <code>asc</code> or <code>desc</code> keeps that direction regardless.</p></td>
</tr>
<tr>
- <td><code spellcheck="false">#sortFoldersFirst</code></td>
- <td>If <code spellcheck="false">sorted</code> is applied, folders (notes with children) will be sorted as a group at the top (at the bottom when <code spellcheck="false">#sortDirection</code> is <code spellcheck="false">desc</code>), and the rest will be sorted.</td>
+ <td><code>#sortFoldersFirst</code></td>
- <td>If <code>sorted</code> is applied, folders (notes with children) will be sorted as a group at the top, and the rest will be sorted.</td>
++ <td>If <code>sorted</code> is applied, folders (notes with children) will be sorted as a group at the top (at the bottom when <code>#sortDirection</code> is <code>desc</code>), and the rest will be sorted.</td>
</tr>
<tr>
- <td><code spellcheck="false">#sortNatural</code></td>
+ <td><code>#sortNatural</code></td>
<td>Sort numbers naturally instead of alphabetically, so 2 comes before 10.</td>
</tr>
<tr>