joplin-plugin-collapsible-blocks 1.2.1 → 1.9.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 CHANGED
@@ -1,27 +1,36 @@
1
- # Joplin Plugin - Collapsible blocks
1
+ # Joplin Plugin - Collapsible Sections
2
2
 
3
- This Joplin plugin allows you to create collapsible blocks with a title and extendable body. The blocks can be nested within each other, remember whether they were left open or closed, and color-coordinate between the editor and webview.
3
+ This Joplin plugin allows you to create collapsible blocks with a title and extendable body. The blocks:
4
+ * Can be nested within one another
5
+ * Remember if they were left opened or closed
6
+ * Can color-coordinate between the editor and webview
7
+ * Collapse in both the editor and the webview
8
+ * Support the use of markdown within them
4
9
 
5
- Although the blocks this plugin creates are only collapsible in the webview, not the editor, it seems to pair well with the "Extra Markdown Editor Settings" plugin, which does allow for collapsing text in the editor, if "Enable code folding" is enabled in its settings. The collapsible blocks made by this plugin are detected by it as code, and are editor-foldable. If you're nesting collapsible blocks, only the outermost one (in the editor) will be foldable with this method.
10
+ Additionally, this plugin allows you to collapse headings within notes, in both the editor and the webview, with no additional syntax.
6
11
 
7
- **Version**: 1.2.1
12
+ There are many settings available to customize the desired features and behaviors.
13
+
14
+ This plugin works on both Desktop and Mobile.
15
+
16
+ **Version**: 1.9.0
8
17
 
9
18
  ### Installation
10
19
 
11
20
  - Open Joplin and navigate to `Preferences > Plugins`
12
- - Search for `Collapsible blocks` and click install
21
+ - Search for `Collapsible Sections` and click install
13
22
  - Restart Joplin
14
23
 
15
24
  ### Uninstall
16
25
 
17
26
  - Open Joplin and navigate to `Tools > Options > Plugins`
18
- - Search for `Collapsible block` plugin
19
- - Press `Delete` to remove the plugin or `Disable` to disable it
27
+ - Find the `Collapsible Sections` plugin
28
+ - Press `Delete` to remove the plugin, or click the toggle to disable it
20
29
  - Restart Joplin
21
30
 
22
31
  ## Usage
23
32
 
24
- ### Collapsible block
33
+ ### Collapsible blocks
25
34
 
26
35
  In order to create a collapsible block, you can:
27
36
  - press on the `Collapsible block` toolbar button to create a template collapsible, or
@@ -45,11 +54,19 @@ Nothing but whitespace may come before the `:{`. The title of the block must alw
45
54
  :{
46
55
  }:
47
56
 
57
+ :{
58
+
59
+ }:
60
+
48
61
  :{Title}:
49
62
 
50
63
  :{Title
51
64
  }:
52
65
 
66
+ :{Title
67
+
68
+ }:
69
+
53
70
  :{
54
71
  Body}:
55
72
 
@@ -57,10 +74,6 @@ Body}:
57
74
  Body
58
75
  }:
59
76
 
60
- :{
61
- Body
62
- }:
63
-
64
77
  :{Title
65
78
  Body}:
66
79
 
@@ -76,32 +89,40 @@ Blocks will remember if you left them opened or closed. They will do so by editi
76
89
 
77
90
  If you don't want it to remember if you left a block opened or closed, you can turn this off globally in the plugin settings - or on a per-block basis by doubling the end token, from `}:` to `}:}:`. When you do this, you can still open and close the block in the webview, but they will not save their state in the editor - so the next time the note is loaded, they will be opened or closed again, depending on whether their opening token is `:{:{` or `:{`, respectively. So a block like `:{:{this}:}:` will always be initially open when you open a note, while a block like `:{this}:}:` will always be initially closed when you open a note.
78
91
 
