joplin-plugin-minimap 1.1.9 → 1.2.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/LICENSE +21 -21
- package/README.md +74 -69
- package/package.json +1 -1
- package/publish/index.js +206 -145
- package/publish/manifest.json +1 -1
- package/publish/minimap-view.js +456 -283
- package/publish/minimapContentScript.js +22 -22
- package/publish/plugin.jpl +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 lim0513
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lim0513
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,69 +1,74 @@
|
|
|
1
|
-
# Joplin Minimap
|
|
2
|
-
|
|
3
|
-
A hover-to-expand table of contents minimap for the [Joplin](https://joplinapp.org/) note viewer — heading tick marks on the right edge that expand into a clickable outline.
|
|
4
|
-
|
|
5
|
-
[中文说明](README-CN.md) | [日本語](README-JA.md)
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
- **Tick Bar Minimap** — Each heading is shown as a small horizontal bar on the right edge of the note viewer; bar length reflects the heading level (H1 longest)
|
|
10
|
-
- **Hover to Expand** — Move the mouse over the bars and they expand into a full table of contents overlay, indented by level, with long titles ellipsized
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
# Joplin Minimap
|
|
2
|
+
|
|
3
|
+
A hover-to-expand table of contents minimap for the [Joplin](https://joplinapp.org/) note viewer — heading tick marks on the right edge that expand into a clickable outline.
|
|
4
|
+
|
|
5
|
+
[中文说明](README-CN.md) | [日本語](README-JA.md)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Tick Bar Minimap** — Each heading is shown as a small horizontal bar on the right edge of the note viewer; bar length reflects the heading level (H1 longest)
|
|
10
|
+
- **Hover to Expand** — Move the mouse over the bars and they expand into a full table of contents overlay, indented by level, with long titles ellipsized
|
|
11
|
+
- **Depth Stepper** — `+` / `-` buttons at the top of the expanded panel raise or lower how deep the outline goes, so a long nested note collapses to its top-level structure in one click
|
|
12
|
+
- **Heading Tiers** — Top-level headings render larger and heavier than nested ones, so the shape of the document is readable at a glance
|
|
13
|
+
- **Click to Jump** — Click any entry to smooth-scroll to that heading
|
|
14
|
+
- **Reading Position** — The section currently in view is highlighted automatically
|
|
15
|
+
- **Live Rebuild** — Rebuilds itself when you switch notes or edit content (listens to `joplin-noteDidUpdate` with a MutationObserver fallback)
|
|
16
|
+
- **RTL Aware** — Headings in right-to-left scripts (Persian, Arabic, Hebrew) are right-aligned in the expanded panel and indent inward from the right; direction is detected per heading, so mixed notes stay readable
|
|
17
|
+
- **Theme Aware** — Follows light and dark themes automatically (colors derive from `currentColor`)
|
|
18
|
+
- **Unobtrusive** — Hidden for notes with fewer than 2 headings, hidden when printing/exporting, never steals focus or keyboard input
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
### From the Joplin plugin repository (once published)
|
|
23
|
+
|
|
24
|
+
1. In Joplin, go to **Tools → Options → Plugins**
|
|
25
|
+
2. Search for **Joplin Minimap**
|
|
26
|
+
3. Install and restart Joplin
|
|
27
|
+
|
|
28
|
+
### From file
|
|
29
|
+
|
|
30
|
+
1. Download `plugin.jpl` from the [latest release](https://github.com/lim0513/joplin-minimap/releases/latest)
|
|
31
|
+
2. In Joplin, go to **Tools → Options → Plugins**
|
|
32
|
+
3. Click the gear icon and select **Install from file**
|
|
33
|
+
4. Choose the downloaded `.jpl` file
|
|
34
|
+
5. Restart Joplin
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
Open any note with 2 or more headings in the **rendered Markdown viewer** (reading view, or the preview side of the split editor):
|
|
39
|
+
|
|
40
|
+
- A column of tick bars appears at the right edge
|
|
41
|
+
- **Hover** over it to expand the full table of contents
|
|
42
|
+
- **Click** an entry to jump to that heading
|
|
43
|
+
|
|
44
|
+
Note: the minimap only appears in the rendered viewer, not in the plain Markdown editor or the Rich Text editor.
|
|
45
|
+
|
|
46
|
+
## How It Works
|
|
47
|
+
|
|
48
|
+
A markdown-it content script injects two assets into the rendered viewer: `minimap-view.js` builds the minimap dynamically from the rendered `h1`–`h6` elements after each render, and `minimap.css` handles the collapsed/expanded styling. The Markdown rendering itself is untouched.
|
|
49
|
+
|
|
50
|
+
## Settings
|
|
51
|
+
|
|
52
|
+
Configurable in **Tools → Options → Joplin Minimap**:
|
|
53
|
+
|
|
54
|
+
- **Minimum headings** — hide the minimap when the note has fewer headings than this (default 2)
|
|
55
|
+
- **Expanded panel width (px)** — maximum width of the hover-expanded table of contents (default 240)
|
|
56
|
+
- **Minimap side** — which edge of the viewer the minimap docks to, right or left (default right)
|
|
57
|
+
- **Default depth** — deepest heading level shown when a note opens; the `+`/`-` buttons change it on the fly (default 6, every level)
|
|
58
|
+
- **Edge distance (px)** — gap between the minimap and the viewer edge it sits on (default 6)
|
|
59
|
+
|
|
60
|
+
Changed settings apply on the next render (switch notes or edit the note).
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
Zero dependencies — no `npm install` needed:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run dist
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This builds `dist/` (loadable via Joplin's **Development plugins** setting pointed at the project root) and `publish/` including `publish/plugin.jpl`.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT
|
package/package.json
CHANGED
package/publish/index.js
CHANGED
|
@@ -1,145 +1,206 @@
|
|
|
1
|
-
/* Joplin Minimap — plugin entry (runs in the plugin host, Node context).
|
|
2
|
-
* Registers the settings UI and a markdown-it content script whose only job
|
|
3
|
-
* is to inject the minimap assets (JS + CSS) into the rendered note viewer.
|
|
4
|
-
* The viewer asset fetches settings via webviewApi.postMessage -> onMessage.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// SettingItemType numeric values: Int=1, String=2, Bool=3 (no 'api' import in plain JS)
|
|
8
|
-
const TYPE_INT = 1;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
/* Joplin Minimap — plugin entry (runs in the plugin host, Node context).
|
|
2
|
+
* Registers the settings UI and a markdown-it content script whose only job
|
|
3
|
+
* is to inject the minimap assets (JS + CSS) into the rendered note viewer.
|
|
4
|
+
* The viewer asset fetches settings via webviewApi.postMessage -> onMessage.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// SettingItemType numeric values: Int=1, String=2, Bool=3 (no 'api' import in plain JS)
|
|
8
|
+
const TYPE_INT = 1;
|
|
9
|
+
const TYPE_STRING = 2;
|
|
10
|
+
const TYPE_BOOL = 3;
|
|
11
|
+
|
|
12
|
+
// Settings-screen strings, resolved from the app locale at registration time
|
|
13
|
+
// (matching Joplin's own restart-on-language-switch behavior).
|
|
14
|
+
const SETTINGS_I18N = {
|
|
15
|
+
en_US: {
|
|
16
|
+
minHeadings: 'Minimum headings',
|
|
17
|
+
minHeadingsDesc: 'Hide the minimap when the note has fewer headings than this. Default: 2.',
|
|
18
|
+
panelWidth: 'Expanded panel width (px)',
|
|
19
|
+
panelWidthDesc: 'Maximum width of the hover-expanded table of contents. Default: 240.',
|
|
20
|
+
edgeOffset: 'Edge distance (px)',
|
|
21
|
+
edgeOffsetDesc: 'Gap between the minimap and the viewer edge it sits on. Default: 6.',
|
|
22
|
+
side: 'Minimap side',
|
|
23
|
+
sideDesc: 'Which edge of the viewer the minimap sits on. Default: right.',
|
|
24
|
+
sideRight: 'Right',
|
|
25
|
+
sideLeft: 'Left',
|
|
26
|
+
maxLevel: 'Default depth',
|
|
27
|
+
maxLevelDesc: 'Deepest heading level shown when a note opens. The +/- buttons at the top of the expanded panel change it on the fly. Default: 6 (every level).',
|
|
28
|
+
showTodos: 'Show to-do markers',
|
|
29
|
+
showTodosDesc: 'Show a small red dot before a section\'s tick bar when it contains open to-dos. Default: on.',
|
|
30
|
+
},
|
|
31
|
+
zh_CN: {
|
|
32
|
+
minHeadings: '最少标题数',
|
|
33
|
+
minHeadingsDesc: '笔记标题数少于此值时隐藏小地图。默认 2。',
|
|
34
|
+
panelWidth: '展开面板宽度(px)',
|
|
35
|
+
panelWidthDesc: '悬停展开的目录面板最大宽度。默认 240。',
|
|
36
|
+
edgeOffset: '边缘距离(px)',
|
|
37
|
+
edgeOffsetDesc: '小地图与阅读器边缘的间距。默认 6。',
|
|
38
|
+
side: '小地图位置',
|
|
39
|
+
sideDesc: '小地图停靠在阅读器的哪一侧边缘。默认靠右。',
|
|
40
|
+
sideRight: '右侧',
|
|
41
|
+
sideLeft: '左侧',
|
|
42
|
+
maxLevel: '默认层级深度',
|
|
43
|
+
maxLevelDesc: '打开笔记时显示到第几级标题。展开面板顶部的 +/- 按钮可随时调整。默认 6(全部层级)。',
|
|
44
|
+
showTodos: '显示待办标记',
|
|
45
|
+
showTodosDesc: '当章节内含未完成待办时,在该章节横线前显示一个小红点提醒。默认开启。',
|
|
46
|
+
},
|
|
47
|
+
zh_TW: {
|
|
48
|
+
minHeadings: '最少標題數',
|
|
49
|
+
minHeadingsDesc: '筆記標題數少於此值時隱藏小地圖。預設 2。',
|
|
50
|
+
panelWidth: '展開面板寬度(px)',
|
|
51
|
+
panelWidthDesc: '懸停展開的目錄面板最大寬度。預設 240。',
|
|
52
|
+
edgeOffset: '邊緣距離(px)',
|
|
53
|
+
edgeOffsetDesc: '小地圖與檢視器邊緣的間距。預設 6。',
|
|
54
|
+
side: '小地圖位置',
|
|
55
|
+
sideDesc: '小地圖停靠在檢視器的哪一側邊緣。預設靠右。',
|
|
56
|
+
sideRight: '右側',
|
|
57
|
+
sideLeft: '左側',
|
|
58
|
+
maxLevel: '預設層級深度',
|
|
59
|
+
maxLevelDesc: '開啟筆記時顯示到第幾級標題。展開面板頂部的 +/- 按鈕可隨時調整。預設 6(全部層級)。',
|
|
60
|
+
showTodos: '顯示待辦標記',
|
|
61
|
+
showTodosDesc: '當章節內含未完成待辦時,在該章節橫線前顯示一個小紅點提醒。預設開啟。',
|
|
62
|
+
},
|
|
63
|
+
ru: {
|
|
64
|
+
minHeadings: 'Минимум заголовков',
|
|
65
|
+
minHeadingsDesc: 'Скрывать миникарту, если заголовков в заметке меньше. По умолчанию: 2.',
|
|
66
|
+
panelWidth: 'Ширина развёрнутой панели (px)',
|
|
67
|
+
panelWidthDesc: 'Максимальная ширина оглавления при наведении. По умолчанию: 240.',
|
|
68
|
+
edgeOffset: 'Отступ от края (px)',
|
|
69
|
+
edgeOffsetDesc: 'Зазор между миникартой и краем просмотра. По умолчанию: 6.',
|
|
70
|
+
side: 'Сторона миникарты',
|
|
71
|
+
sideDesc: 'У какого края области просмотра располагается миникарта. По умолчанию: справа.',
|
|
72
|
+
sideRight: 'Справа',
|
|
73
|
+
sideLeft: 'Слева',
|
|
74
|
+
maxLevel: 'Глубина по умолчанию',
|
|
75
|
+
maxLevelDesc: 'До какого уровня заголовков показывать при открытии заметки. Кнопки +/- вверху развёрнутой панели меняют её на лету. По умолчанию: 6 (все уровни).',
|
|
76
|
+
showTodos: 'Показывать метки задач',
|
|
77
|
+
showTodosDesc: 'Показывать маленькую красную точку перед линией раздела, если в нём есть открытые задачи. По умолчанию: вкл.',
|
|
78
|
+
},
|
|
79
|
+
ja_JP: {
|
|
80
|
+
minHeadings: '最小見出し数',
|
|
81
|
+
minHeadingsDesc: 'ノートの見出しがこの数より少ない場合はミニマップを隠します。既定値:2。',
|
|
82
|
+
panelWidth: '展開パネルの幅(px)',
|
|
83
|
+
panelWidthDesc: 'ホバーで展開する目次の最大幅。既定値:240。',
|
|
84
|
+
edgeOffset: '端からの距離(px)',
|
|
85
|
+
edgeOffsetDesc: 'ミニマップとビューアー端の間隔。既定値:6。',
|
|
86
|
+
side: 'ミニマップの位置',
|
|
87
|
+
sideDesc: 'ミニマップをビューアーのどちら側の端に表示するか。既定値:右。',
|
|
88
|
+
sideRight: '右',
|
|
89
|
+
sideLeft: '左',
|
|
90
|
+
maxLevel: '既定の階層の深さ',
|
|
91
|
+
maxLevelDesc: 'ノートを開いたときに表示する見出しの深さ。展開パネル上部の +/- ボタンでいつでも変更できます。既定値:6(すべての階層)。',
|
|
92
|
+
showTodos: 'ToDoマーカーを表示',
|
|
93
|
+
showTodosDesc: '未完了のToDoを含むセクションの線の前に小さな赤い点を表示します。既定値:オン。',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
function settingsI18n(locale) {
|
|
98
|
+
if (SETTINGS_I18N[locale]) return SETTINGS_I18N[locale];
|
|
99
|
+
const lang = String(locale || '').split('_')[0];
|
|
100
|
+
if (lang === 'zh') return SETTINGS_I18N.zh_CN;
|
|
101
|
+
if (lang === 'ru') return SETTINGS_I18N.ru;
|
|
102
|
+
if (lang === 'ja') return SETTINGS_I18N.ja_JP;
|
|
103
|
+
return SETTINGS_I18N.en_US;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
joplin.plugins.register({
|
|
107
|
+
onStart: async function () {
|
|
108
|
+
const locale = (await joplin.settings.globalValue('locale')) || 'en_US';
|
|
109
|
+
const t = settingsI18n(locale);
|
|
110
|
+
|
|
111
|
+
await joplin.settings.registerSection('minimap', {
|
|
112
|
+
label: 'Joplin Minimap',
|
|
113
|
+
iconName: 'fas fa-list',
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
await joplin.settings.registerSettings({
|
|
118
|
+
'minimapMinHeadings': {
|
|
119
|
+
value: 2,
|
|
120
|
+
minimum: 1,
|
|
121
|
+
type: TYPE_INT,
|
|
122
|
+
section: 'minimap',
|
|
123
|
+
public: true,
|
|
124
|
+
label: t.minHeadings,
|
|
125
|
+
description: t.minHeadingsDesc,
|
|
126
|
+
},
|
|
127
|
+
'minimapPanelWidth': {
|
|
128
|
+
value: 240,
|
|
129
|
+
minimum: 120,
|
|
130
|
+
type: TYPE_INT,
|
|
131
|
+
section: 'minimap',
|
|
132
|
+
public: true,
|
|
133
|
+
label: t.panelWidth,
|
|
134
|
+
description: t.panelWidthDesc,
|
|
135
|
+
},
|
|
136
|
+
// Stored key stays 'minimapRightOffset' even though the label is now
|
|
137
|
+
// side-neutral: renaming a setting key orphans the saved value.
|
|
138
|
+
'minimapRightOffset': {
|
|
139
|
+
value: 6,
|
|
140
|
+
minimum: 0,
|
|
141
|
+
type: TYPE_INT,
|
|
142
|
+
section: 'minimap',
|
|
143
|
+
public: true,
|
|
144
|
+
label: t.edgeOffset,
|
|
145
|
+
description: t.edgeOffsetDesc,
|
|
146
|
+
},
|
|
147
|
+
// Enum rather than a bool: 'Left'/'Right' reads unambiguously in the
|
|
148
|
+
// settings screen, and leaves room for a future 'auto' that follows
|
|
149
|
+
// the note's own text direction.
|
|
150
|
+
'minimapSide': {
|
|
151
|
+
value: 'right',
|
|
152
|
+
type: TYPE_STRING,
|
|
153
|
+
isEnum: true,
|
|
154
|
+
options: { right: t.sideRight, left: t.sideLeft },
|
|
155
|
+
section: 'minimap',
|
|
156
|
+
public: true,
|
|
157
|
+
label: t.side,
|
|
158
|
+
description: t.sideDesc,
|
|
159
|
+
},
|
|
160
|
+
// Only the STARTING depth. The stepper in the panel overrides it for
|
|
161
|
+
// the rest of the session without writing back here - a setting that
|
|
162
|
+
// rewrote itself on every click would fight the user's own default.
|
|
163
|
+
'minimapMaxLevel': {
|
|
164
|
+
value: 6,
|
|
165
|
+
minimum: 1,
|
|
166
|
+
maximum: 6,
|
|
167
|
+
type: TYPE_INT,
|
|
168
|
+
section: 'minimap',
|
|
169
|
+
public: true,
|
|
170
|
+
label: t.maxLevel,
|
|
171
|
+
description: t.maxLevelDesc,
|
|
172
|
+
},
|
|
173
|
+
'minimapShowTodos': {
|
|
174
|
+
value: true,
|
|
175
|
+
type: TYPE_BOOL,
|
|
176
|
+
section: 'minimap',
|
|
177
|
+
public: true,
|
|
178
|
+
label: t.showTodos,
|
|
179
|
+
description: t.showTodosDesc,
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
} catch (error) {
|
|
183
|
+
console.error('Joplin Minimap: registerSettings failed:', error);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
await joplin.contentScripts.register(
|
|
187
|
+
'markdownItPlugin',
|
|
188
|
+
'joplin-minimap',
|
|
189
|
+
'./minimapContentScript.js'
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
await joplin.contentScripts.onMessage('joplin-minimap', async function (message) {
|
|
193
|
+
if (message === 'getSettings') {
|
|
194
|
+
return {
|
|
195
|
+
minHeadings: await joplin.settings.value('minimapMinHeadings'),
|
|
196
|
+
panelWidth: await joplin.settings.value('minimapPanelWidth'),
|
|
197
|
+
rightOffset: await joplin.settings.value('minimapRightOffset'),
|
|
198
|
+
side: await joplin.settings.value('minimapSide'),
|
|
199
|
+
maxLevel: await joplin.settings.value('minimapMaxLevel'),
|
|
200
|
+
showTodos: await joplin.settings.value('minimapShowTodos'),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
});
|
package/publish/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": 1,
|
|
3
3
|
"id": "com.github.joplin-minimap",
|
|
4
4
|
"app_min_version": "2.8",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"name": "Joplin Minimap",
|
|
7
7
|
"description": "A hover-to-expand table of contents minimap for the note viewer. Shows heading tick marks on the right edge; hover to expand into a full ToC, click to jump.",
|
|
8
8
|
"author": "lim0513",
|