You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* custom syntax new-note-namer
* fix new note namer
* simplify interface
* add extra dialog for more versability
* adding a readme with full instructions
* trigger new CI
* lint: format file
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
* We're making the new-note-namer script upgrade-safe for existing users. The code and README are
updated with backward-compatible migration logic for the renamed heading setting.
* run prettier on README
---------
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
Co-authored-by: luginf <alan@luginf>
Co-authored-by: Patrizio Bekerle <patrizio@bekerle.com>
"description": "Enables a dialog window (or two) so the user can choose the note title and file name at the moment of creation. <br> Specially useful when the 'Allow note file name to be different to note title. \n No more cumbersome renaming :)"
9
+
"description": "Enables a dialog window (or two, or even none) so the user can choose the note title and file name at the moment of creation, or simply use the search term for the filename and title of the note with custom formattings. <br><br> Specially useful when the 'Allow note file name to be different to note title. \n No more cumbersome renaming :)"
Copy file name to clipboardExpand all lines: new-note-namer/new-note-namer.qml
+96-33Lines changed: 96 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -7,63 +7,126 @@ import QOwnNotesTypes 1.0
7
7
Avoids cumbersome renaming and title editing.
8
8
*/
9
9
QtObject {
10
+
property bool extraDialogForTitle
10
11
property bool extraDialogForFileName
12
+
property string headingStyle
13
+
property string _searchTerm:""
14
+
property string customHeadingOpen
15
+
property string customHeadingClose
16
+
property bool underlineHeading // deprecated — kept so existing stored settings still load
11
17
property variant settingsVariables: [
18
+
{
19
+
'identifier':'extraDialogForTitle',
20
+
'name':'Show a dialog to define the note title',
21
+
'description':'If checked, ask for a custom note title.',
22
+
'type':'boolean',
23
+
'default':'false'
24
+
},
12
25
{
13
26
'identifier':'extraDialogForFileName',
14
-
'name':'Extra dialog for note title',
15
-
'description':'Show an additional dialog window so user can write a file name different to the note title.',
27
+
'name':'Show a dialog to define the file name',
28
+
'description':'If checked, ask for a custom file name.',
16
29
'type':'boolean',
17
30
'default':'false'
18
31
},
32
+
{
33
+
'identifier':'headingStyle',
34
+
'name':'Heading style',
35
+
'description':'Title format for new notes.',
36
+
'type':'selection',
37
+
'default':'0',
38
+
'items': {
39
+
'0':'ATX Markdown heading (# Title)',
40
+
'1':'Setext Markdown heading (Title / =====)',
41
+
'2':'Custom heading (opening and closing tags)'
42
+
}
43
+
},
44
+
{
45
+
'identifier':'customHeadingOpen',
46
+
'name':'Custom heading – opening tag',
47
+
'description':'Text inserted before the note name (only used when heading style is "Custom").',
48
+
'type':'string',
49
+
'default':''
50
+
},
51
+
{
52
+
'identifier':'customHeadingClose',
53
+
'name':'Custom heading – closing tag',
54
+
'description':'Text inserted after the note name (only used when heading style is "Custom").',
55
+
'type':'string',
56
+
'default':''
57
+
},
19
58
{
20
59
'identifier':'underlineHeading',
21
-
'name':'Underline heading',
22
-
'description':'Highlight the first line by underlining it with =, if not checked, use a preceding # instead.',
60
+
'name':'Underline heading (deprecated)',
61
+
'description':'Deprecated: use "Heading style" above instead. Kept so that users upgrading from v0.0.2 automatically keep their Setext-heading preference without needing to change settings.',
23
62
'type':'boolean',
24
63
'default':'false'
25
64
},
26
65
]
27
-
property bool underlineHeading
28
66
29
-
functionhandleNewNoteHeadlineHook(note) {
30
-
var newName =newNamer("New note", "New note title", "Title");
31
-
script.log(note.fileCreated);
32
-
script.log(note.fileLastModified);
33
-
34
-
if (underlineHeading) {
35
-
return newName +"\n"+"=".repeat(newName.length);
67
+
functionhandleNewNoteHeadlineHook(headline) {
68
+
// 'headline' is a plain string (the search term or default text), not a Note object.
0 commit comments