-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to new-note-namer, to underline the heading instead of highlighting it with # #249
Changes from 2 commits
d67df29
67e1b2b
245ce3a
95283ed
03b91a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import QOwnNotesTypes 1.0 | |
*/ | ||
QtObject { | ||
property bool extraDialogForFileName; | ||
property bool underlineHeading; | ||
property variant settingsVariables: [ | ||
{ | ||
'identifier': 'extraDialogForFileName', | ||
|
@@ -16,6 +17,13 @@ QtObject { | |
'type': 'boolean', | ||
'default': 'false', | ||
}, | ||
{ | ||
'identifier': 'underlineHeading', | ||
'name': 'Underline heading', | ||
'description': 'Highlight the first line by underlining it with =, if not checked, use a preceding # instead.', | ||
'type': 'boolean', | ||
'default': 'false', | ||
}, | ||
]; | ||
|
||
function init() { | ||
|
@@ -41,7 +49,11 @@ QtObject { | |
script.log(note.fileCreated) | ||
script.log(note.fileLastModified) | ||
|
||
return "# " + newName; | ||
if (underlineHeading){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a space, like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
return newName + "\n========================" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you rather want to count how many There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is a great idea. The updated file contains that feature. |
||
} else { | ||
return "# " + newName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please adapt the amount of whitespace? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed my portion of the code. The original script is not properly consistent with its use of whitespace in the first place. Please let me know if I shall unify the whitespacing throughout the whole script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole script is a mess, you are right. Please do so in another PR. |
||
} | ||
} | ||
|
||
function handleNoteTextFileNameHook(note) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
"
for strings, and add a space before the string.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed