joplin-plugin-heading-control 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,190 @@
1
+ # Joplin Heading Control
2
+
3
+ Customize Markdown heading colors in Joplin for H1 through H6 while keeping note Markdown completely clean and unchanged.
4
+
5
+ Joplin Heading Control is a small presentation-only plugin. It adds configurable colors to Markdown headings in both the Markdown editor and rendered viewer without injecting HTML into notes, rewriting headings, or changing stored Markdown.
6
+
7
+ ## Features
8
+
9
+ - Configure a separate color for each Markdown heading level from H1 through H6.
10
+ - Apply heading colors in the Markdown editor.
11
+ - Apply heading colors in the rendered Markdown viewer.
12
+ - Update colors immediately after confirming changes in Joplin Options.
13
+ - Persist configured colors across Joplin restarts.
14
+ - Preserve plain Markdown source exactly as written.
15
+ - Reject invalid color values and fall back safely to the corresponding default color.
16
+ - Support Joplin Desktop and Joplin Mobile.
17
+
18
+ ## Default colors
19
+
20
+ | Heading | Default |
21
+ | ------- | --------- |
22
+ | H1 | `#7AA2F7` |
23
+ | H2 | `#9ECE6A` |
24
+ | H3 | `#E0AF68` |
25
+ | H4 | `#BB9AF7` |
26
+ | H5 | `#F87DFF` |
27
+ | H6 | `#44D0C4` |
28
+
29
+ Only valid six-digit hexadecimal color values are accepted, using the format `#RRGGBB`.
30
+
31
+ Invalid values are ignored and the affected heading falls back to its default color.
32
+
33
+ ## Configuration
34
+
35
+ Open:
36
+
37
+ ```text
38
+ Tools > Options > Joplin Heading Control
39
+ ```
40
+
41
+ Set the desired color for each heading level, then confirm the dialog.
42
+
43
+ Changes apply immediately in both the Markdown editor and rendered viewer.
44
+
45
+ ## Reset all colors to defaults
46
+
47
+ On Joplin Desktop, open the Command Palette:
48
+
49
+ ```text
50
+ Ctrl+Shift+P
51
+ ```
52
+
53
+ Run:
54
+
55
+ ```text
56
+ Reset heading colors to defaults
57
+ ```
58
+
59
+ This restores all six configured colors to the plugin defaults.
60
+
61
+ ### Current reset refresh behavior
62
+
63
+ The reset command updates the stored settings immediately, but the currently displayed note may not visually refresh at once.
64
+
65
+ If the colors do not visibly update after running the reset command, open Joplin Options and close it again. The refreshed defaults will then be applied.
66
+
67
+ A smoother live refresh after reset is planned for a future version.
68
+
69
+ ## Markdown remains untouched
70
+
71
+ The plugin is purely presentational.
72
+
73
+ A note such as:
74
+
75
+ ```markdown
76
+ # Project
77
+
78
+ ## Hardware
79
+
80
+ ### Networking
81
+ ```
82
+
83
+ remains exactly that in the note source.
84
+
85
+ The plugin does not:
86
+
87
+ - inject HTML into notes;
88
+ - add custom Markdown syntax;
89
+ - rewrite headings;
90
+ - modify exported `.md` files;
91
+ - add formatting metadata to note content.
92
+
93
+ This keeps notes clean for sync, Git, export, other Markdown editors, and LLM-based workflows.
94
+
95
+ ## Desktop support
96
+
97
+ Joplin Heading Control supports Joplin Desktop with a minimum application version of Joplin 3.6.
98
+
99
+ Tested on Linux with Joplin 3.6.16.
100
+
101
+ ## Mobile support
102
+
103
+ The same plugin package also works on Joplin Mobile.
104
+
105
+ Current testing confirms heading colors in both:
106
+
107
+ - the Markdown editor;
108
+ - the rendered Markdown viewer.
109
+
110
+ The plugin can be installed manually on Android using the generated `.jpl` package through Joplin's plugin settings.
111
+
112
+ ## Manual installation
113
+
114
+ Builds produce:
115
+
116
+ ```text
117
+ publish/io.gitlab.mh8.JoplinHeadingControl.jpl
118
+ ```
119
+
120
+ On Joplin Desktop:
121
+
122
+ 1. Open `Tools > Options > Plugins`.
123
+ 2. Choose the option to install a plugin from file.
124
+ 3. Select the `.jpl` package.
125
+ 4. Restart Joplin if requested.
126
+
127
+ On Joplin Mobile, open the plugin settings and use the option to install a plugin from file.
128
+
129
+ ## Development
130
+
131
+ Repository:
132
+
133
+ ```text
134
+ https://gitlab.com/mh8/joplin-heading-control
135
+ ```
136
+
137
+ Clone:
138
+
139
+ ```bash
140
+ git clone git@gitlab.com:mh8/joplin-heading-control.git
141
+ cd joplin-heading-control
142
+ npm install
143
+ ```
144
+
145
+ Build the plugin:
146
+
147
+ ```bash
148
+ npm run dist
149
+ ```
150
+
151
+ The generated plugin archive is written to:
152
+
153
+ ```text
154
+ publish/io.gitlab.mh8.JoplinHeadingControl.jpl
155
+ ```
156
+
157
+ ## Technical approach
158
+
159
+ The plugin keeps editor and viewer styling separate:
160
+
161
+ - The Markdown editor uses a CodeMirror 6 content script and semantic heading tags.
162
+ - The rendered viewer uses a Markdown renderer content script.
163
+ - Joplin plugin settings provide the six persistent color values.
164
+ - Invalid values are validated and replaced with safe defaults.
165
+
166
+ No note content is modified at any point.
167
+
168
+ ## Roadmap
169
+
170
+ Possible future additions remain intentionally limited to heading presentation.
171
+
172
+ Planned or considered:
173
+
174
+ - smoother live visual refresh after resetting colors to defaults;
175
+ - per-heading font size controls;
176
+ - per-heading font weight controls;
177
+ - optional heading spacing controls;
178
+ - optional underline or bottom-border controls;
179
+ - improved reset controls, potentially including per-heading reset actions;
180
+ - named heading-style presets if they can remain simple and portable.
181
+
182
+ The project deliberately avoids becoming a general theme engine.
183
+
184
+ ## Project scope
185
+
186
+ Joplin Heading Control exists to make Markdown hierarchy easier to scan while preserving Joplin's lightweight, Markdown-first workflow.
187
+
188
+ The core rule is simple:
189
+
190
+ > Heading presentation may change. Markdown content must not.
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "joplin-plugin-heading-control",
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
+ "@codemirror/language": "^6.12.4",
19
+ "@codemirror/view": "^6.43.11",
20
+ "@lezer/highlight": "^1.2.3",
21
+ "@types/node": "^18.7.13",
22
+ "chalk": "^4.1.0",
23
+ "copy-webpack-plugin": "^11.0.0",
24
+ "fs-extra": "^10.1.0",
25
+ "glob": "^8.0.3",
26
+ "tar": "^6.1.11",
27
+ "ts-loader": "^9.3.1",
28
+ "typescript": "^4.8.2",
29
+ "webpack": "^5.74.0",
30
+ "webpack-cli": "^4.10.0"
31
+ }
32
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "id": "io.gitlab.mh8.JoplinHeadingControl",
4
+ "app_min_version": "3.6",
5
+ "version": "1.0.0",
6
+ "name": "Joplin Heading Control",
7
+ "description": "Customize Markdown heading appearance in Joplin with per-level styling controls for H1 through H6, while keeping note Markdown clean and unchanged.",
8
+ "author": "Mathieu Hery",
9
+ "homepage_url": "https://gitlab.com/mh8/joplin-heading-control",
10
+ "repository_url": "https://gitlab.com/mh8/joplin-heading-control",
11
+ "platforms": [
12
+ "desktop",
13
+ "mobile"
14
+ ],
15
+ "keywords": [],
16
+ "categories": [],
17
+ "screenshots": [],
18
+ "icons": {},
19
+ "promo_tile": {},
20
+ "_publish_hash": "sha256:61d0f111289a7816c627a0b65ff446eeb9c9de61b6c2471bd4d627c0530bc5ae",
21
+ "_publish_commit": "main:2f985f5167225518182f03353314cbd11695a2c2"
22
+ }