Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions snippets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ Insert reusable text snippets into your notes via a selection dialog.
- **Scripting › Insert snippet** — choose a snippet from the list and insert it at the cursor
- **Scripting › Manage snippets** — add, edit, or delete snippets

You can also link those actions to a custom shortcut.

## Actions

One toolbar button is registered:

| Button | Action |
| ----------- | ---------------------------------------------------------- |
| **Snippet** | choose a snippet from the list and insert it at the cursor |

## Placeholders

Placeholders are replaced at insertion time.
Expand Down
4 changes: 2 additions & 2 deletions snippets/info.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "Text Snippets",
"identifier": "snippets",
"version": "0.1.0",
"version": "0.1.1",
"script": "snippets.qml",
"authors": ["@luginf"],
"platforms": ["linux", "macos", "windows"],
"minAppVersion": "26.4.11",
"description": "Insert and manage reusable text snippets with placeholders ($CURRENT_YEAR, $CURRENT_DATE, $UUID…) into notes.",
"description": "Insert and manage reusable text snippets.\n\n<b>Usage</b>\nYou can create templates of reusable text snippets from the custom actions menu 'Manage Snippets'. Then add them to your notes with 'insert snippets' from the same menu. \nYou can also use placeholders ($CURRENT_YEAR, $CURRENT_DATE, $UUID...) which will be replaced at insertion time.",
"resources": [
"InsertSnippetDialog.qml",
"ManageSnippetsDialog.qml",
Expand Down
6 changes: 3 additions & 3 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[
{
"content": "## Reference\n\nid$CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATEx$CURRENT_HOUR$CURRENT_MINUTE$CURRENT_SECOND\n\n\nSee also:\n- \n- \n\n#tag",
"name": "Reference"
"content": "## References \n\n$CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATE$CURRENT_HOUR$CURRENT_MINUTE$CURRENT_SECOND\n\n\nSee also:\n- \n- \n\n#tag",
"name": "References"
},
{
"content": "id$CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATEx$CURRENT_HOUR$CURRENT_MINUTE$CURRENT_SECOND",
"content": "$ZK_ID\n\n",
"name": "Zettelkasten_id"
}
]
14 changes: 11 additions & 3 deletions zettelkasten/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,28 @@ A QOwnNotes script that adds [Zettelkasten](https://en.wikipedia.org/wiki/Zettel

In the Zettelkasten method, each note carries a **permanent unique ID** embedded in its content or filename. Links between notes are based on this ID, not on the filename. This means a note can be renamed freely without breaking any link pointing to it.

This script implements that principle inside QOwnNotes using the native `[[filename|id]]` wiki-link format.
This script implements that principle inside QOwnNotes using the native `[[filename|id]]` wiki-link format. You will need to activate Settings>Interface>Editor>'Enable wiki-style link support [[note name]]'.

## Usage

- **Scripting › Insert Zettelkasten ID** — Insert a new unique ZK ID at the cursor position
- **Scripting › insert Zettelkasten link** — Open a searchable dialog to pick a note and insert a `[[filename\|id]]` link
- **Scripting › Repair Zettelkasten links** — can all notes and repair every link whose filename is out of date

You can also link those actions to a custom shortcut.

## Link format

```
[[MyNote|20260430143012]]
```

- The left part (`MyNote`) is what QOwnNotes uses to resolve the link (Ctrl+click to open).
- The left part (`MyNote`) is what QOwnNotes uses to resolve the link (Ctrl+click to open). Only the note name is used — subfolder paths are never included, because QOwnNotes resolves wiki-links by filename regardless of the folder the note is in.
- The right part (`20260430143012`) is the permanent ZK ID, used by this script to repair links when the filename changes.

## Actions

Three toolbar buttons are registered:
Three toolbar buttons are registered, following the custom actions listed above:

| Button | Action |
| ----------- | ---------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions zettelkasten/info.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "Zettelkasten",
"identifier": "zettelkasten",
"version": "0.2.0",
"version": "0.2.1",
"script": "zettelkasten.qml",
"authors": ["@luginf"],
"platforms": ["linux", "macos", "windows"],
"minAppVersion": "26.4.11",
"description": "Zettelkasten support: generates configurable note IDs and inserts [[filename|ID]] wiki-links to notes detected by a configurable ECMAScript ID pattern.",
"description": "Generates configurable note IDs and inserts links supporting those IDs using the Zettelkasten method. \n\n<b>Usage</b>\nSelect 'Insert Zettelkasten ID' from the custom actions menu will create a unique ID into your file. You can configure the ID pattern to your liking in the script options, using an ECMAScript regeg. \nThen you can insert from an other document a link to the first one, using the 'insert Zettelkasten link' from the custom actions menu. You can select the correct link using a filter from filename or the ID, and it will create a [[filename|ID]] wiki-links to notes. The detection pattern has also to be configured into the plugin options, to match the ID generation (the default option will match the preconfigured ID pattern anyway).\nIf you later rename your note, using from the custom actions menu 'Repair Zettelkasten links' will automatically search and rename every link whose filename is out of date, based on the correct ID.",
"resources": ["ZkLinkDialog.qml"]
}
11 changes: 3 additions & 8 deletions zettelkasten/zettelkasten.qml
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,12 @@ Script {
}

// Returns the link target string for [[target|id]] given a note object.
// QOwnNotes resolves wiki-links by filename only, regardless of subfolder,
// so we never include the relative directory path.
function noteLinkTarget(note) {
var name = note && note.name ? note.name : "";
if (name) {
var relativeDir = note.relativeNoteFileDirPath || "";
if (relativeDir) {
relativeDir = relativeDir.replace(/[\/\\]+$/, "");
return relativeDir ? relativeDir + "/" + name : name;
}
if (name)
return name;
}

return /\.txt$/i.test(note.fileName) ? note.fileName.slice(0, note.fileName.length - 4) : note.fileName;
}

Expand Down
Loading