diff --git a/CHANGELOG.md b/CHANGELOG.md index 949a3d4..466a784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## not released +## v1.2.1 (2023-11-19) + +- Add: Option to preserve source note title in the combined note text + ## v1.2.0 (2023-11-14) - Add: Translation to German diff --git a/README.md b/README.md index ea5b216..6a99fc4 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Go to `Tools > Options > Combine notes` - `Create combined note as to-do`: New note is created as To-Do. Default `false` - `Delete combined notes`: Delete combined notes, after note creation. Default `false` +- `Preserve Source Note Titles`: Titles of source notes will be embedded in new note. Default `true`. - `Preserve Source URL`: The source URL will be added to the new note. Default `false` - `Preserve Created Date`: The Created Date will be added to the new note. Default `false` - `Preserve Updated Date`: The Updated Date will be added to the new note. Default `false` @@ -38,7 +39,7 @@ Go to `Tools > Options > Combine notes` - `Metadata Prefix`: The entered text is output before the metadata (URL, Date, Location). - `Metadata Suffix`: The entered text is output after the metadata (URL, Date, Location). - `Title of the combined note`: New title of the combined note. Default `Combined note`. -- `Custom note title`: New note title with possible variables `{{FIRSTTITLE}}`, `{{LASTTITLE}}`, `{{ALLTITLE}}` and `{{DATE}}`. +- `Custom note title`: New note title with possible variables `{{FIRSTTITLE}}`, `{{LASTTITLE}}`, `{{ALLTITLE}}` and `{{DATE}}`. ## Keyboard Shortcuts diff --git a/package-lock.json b/package-lock.json index 49452a6..6dbfd0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "joplin-plugin-combine-notes", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "joplin-plugin-combine-notes", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "dependencies": { "i18n": "^0.15.1", diff --git a/package.json b/package.json index e64be21..c41d66f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "joplin-plugin-combine-notes", - "version": "1.2.0", + "version": "1.2.1", "scripts": { "prepare": "npm run dist && husky install", "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive", diff --git a/src/combineNote.ts b/src/combineNote.ts index 7fe581d..ae874a4 100644 --- a/src/combineNote.ts +++ b/src/combineNote.ts @@ -60,6 +60,10 @@ namespace combineNote { const preserveMetadataSuffix = await joplin.settings.value( "preserveMetadataSuffix" ); + const preserveSourceNoteTitles = await joplin.settings.value( + "preserveSourceNoteTitles" + ); + const addCombineDate = await joplin.settings.value("addCombineDate"); const dateFormat = await joplin.settings.globalValue("dateFormat"); const timeFormat = await joplin.settings.globalValue("timeFormat"); @@ -86,7 +90,9 @@ namespace combineNote { "altitude", ], }); - newNoteBody.push("# " + note.title + "\n"); + if (preserveSourceNoteTitles === true) { + newNoteBody.push("# " + note.title + "\n"); + } titles.push(note.title); // Preserve metadata diff --git a/src/locales/de_DE.json b/src/locales/de_DE.json index a160736..6639738 100644 --- a/src/locales/de_DE.json +++ b/src/locales/de_DE.json @@ -15,6 +15,8 @@ "settings.preserveMetadataPrefixDescription": "Präfix für den Abschnitt Metadaten.", "settings.preserveMetadataSuffix": "Metadata-Suffix", "settings.preserveMetadataSuffixDescription": "Suffix für den Abschnitt Metadaten.", + "settings.preserveSourceNoteTitles": "Titel der Quellnotizen beibehalten", + "settings.preserveSourceNoteTitlesDescription": "Behält die Titel der Orginal Notizen bei, indem diese im Notiztext eingefügt werden.", "settings.combinedNoteTitle": "Titel der Kombinierten Notiz", "settings.combinedNoteTitleValueDefault": "Kombinierte Notiz", "settings.combinedNoteTitleValueCombined": "Kombination aus allen Notiztitel", diff --git a/src/locales/en_US.json b/src/locales/en_US.json index caf3d67..cb6371a 100644 --- a/src/locales/en_US.json +++ b/src/locales/en_US.json @@ -15,6 +15,8 @@ "settings.preserveMetadataPrefixDescription": "Prefix for the Metadata section.", "settings.preserveMetadataSuffix": "Metadata Suffix", "settings.preserveMetadataSuffixDescription": "Suffix for the Metadata section.", + "settings.preserveSourceNoteTitles": "Preserve source note titles", + "settings.preserveSourceNoteTitlesDescription": "Preserves titles of selected notes within the combined note body", "settings.combinedNoteTitle": "Title of the combined note", "settings.combinedNoteTitleValueDefault": "Combined note", "settings.combinedNoteTitleValueCombined": "Combination of all note titles", diff --git a/src/manifest.json b/src/manifest.json index 87715ee..9ff3485 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,19 +2,14 @@ "manifest_version": 1, "id": "io.github.jackgruber.combine-notes", "app_min_version": "1.8.1", - "version": "1.2.0", + "version": "1.2.1", "name": "Combine notes", "description": "Combine one or more notes", "author": "JackGruber", "homepage_url": "https://github.com/JackGruber/joplin-plugin-combine-notes", "repository_url": "https://github.com/JackGruber/joplin-plugin-combine-notes", - "keywords": [ - "combine", - "merge" - ], - "categories": [ - "productivity" - ], + "keywords": ["combine", "merge"], + "categories": ["productivity"], "screenshots": [], "icons": {} -} \ No newline at end of file +} diff --git a/src/settings.ts b/src/settings.ts index 542c310..f48b6c3 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -26,6 +26,15 @@ export namespace settings { label: i18n.__("settings.deleteCombinedNotes"), }, + preserveSourceNoteTitles: { + value: true, + type: SettingItemType.Bool, + section: "combineNoteSection", + public: true, + label: i18n.__("settings.preserveSourceNoteTitles"), + description: i18n.__("settings.preserveSourceNoteTitlesDescription"), + }, + preserveMetadataSourceUrl: { value: false, type: SettingItemType.Bool, @@ -104,6 +113,7 @@ export namespace settings { custom: i18n.__("settings.combinedNoteTitleValueCustom"), }, }, + combinedNoteTitleCustom: { value: "", type: SettingItemType.String,