From 23503e932dcd3aa824f396640e3f048884214a98 Mon Sep 17 00:00:00 2001 From: CIN-DEV-netizen Date: Wed, 24 Jun 2026 08:54:33 -0600 Subject: [PATCH] Add QuickCallouts QOwnNotes script Add a new QOwnNotes scripting extension 'QuickCallouts'. Includes QuickCallouts.qml which registers three custom actions (Info, Warning, Note) and inserts styled HTML callout blocks into notes, and info.json with metadata for the script. --- QuickCallouts/QuickCallouts.qml | 54 +++++++++++++++++++++++++++++++++ QuickCallouts/info.json | 10 ++++++ 2 files changed, 64 insertions(+) create mode 100644 QuickCallouts/QuickCallouts.qml create mode 100644 QuickCallouts/info.json diff --git a/QuickCallouts/QuickCallouts.qml b/QuickCallouts/QuickCallouts.qml new file mode 100644 index 0000000..3614322 --- /dev/null +++ b/QuickCallouts/QuickCallouts.qml @@ -0,0 +1,54 @@ +import QtQml 2.0 +import QOwnNotesTypes 1.0 + +Script { + /** + * Initializes the custom buttons and menu items in QOwnNotes + */ + function init() { + script.registerCustomAction("insertInfoCallout", "Insert Info Callout", "Info Callout", "dialog-information"); + script.registerCustomAction("insertWarningCallout", "Insert Warning Callout", "Warning Callout", "dialog-warning"); + script.registerCustomAction("insertNoteCallout", "Insert Note Callout", "Note Callout", "dialog-warning"); + } + + /** + * Triggers when you click the menu action or custom toolbar button + */ + function customActionInvoked(identifier) { + var selectedText = script.noteTextEditSelectedText(); + if (!selectedText) { + selectedText = "Type your note content here..."; + } + + var resultHtml = ""; + + switch (identifier) { + case "insertNoteCallout": + resultHtml = '
' + + '

📝 Note

' + + 'Items of Interest' + + '

' + selectedText + '

' + + '
'; + break; + + case "insertInfoCallout": + resultHtml = '
' + + '

💡 Tip

' + + '

' + selectedText + '

' + + '
'; + break; + + case "insertWarningCallout": + resultHtml = '
' + + '

⚠️ Caution

' + + 'Potential Pitfalls' + + '

' + selectedText + '

' + + '
'; + break; + } + + if (resultHtml !== "") { + script.noteTextEditWrite(resultHtml); + } + } +} diff --git a/QuickCallouts/info.json b/QuickCallouts/info.json new file mode 100644 index 0000000..c6c9d85 --- /dev/null +++ b/QuickCallouts/info.json @@ -0,0 +1,10 @@ +{ + "name": "QuickCallouts", + "identifier": "quickcallouts", + "script": "QuickCallouts.qml", + "authors": ["@CIN-DEV-netizen"], + "platforms": ["linux", "macos", "windows"], + "version": "0.0.1", + "minAppVersion": "26.06.7", + "description": "QuickCallouts is a plugin for the QOwnNotes markdown editor designed to streamline the insertion of callout blocks. Instead of manually typing complex syntax, users can instantly add Note, Info, and Warning blocks directly from the script menu. This tool helps organize and highlight critical information, tips, and alerts within your notes with a single click, making your documentation clearer and more structured.", +} \ No newline at end of file