From 03f7a385981af31e55b3ff2f199bf9b77d645f95 Mon Sep 17 00:00:00 2001 From: Victor Wiebe Date: Sun, 26 Jul 2026 11:21:18 -0400 Subject: [PATCH] SSL fix --- GENERATOR_DOC.md | 0 README.md | 107 +++++++++++++++++++-- api/Global.d.ts | 0 api/Joplin.d.ts | 0 api/JoplinClipboard.d.ts | 0 api/JoplinCommands.d.ts | 0 api/JoplinContentScripts.d.ts | 0 api/JoplinData.d.ts | 0 api/JoplinFilters.d.ts | 0 api/JoplinInterop.d.ts | 0 api/JoplinPlugins.d.ts | 0 api/JoplinSettings.d.ts | 0 api/JoplinViews.d.ts | 0 api/JoplinViewsDialogs.d.ts | 0 api/JoplinViewsMenuItems.d.ts | 0 api/JoplinViewsMenus.d.ts | 0 api/JoplinViewsPanels.d.ts | 0 api/JoplinViewsToolbarButtons.d.ts | 0 api/JoplinWindow.d.ts | 0 api/JoplinWorkspace.d.ts | 0 api/index.ts | 0 api/types.ts | 0 package-lock.json | 144 ++++++++++++++++++++++++++++- package.json | 10 +- plugin.config.json | 0 src/embedfence.css | 0 src/fence.js | 0 src/index.ts | 0 src/manifest.json | 12 +-- tsconfig.json | 0 webpack.config.js | 0 31 files changed, 252 insertions(+), 21 deletions(-) mode change 100644 => 100755 GENERATOR_DOC.md mode change 100644 => 100755 README.md mode change 100644 => 100755 api/Global.d.ts mode change 100644 => 100755 api/Joplin.d.ts mode change 100644 => 100755 api/JoplinClipboard.d.ts mode change 100644 => 100755 api/JoplinCommands.d.ts mode change 100644 => 100755 api/JoplinContentScripts.d.ts mode change 100644 => 100755 api/JoplinData.d.ts mode change 100644 => 100755 api/JoplinFilters.d.ts mode change 100644 => 100755 api/JoplinInterop.d.ts mode change 100644 => 100755 api/JoplinPlugins.d.ts mode change 100644 => 100755 api/JoplinSettings.d.ts mode change 100644 => 100755 api/JoplinViews.d.ts mode change 100644 => 100755 api/JoplinViewsDialogs.d.ts mode change 100644 => 100755 api/JoplinViewsMenuItems.d.ts mode change 100644 => 100755 api/JoplinViewsMenus.d.ts mode change 100644 => 100755 api/JoplinViewsPanels.d.ts mode change 100644 => 100755 api/JoplinViewsToolbarButtons.d.ts mode change 100644 => 100755 api/JoplinWindow.d.ts mode change 100644 => 100755 api/JoplinWorkspace.d.ts mode change 100644 => 100755 api/index.ts mode change 100644 => 100755 api/types.ts mode change 100644 => 100755 package-lock.json mode change 100644 => 100755 package.json mode change 100644 => 100755 plugin.config.json mode change 100644 => 100755 src/embedfence.css mode change 100644 => 100755 src/fence.js mode change 100644 => 100755 src/index.ts mode change 100644 => 100755 src/manifest.json mode change 100644 => 100755 tsconfig.json mode change 100644 => 100755 webpack.config.js diff --git a/GENERATOR_DOC.md b/GENERATOR_DOC.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 096f8f6..eac69a6 --- a/README.md +++ b/README.md @@ -1,9 +1,102 @@ -# Embed search in note - Joplin Plugin +# Embed Search — Notebook Grouping Fork -This plugin allows to embed any search -and its get previewed in pane. +A fork of [ambrt/joplin-plugin-embed-search](https://github.com/ambrt/joplin-plugin-embed-search), a Joplin plugin that lets you embed a live search inside a note and have the results render right there in the preview pane. -Additionally it detects if note is a todo -and allows to tick it on and off. -More at -https://discourse.joplinapp.org/t/embed-search/14328 +This fork adds the ability to group results by notebook, and fixes a bug where restricting a search to the current notebook would also pull in results from its subnotebooks. + +## What it does + +Add a fenced `search` code block to any note: + +````markdown +```search +your search terms +``` +```` + +When you view the note, the plugin runs that search and replaces the block with a live list of matching notes, each one a clickable link back to the note. To-do items get a checkbox you can tick right from the results list. + +## Search modifiers + +Add any of these on their own line inside the `search` block, alongside your search terms: + +| Modifier | What it does | +|---|---| +| `sort:asc` | Sort results alphabetically by title, A → Z | +| `sort:desc` | Sort results alphabetically by title, Z → A | +| `content:true` | Show a preview of each note's body content below its title | +| `notebook:this` | Restrict results to the current note's notebook only *(fixed in this fork — no longer pulls in subnotebooks)* | +| `group:notebook` | **New in this fork.** Group results under bold notebook-name headers, sorted alphabetically by notebook, with notes sorted by title within each group | + +### Examples + +Show every note tagged with a keyword, sorted A–Z: + +````markdown +```search +budget sort:asc +``` +```` + +Restrict to notes in the current notebook only, with content previews: + +````markdown +```search +budget notebook:this content:true +``` +```` + +Group everything across your whole workspace by notebook — handy for a dashboard note that surveys many notebooks at once: + +````markdown +```search +tag:reference group:notebook +``` +```` + +## What changed from the original plugin + +- **Added:** `group:notebook` — groups search results under notebook headers instead of one flat list. +- **Fixed:** `notebook:this` previously appended a `notebook:""` filter to the Joplin search query. Joplin's own `notebook:` filter has no way to exclude subnotebooks, so this leaked in results from child notebooks. This fork instead filters results in-plugin by exact `parent_id` match against the current note's notebook, so only notes directly in that notebook are returned. +- **Fixed:** the original code asked Joplin for a folder's `name` field when resolving `notebook:this` — Joplin folders don't have a `name` field, only `title`, so this silently broke the feature. Fixed to request `title`. + +All credit for the original plugin, the fence-block rendering approach, and the to-do checkbox handling goes to [ambrt](https://github.com/ambrt). + +## Installation + +1. Download the latest `.jpl` file from the [Releases](../../releases) page (or build it yourself — see below). +2. In Joplin: **Tools → Options → Plugins → gear icon → Install from file**. +3. Select the `.jpl` file and restart Joplin if prompted. + +## Building from source + +Requires Node.js and npm. + +```bash +git clone https://gitea.skeletonworks.online/vwiebe/joplin-plugin-embed-search-fork.git +cd joplin-plugin-embed-search-fork +npm install +npm run dist +``` + +The built plugin will appear at `publish/com.victorwiebe.embed-search-notebook-grouping.jpl`. + +### If `npm run dist` fails + +This project's build tooling (webpack 4) predates a change in Node's OpenSSL defaults. If your Node version is 17 or newer, `npm run dist` (or `npm publish`, which runs it internally) can fail with an error that includes `ERR_OSSL_EVP_UNSUPPORTED` or `digital envelope routines::unsupported`. This is not a problem with the code — it's an old build tool meeting a newer Node. + +This is already worked around in `package.json` — the `dist` script runs through `cross-env NODE_OPTIONS=--openssl-legacy-provider`, so a plain `npm run dist` and a plain `npm publish` should both just work as long as you've run `npm install` first (which pulls in the `cross-env` package the fix depends on). + +If you still hit the error after `npm install`, delete `node_modules` and reinstall from scratch: + +```bash +rm -rf node_modules package-lock.json +npm install +npm run dist +``` + +**Not sure which Node version you have?** Run `node --version`. Anything starting with `v17` or higher can hit this; `v16` and earlier won't. + +## License + +MIT, same as the original plugin. diff --git a/api/Global.d.ts b/api/Global.d.ts old mode 100644 new mode 100755 diff --git a/api/Joplin.d.ts b/api/Joplin.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinClipboard.d.ts b/api/JoplinClipboard.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinCommands.d.ts b/api/JoplinCommands.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinContentScripts.d.ts b/api/JoplinContentScripts.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinData.d.ts b/api/JoplinData.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinFilters.d.ts b/api/JoplinFilters.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinInterop.d.ts b/api/JoplinInterop.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinPlugins.d.ts b/api/JoplinPlugins.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinSettings.d.ts b/api/JoplinSettings.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinViews.d.ts b/api/JoplinViews.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinViewsDialogs.d.ts b/api/JoplinViewsDialogs.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinViewsMenuItems.d.ts b/api/JoplinViewsMenuItems.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinViewsMenus.d.ts b/api/JoplinViewsMenus.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinViewsPanels.d.ts b/api/JoplinViewsPanels.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinViewsToolbarButtons.d.ts b/api/JoplinViewsToolbarButtons.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinWindow.d.ts b/api/JoplinWindow.d.ts old mode 100644 new mode 100755 diff --git a/api/JoplinWorkspace.d.ts b/api/JoplinWorkspace.d.ts old mode 100644 new mode 100755 diff --git a/api/index.ts b/api/index.ts old mode 100644 new mode 100755 diff --git a/api/types.ts b/api/types.ts old mode 100644 new mode 100755 diff --git a/package-lock.json b/package-lock.json old mode 100644 new mode 100755 index c18eef6..d721462 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "joplin-plugin-embed-search", - "version": "2.0.0", + "name": "joplin-plugin-victorwiebe-embed-search-notebook-grouping", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "joplin-plugin-embed-search", - "version": "2.0.0", + "name": "joplin-plugin-victorwiebe-embed-search-notebook-grouping", + "version": "1.0.0", "license": "MIT", "dependencies": { "joplin-renderer": "^1.0.8" @@ -15,6 +15,7 @@ "@types/node": "^14.0.14", "chalk": "^4.1.0", "copy-webpack-plugin": "^6.1.0", + "cross-env": "^7.0.3", "fs-extra": "^9.0.1", "glob": "^7.1.6", "on-build-webpack": "^0.1.0", @@ -1143,6 +1144,89 @@ "sha.js": "^2.4.8" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/cross-env/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-env/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-env/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-env/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-env/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -6952,6 +7036,58 @@ "sha.js": "^2.4.8" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 1eb4b66..77f677c --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { - "name": "joplin-plugin-embed-search", - "version": "2.0.0", + "name": "joplin-plugin-victorwiebe-embed-search-notebook-grouping", + "version": "1.0.0", + "author": "Victor Wiebe", "scripts": { - "dist": "webpack --joplin-plugin-config buildMain && webpack --joplin-plugin-config buildExtraScripts && webpack --joplin-plugin-config createArchive", + "dist": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --joplin-plugin-config buildMain && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --joplin-plugin-config buildExtraScripts && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --joplin-plugin-config createArchive", "prepare": "npm run dist", "update": "npm install -g generator-joplin && yo joplin --update", "distrun2": "npm run dist && ~/Downloads/Joplin-2.3.5.AppImage --env dev", @@ -16,6 +17,7 @@ "@types/node": "^14.0.14", "chalk": "^4.1.0", "copy-webpack-plugin": "^6.1.0", + "cross-env": "^7.0.3", "fs-extra": "^9.0.1", "glob": "^7.1.6", "on-build-webpack": "^0.1.0", @@ -29,4 +31,4 @@ "dependencies": { "joplin-renderer": "^1.0.8" } -} \ No newline at end of file +} diff --git a/plugin.config.json b/plugin.config.json old mode 100644 new mode 100755 diff --git a/src/embedfence.css b/src/embedfence.css old mode 100644 new mode 100755 diff --git a/src/fence.js b/src/fence.js old mode 100644 new mode 100755 diff --git a/src/index.ts b/src/index.ts old mode 100644 new mode 100755 diff --git a/src/manifest.json b/src/manifest.json old mode 100644 new mode 100755 index 43434fa..272262a --- a/src/manifest.json +++ b/src/manifest.json @@ -1,12 +1,12 @@ { "manifest_version": 1, - "id": "joplin.plugin.ambrt.embedSearch", + "id": "com.victorwiebe.embed-search-notebook-grouping", "app_min_version": "1.7", "version": "2.1.0", "name": "Embed Search (Notebook Grouping Fork)", - "description": "Embeds list of links specified by search inside of note. Fork adds group:notebook.", - "author": "ambrt", - "homepage_url": "https://discourse.joplinapp.org/t/embed-any-search-with-content/14328", - "repository_url": "https://github.com/ambrt/joplin-plugin-embed-search", - "keywords": [] + "description": "Embeds list of links specified by search inside of note. Fork of ambrt's Embed Search plugin, adding group:notebook and a fixed notebook:this.", + "author": "Victor Wiebe", + "homepage_url": "https://gitea.skeletonworks.online/vwiebe/joplin-plugin-embed-search-fork", + "repository_url": "https://gitea.skeletonworks.online/vwiebe/joplin-plugin-embed-search-fork", + "keywords": ["joplin-plugin"] } diff --git a/tsconfig.json b/tsconfig.json old mode 100644 new mode 100755 diff --git a/webpack.config.js b/webpack.config.js old mode 100644 new mode 100755