79
- When nesting blocks within blocks, they will be color-coded in the editor, and may also be color-coded in the webview. These can both be controlled (enabled or disabled) in the plugin Settings tab.
92
+ When nesting blocks within blocks, they can be color-coded in the editor, and may also be color-coded in the webview. These can both be controlled (enabled or disabled) in the plugin Settings tab.
80
93
 
81
- ## Screenshots
94
+ ### Collapsible Headings
82
95
 
83
- Three collapsibles, with one nested inside another, all closed
96
+ When you create headings within a note (by starting a line with `#`, `##`, `###`, `####`, `#####`, or `######`), this plugin automatically makes them collapsible, with no additional syntax required. This can be enabled or disabled in both the editor and the webview in settings. The collapsible region beneath a heading will extend to the next heading of equal or higher precedence. So, for example, a `#` heading will collapse to the next `#` heading, while a `###` heading will collapse to the next `#`, `##`, or `###` heading. Collapsible headings and collapsible blocks do play nicely with each other, and can be nested freely.
84
97
 
85
- ![](screenshots/1.png)
98
+ Headings do remember if they should be left opened or closed (This can be disabled in settings). Due to the lack of special syntax, this is done by adding or removing a space from the end of the line with the heading. A heading with no space at the end is considered opened, while a heading with a space at the end is considered closed. For example:
86
99
 
87
- With the two outer ones opened
88
-
89
- ![](screenshots/2.png)
100
+ ```
101
+ # This heading does not end in a space, and so will render as opened when the note is loaded
102
+ This text will be visible when the note is loaded.
103
+ # This heading does end in a space, and so will render as closed when the note is loaded
104
+ This text will not be visible when the note is loaded. That is because there is a space ↑ here, after the word 'loaded', in the previous line.
105
+ ```
90
106
 
91
- With all three opened
107
+ ## Screenshots
92
108
 
93
- ![](screenshots/3.png)
109
+ Various headings and collapsible blocks, all open, with colors enabled
110
+ ![](screenshots/1.png)
94
111
 
95
- With a fourth one added, for three nesting levels, and webview colors enabled
112
+ The same note, with some headings and blocks collapsed
113
+ ![](screenshots/2.png)
96
114
 
97
- ![](screenshots/4.png)
98
115
 
99
116
  ## Settings
100
117
  There is a settings page for the plugin in the Joplin options. There, you can:
101
- * Customize the start and end tokens away from the default `:{` and `}:`
102
118
  * Enable or disable the color coding in the webview and editor
119
+ * Customize the start and end tokens away from the default `:{` and `}:`
103
120
  * Globally disable the plugin's ability to remember if a collapsible block's opened/closed status was changed in the webview
104
- * Disable automatic CSS indentation of collapsible block text in the editor, or configure it to indent more or less
121
+ * Disable automatic CSS indentation of collapsible block text in the editor, or configure it to indent more or
122
+ * Enable or disable collapsing within the editor as well as the webview
123
+ * Toggle whether folding changes in one view automatically trigger folding changes in the other view
124
+ * Enable or disable header-based collapsing in the webview or editor
125
+ * Enable or disable remembering whether headers were left opened or closed
105
126
 
106
127
  ![](screenshots/settings.png)
107
128
 
@@ -122,17 +143,17 @@ details.cb-details summary {
122
143
 
123
144
  }
124
145
 
