joplin-plugin-copy-as-html 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Joplin Copy as HTML
2
+
3
+ > [!important]
4
+ > My coding knowledge is currently very limited. This plugin was created entirely with AI tools, and I may be limited in my ability to fix any issues.
5
+
6
+ This plugin allows you to copy selected text in the markdown editor as either HTML or plaintext (with markdown formatting characters removed).
7
+
8
+ The primary use case is copying text from Joplin and pasting formatted text into other apps that support HTML formatting (e.g. pasting text into an Outlook email).
9
+
10
+ ## Copy as HTML
11
+
12
+ "Copy selection as HTML" is provided as a right click context menu option and as a keyboard shortcut (ctrl + shift + c by default).
13
+
14
+ This will populate the clipboard's text/html category with the HTML formatted text.
15
+
16
+ > [!important]
17
+ > By design, the plugin only copies an HTML fragment including the basic semantic HTML markup (i.e. it won't include any of the Joplin theme styling). This is for maximum compatibility with pasting into other apps, so you don't see issues such as Joplin's background color being pasted- you'll just get the formatted text (bold, italics, formatted lists, etc...).
18
+
19
+ ### Embed images as base64
20
+
21
+ By default, the plugin will embed any images as base64 in the text/html output, allowing you paste text + images into external applications. However, this can be disabled in the plugin's settings.
22
+
23
+ This should work with both markdown image embeds and the html img src embeds that you get when resizing images via joplin's rich text editor.
24
+
25
+ ## Copy as Plain Text
26
+
27
+ "Copy selection as Plain Text" is provided as a right click context menu option and as a keyboard shortcut (ctrl + alt + c by default).
28
+
29
+ This will strip the markdown formatting characters from the raw markdown (except for numbered/unordered list markers) and populate it as text/plain in the clipboard, for scenarios where you need to paste into an app that supports neither HTML formatting or markdown.
30
+
31
+ > [!NOTE]
32
+ > I originally wanted to implement a single action that populated both the text/html and the text/plain clipboard categories (allowing you to seamlessly paste as rich text or plain text), but this currently doesn't seem possible to due limitations with joplin's clipboard API. The joplin clipboard API doesn't appear to allow writing both text/html and text/plain, you only get one or the other (if I'm wrong about this, please let me know!)
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "joplin-plugin-copy-as-html",
3
+ "version": "1.0.0",
4
+ "scripts": {
5
+ "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
6
+ "prepare": "npm run dist",
7
+ "updateVersion": "webpack --env joplin-plugin-config=updateVersion",
8
+ "update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update --force"
9
+ },
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "joplin-plugin"
13
+ ],
14
+ "files": [
15
+ "publish"
16
+ ],
17
+ "devDependencies": {
18
+ "@types/node": "^18.7.13",
19
+ "chalk": "^4.1.0",
20
+ "copy-webpack-plugin": "^11.0.0",
21
+ "fs-extra": "^10.1.0",
22
+ "glob": "^8.0.3",
23
+ "tar": "^6.1.11",
24
+ "ts-loader": "^9.3.1",
25
+ "typescript": "^4.8.2",
26
+ "webpack": "^5.74.0",
27
+ "webpack-cli": "^4.10.0"
28
+ },
29
+ "dependencies": {
30
+ "@joplin/renderer": "^3.3.1",
31
+ "jsdom": "^26.1.0",
32
+ "remove-markdown": "^0.6.2"
33
+ }
34
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "id": "com.bwat47.copyashtml",
4
+ "app_min_version": "3.3",
5
+ "version": "1.0.0",
6
+ "name": "Copy as HTML",
7
+ "description": "Allows you to copy text with HTML (rich text) formatting from the markdown editor without excess styling.",
8
+ "author": "bwat47",
9
+ "homepage_url": "https://github.com/bwat47/joplin-copy-as-html",
10
+ "repository_url": "https://github.com/bwat47/joplin-copy-as-html",
11
+ "keywords": [],
12
+ "categories": [],
13
+ "screenshots": [],
14
+ "icons": {},
15
+ "promo_tile": {},
16
+ "settings": {
17
+ "embedImages": {
18
+ "type": "bool",
19
+ "label": "Embed images as base64",
20
+ "description": "If enabled, images in selection will be embedded as base64.",
21
+ "value": true
22
+ }
23
+ },
24
+ "_publish_hash": "sha256:1ffc6e8f26a311c0032ed8a42e406840fc8a850627c69933ba4d6bf541a0a54e",
25
+ "_publish_commit": "main:4afd3a1dfbf52ad2ac13d057e8d3cb1005a05733"
26
+ }
@@ -0,0 +1 @@
1
+ /*! For license information please see index.js.LICENSE.txt */