Skip to content

Commit

Permalink
Added toggle to underline the created heading, instead of highlightin…
Browse files Browse the repository at this point in the history
…g it with a preceding hashtag
  • Loading branch information
Mystechry authored Nov 28, 2024
1 parent 5e2fc76 commit d67df29
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion new-note-namer/new-note-namer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import QOwnNotesTypes 1.0
*/
QtObject {
property bool extraDialogForFileName;
property bool underlineHeading;
property variant settingsVariables: [
{
'identifier': 'extraDialogForFileName',
Expand All @@ -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() {
Expand All @@ -41,7 +49,11 @@ QtObject {
script.log(note.fileCreated)
script.log(note.fileLastModified)

return "# " + newName;
if (underlineHeading){
return newName + "\n========================"
} else {
return "# " + newName;
}
}

function handleNoteTextFileNameHook(note) {
Expand Down

0 comments on commit d67df29

Please sign in to comment.