125
- /* Below are used for styling nested collapsible blocks, and will only
126
- be applied if "Do Webview Colors" is enabled in the plugin settings */
127
-
128
- /* Styling of nested collapsible blocks - use n = 0-7 */
129
- .cb-details.cb-nest-n {
130
-
131
- }
132
-
133
- /* Styling of nested collapsible block titles - use n = 0-7 */
134
- .cb-details.cb-nest-n > summary {
135
-
146
+ /* Below are used for coloring nested collapsible blocks, and will
147
+ only be applied if colors are enabled in the plugin settings */
148
+ :root {
149
+ --cb-color-0: #a0a0a0;
150
+ --cb-color-1: #6b5fd6; /* blue-violet */
151
+ --cb-color-2: #2bb0e6; /* bright cyan-blue */
152
+ --cb-color-3: #6b5fd6;
153
+ --cb-color-4: #2bb0e6;
154
+ --cb-color-5: #6b5fd6;
155
+ --cb-color-6: #2bb0e6;
156
+ --cb-color-7: #6b5fd6;
136
157
  }
137
158
  ```
138
159
 
@@ -141,9 +162,9 @@ If the collapsible block is not showing up, or is showing up but you're unable t
141
162
 
142
163
  ![](screenshots/troubleshooting.png)
143
164
 
144
- ## Notes
165
+ ## Issues
145
166
 
146
- - **There might be bugs**, [report them here](https://github.com/ntczkjfg/joplin-plugin-collapsible-block/issues) and I'll try to fix them if I can.
167
+ - **Encounter any bugs?** [Report them here](https://github.com/ntczkjfg/joplin-plugin-collapsible-block/issues), and I'll do my best to fix them.
147
168
 
148
169
  ## Acknowledgement
149
170
 
@@ -151,4 +172,6 @@ Thanks to the creator of the [Joplin Spoilers](https://github.com/martinkorelic/
151
172
 
152
173
  ## Other plugins
153
174
 
154
- See my other plugin, [Click-to-Copy Spans](https://github.com/ntczkjfg/joplin-plugin-click-to-copy-span)! Easily lets you create spans of text that, when clicked, are automatically copied to your clipboard for fast and easy pasting.
175
+ Check out my other plugins:
176
+ * [Click-to-Copy Spans](https://github.com/ntczkjfg/joplin-plugin-click-to-copy-span)! Easily create spans of text that, when clicked, are automatically copied to your clipboard for fast and easy pasting.
177
+ * [Hotstrings & Hotkeys]()https://github.com/ntczkjfg/joplin-plugin-hotstrings)! Easily create user-defined hotstrings and hotkeys for simple text insertion and replacement.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joplin-plugin-collapsible-blocks",
3
- "version": "1.2.1",
3
+ "version": "1.9.0",
4
4
  "scripts": {
5
5
  "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
6
6
  "prepare": "npm run dist",
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "manifest_version": 1,
3
3
  "id": "joplin.plugin.collapsible.blocks",
4
- "app_min_version": "3.2",
5
- "version": "1.2.1",
6
- "name": "Collapsible blocks",
7
- "description": "Create collapsible blocks with title and extendable body.",
4
+ "app_min_version": "3.3",
5
+ "version": "1.9.0",
6
+ "name": "Collapsible Sections",
7
+ "description": "Create collapsible blocks with title and extendable body, and make headings collapsible too.",
8
8
  "author": "ntczkjfg",
9
9
  "homepage_url": "https://github.com/ntczkjfg/joplin-plugin-collapsible-block",
10
10
  "repository_url": "https://github.com/ntczkjfg/joplin-plugin-collapsible-block",
@@ -18,12 +18,17 @@
18
18
  "details",
19
19
  "fold",
20
20
  "foldable",
21
- "folding"
21
+ "folding",
22
+ "editor",
23
+ "mobile",
24
+ "obsidian",
25
+ "heading",
26
+ "header"
22
27
  ],
23
28
  "platforms": [
24
29
  "desktop",
25
30
  "mobile"
26
31
  ],
27
- "_publish_hash": "sha256:a7f2e12a0762af2faa225ba92d3f7585c82e596c52535fe0fb1c615523de083d",
28
- "_publish_commit": "master:71b1a0e51ff3475b88d69e242622c058735cbc09"
32
+ "_publish_hash": "sha256:4a55870ddf310d37b226f43c59173699128fd3a4413616baaa7b9e895122acfd",
33
+ "_publish_commit": "master:dcb50637167916ac6bfad25ae4437473535d65e2"
29
34
  }