Skip to content

Commit f29c692

Browse files
committed
feat: sorting options
1 parent e9e1f77 commit f29c692

9 files changed

Lines changed: 847 additions & 794 deletions

File tree

.editorconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ root = true
44
[*]
55
charset = utf-8
66
insert_final_newline = true
7-
indent_style = tab
8-
indent_size = 4
9-
tab_width = 4
7+
indent_style = space
8+
indent_size = 2

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
npm node_modules
2-
build
2+
build
3+
main.js

.prettierrc.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
endOfLine: lf
3+
4+
# Specify the line length that the printer will wrap on.
5+
# 120 matches Rubocop defaults
6+
printWidth: 120
7+
8+
# Specify the number of spaces per indentation-level.
9+
tabWidth: 2
10+
11+
# Don't indent lines with tabs instead of spaces.
12+
useTabs: false
13+
14+
# add a semicolon at the end of every line
15+
semi: true
16+
17+
# Only add quotes around object properties where required.
18+
quoteProps: as-needed
19+
20+
# Print spaces between brackets in object literals.
21+
# It's easier to read and parse
22+
bracketSpacing: true
23+
24+
# Print trailing commas wherever possible.
25+
# - "none" no trailing commas
26+
# - "es5" trailing commas where valid in ES5 (objects, arrays, etc)
27+
# - "all" trailing commas wherever possible (function arguments)
28+
trailingComma: es5
29+
30+
# Include parentheses around a sole arrow function parameter.
31+
arrowParens: always
32+

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,60 @@ Waypoint is an Obsidian plugin that automatically generates tables of contents/M
3232

3333
Note that since waypoints can only be generated in folder notes, **it is highly recommended that you install a plugin like [Folder Note](https://github.com/xpgo/obsidian-folder-note-plugin)** to ensure that folder notes don't get lost after folder renames and other actions that change the file tree. If a folder note containing a waypoint is renamed to something other than the folder's name, the waypoint will no longer be updated.
3434

35+
### Ordering Notes on Waypoint
36+
37+
Waypoint provides the following methods for sorting your Notes:
38+
39+
- Natural
40+
- Lexicographic
41+
- Priority
42+
- Folders First
43+
44+
#### Natural Sort Order
45+
46+
This is the default setting. Filenames are sorted alphabetically, except numeric portions are sorted in numerical order.
47+
48+
```text
49+
- Note
50+
- Note1
51+
- Note2
52+
- Note100
53+
```
54+
55+
#### Lexicograhic Order
56+
57+
Filenames are sorted entirely alphabetically.
58+
59+
```text
60+
- Note
61+
- Note1
62+
- Note100
63+
- Note2
64+
```
65+
66+
#### Folders First
67+
68+
- All folders appear at the top of the list and are sorted in a natural sort order
69+
- Files appear after any folders and sorted in natural sort order
70+
71+
#### Priority Sort Order
72+
73+
By default, notes in Waypoint are sorted alphabetically. However, with priority sort enabled, you can organize your notes in a specific order by enabling setting their Waypoint priorities. To do this, you would add an entry in your [note metadata](https://help.obsidian.md/Editing+and+formatting/Metadata) with a numeric value, such as:
74+
75+
```markdown
76+
---
77+
waypointPriority: 0
78+
---
79+
80+
# My note
81+
```
82+
83+
Waypoint will then sort the notes based on the numeric value assigned to `waypointPriority`. Smaller values correspond to higher priority, so a note with `waypointPriority: 0` will appear above a note with `waypointPriority: 1`. If two notes have the same priority, they will be sorted alphabetically.
84+
85+
In case a note does not have a `waypointPriority` defined, it will fall back to the default alphabetical sorting strategy.
86+
87+
The `waypointPriority` key can be customized to a different key label in the Waypoint settings. This functionality works for both regular notes and folder notes.
88+
3589
## Current Limitations
3690

3791
- **Waypoints can only be created within a folder note**

0 commit comments

Comments
 (0)