joplin-plugin-collapsible-blocks 1.1.1 → 1.2.1
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
|
@@ -4,9 +4,9 @@ This Joplin plugin allows you to create collapsible blocks with a title and exte
|
|
|
4
4
|
|
|
5
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.
|
|
6
6
|
|
|
7
|
-
**Version**: 1.
|
|
7
|
+
**Version**: 1.2.1
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Installation
|
|
10
10
|
|
|
11
11
|
- Open Joplin and navigate to `Preferences > Plugins`
|
|
12
12
|
- Search for `Collapsible blocks` and click install
|
|
@@ -30,13 +30,13 @@ In order to create a collapsible block, you can:
|
|
|
30
30
|
|
|
31
31
|
```
|
|
32
32
|
:{Block title
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
Block body here
|
|
34
|
+
And here
|
|
35
|
+
And here...
|
|
36
36
|
}:
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Nothing but whitespace may come before the `:{`. The title of the block must always appear on the same line as the `:{`. A title may be omitted. You can choose to put the `}:` on the same line as the last line of body text, or on its own line, but nothing is allowed to come after the `}:`.
|
|
39
|
+
Nothing but whitespace may come before the `:{`. The title of the block must always appear on the same line as the `:{`. A title may be omitted. You can choose to put the `}:` on the same line as the last line of body text, or on its own line, but nothing is allowed to come after the `}:`. In general, this plugin is designed to be extremely forgiving with how things are formatted and indented. The following examples (and more!) are all valid:
|
|
40
40
|
|
|
41
41
|
**Examples**:
|
|
42
42
|
```
|
|
@@ -64,19 +64,14 @@ Body
|
|
|
64
64
|
:{Title
|
|
65
65
|
Body}:
|
|
66
66
|
|
|
67
|
-
:{Title
|
|
68
|
-
Body}:
|
|
69
|
-
|
|
70
67
|
:{Title
|
|
71
68
|
Body
|
|
72
69
|
}:
|
|
73
|
-
|
|
74
|
-
:{Title
|
|
75
|
-
Body
|
|
76
|
-
}:
|
|
77
70
|
```
|
|
78
71
|
(for readability, the last way is recommended)
|
|
79
72
|
|
|
73
|
+
The text in the editor will use CSS to automatically indent blocks, based on how deeply nested the blocks are. This can be disabled or configured in the settings.
|
|
74
|
+
|
|
80
75
|
Blocks will remember if you left them opened or closed. They will do so by editing the opener in the editor from `:{` to `:{:{` when opened, or back to `:{` when closed. You may also do this manually.
|
|
81
76
|
|
|
82
77
|
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.
|
|
@@ -101,9 +96,20 @@ With a fourth one added, for three nesting levels, and webview colors enabled
|
|
|
101
96
|
|
|
102
97
|

|
|
103
98
|
|
|
104
|
-
##
|
|
99
|
+
## Settings
|
|
100
|
+
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
|
+
* Enable or disable the color coding in the webview and editor
|
|
103
|
+
* 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
|
|
105
|
+
|
|
106
|
+

|
|
107
|
+
|
|
108
|
+
## Advanced
|
|
105
109
|
|
|
106
|
-
|
|
110
|
+
### Custom styles
|
|
111
|
+
|
|
112
|
+
If you would like to style the collapsible blocks to your preference, use the following in your `userstyle.css` file, which can be accessed in `Joplin` → `Tools` → `Options` → `Appearance` → `Show Advanced Settings` → `Custom stylesheet for rendered Markdown`:
|
|
107
113
|
|
|
108
114
|
```css
|
|
109
115
|
/* Styling of the collapsible block */
|
|
@@ -130,8 +136,10 @@ be applied if "Do Webview Colors" is enabled in the plugin settings */
|
|
|
130
136
|
}
|
|
131
137
|
```
|
|
132
138
|
|
|
133
|
-
##
|
|
134
|
-
|
|
139
|
+
## Troubleshooting
|
|
140
|
+
If the collapsible block is not showing up, or is showing up but you're unable to toggle it opened or closed, then you're likely accidentally in the Rich Text Editor, instead of the Markdown Editor. Joplin's Rich Text Editor does [not support most Markdown plugins](https://joplinapp.org/help/apps/rich_text_editor/#limitations). To enter the Markdown editor, look for the controls in the image below, in the upper right of Joplin. Make sure the Markdown/Rich Text toggle is on the left (red) side, and then use the blue button to swap between the editor and webview.
|
|
141
|
+
|
|
142
|
+

|
|
135
143
|
|
|
136
144
|
## Notes
|
|
137
145
|
|
|
@@ -139,7 +147,7 @@ There is a settings page for the plugin in the Joplin options. There, you can cu
|
|
|
139
147
|
|
|
140
148
|
## Acknowledgement
|
|
141
149
|
|
|
142
|
-
Thanks to the creator of the [Joplin Spoilers](https://github.com/martinkorelic/joplin-plugin-spoilers) plugin, whose code helped me build this plugin.
|
|
150
|
+
Thanks to the creator of the [Joplin Spoilers](https://github.com/martinkorelic/joplin-plugin-spoilers) plugin, whose code helped me build this plugin. Our code bases and methodologies are wildly different at this point, but it got me started with Joplin plugins.
|
|
143
151
|
|
|
144
152
|
## Other plugins
|
|
145
153
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joplin-plugin-collapsible-blocks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
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",
|
|
Binary file
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": 1,
|
|
3
3
|
"id": "joplin.plugin.collapsible.blocks",
|
|
4
4
|
"app_min_version": "3.2",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.1",
|
|
6
6
|
"name": "Collapsible blocks",
|
|
7
7
|
"description": "Create collapsible blocks with title and extendable body.",
|
|
8
8
|
"author": "ntczkjfg",
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"desktop",
|
|
25
25
|
"mobile"
|
|
26
26
|
],
|
|
27
|
-
"_publish_hash": "sha256:
|
|
28
|
-
"_publish_commit": "master:
|
|
27
|
+
"_publish_hash": "sha256:a7f2e12a0762af2faa225ba92d3f7585c82e596c52535fe0fb1c615523de083d",
|
|
28
|
+
"_publish_commit": "master:71b1a0e51ff3475b88d69e242622c058735cbc09"
|
|
29
29
|
}
|