@remloyal/docsify-plugins 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 - present Docsify Contributors (https://github.com/docsifyjs/docsify/graphs/contributors)
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 ADDED
@@ -0,0 +1,72 @@
1
+ # docsify-plugins
2
+
3
+ Firstly, make sure that the [loadSidebar](https://docsify.js.org/#/configuration?id=loadsidebar) config is enabled,and the Markdown file `_sidebar.md` is provided in the root directory.
4
+
5
+ Then insert script into document just like the [official plugins](https://docsify.js.org/#/plugins)'s usage
6
+
7
+ ## docsify-flexsearch
8
+ reference [docsify-search](https://github.com/docsifyjs/docsify/blob/develop/src/plugins/search/index.js)
9
+
10
+ ### Usage
11
+
12
+ ```html
13
+ <script>
14
+ window.$docsify = {
15
+ // Complete configuration parameters
16
+ search: {
17
+ // Location in sidebar (default: prepended as first child)
18
+ // Optionally specify insertAfter or insertBefore (not both)
19
+ insertAfter: ".app-name", // CSS selector in .sidebar scope
20
+ insertBefore: ".sidebar-nav", // CSS selector in .sidebar scope
21
+
22
+ maxAge: 86400000, // Expiration time, the default one day
23
+ paths: [], // or 'auto'
24
+ placeholder: "Type to search",
25
+
26
+ // Localization
27
+ placeholder: {
28
+ "/zh-cn/": "搜索",
29
+ "/": "Type to search",
30
+ },
31
+
32
+ noData: "No Results!",
33
+
34
+ // Localization
35
+ noData: {
36
+ "/zh-cn/": "找不到结果",
37
+ "/": "No Results",
38
+ },
39
+
40
+ // Headline depth, 1 - 6
41
+ depth: 2,
42
+
43
+ hideOtherSidebarContent: true, // Deprecated as of v5
44
+
45
+ // To avoid search index collision
46
+ // between multiple websites under the same domain
47
+ namespace: "website-1",
48
+
49
+ // Use different indexes for path prefixes (namespaces).
50
+ // NOTE: Only works in 'auto' mode.
51
+ //
52
+ // When initialiazing an index, we look for the first path from the sidebar.
53
+ // If it matches the prefix from the list, we switch to the corresponding index.
54
+ pathNamespaces: ["/zh-cn", "/ru-ru", "/ru-ru/v1"],
55
+
56
+ // You can provide a regexp to match prefixes. In this case,
57
+ // the matching substring will be used to identify the index
58
+ pathNamespaces: /^(\/(zh-cn|ru-ru))?(\/(v1|v2))?/,
59
+ // 'sidebar' | 'modal', Default is sidebar, modalModal will use pop-up mode
60
+ mode: "sidebar",
61
+ },
62
+ };
63
+ </script>
64
+ <script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
65
+
66
+ <!-- plugins -->
67
+ <script src="flexsearch/docsify-flexsearch.min.js"></script>
68
+ ```
69
+
70
+ ## docsify-sidebar-collapse
71
+
72
+ reference [docsify-sidebar-collapse](https://github.com/iPeng6/docsify-sidebar-collapse)
@@ -0,0 +1,248 @@
1
+ /* prettier-ignore */
2
+ :root {
3
+ --plugin-flexsearch-input-bg : var(--form-element-bg);
4
+ --plugin-flexsearch-input-border-color : var(--sidebar-border-color);
5
+ --plugin-flexsearch-input-border-radius: var(--form-element-border-radius);
6
+ --plugin-flexsearch-input-color : var(--form-element-color);
7
+ --plugin-flexsearch-kbd-bg : var(--color-bg);
8
+ --plugin-flexsearch-kbd-border : 1px solid var(--color-mono-3);
9
+ --plugin-flexsearch-kbd-border-radius : 4px;
10
+ --plugin-flexsearch-kbd-color : var(--color-mono-5);
11
+ --plugin-flexsearch-margin : 10px;
12
+ --plugin-flexsearch-reset-bg : var(--theme-color);
13
+ --plugin-flexsearch-reset-border : transparent;
14
+ --plugin-flexsearch-reset-border-radius: var(--border-radius);
15
+ --plugin-flexsearch-reset-color : #fff;
16
+ }
17
+
18
+ .flexsearch-search {
19
+ margin: var(--plugin-flexsearch-margin);
20
+ }
21
+
22
+ .flexsearch-search .input-wrap {
23
+ position: relative;
24
+ }
25
+
26
+ .flexsearch-search input {
27
+ width: 100%;
28
+ padding-inline-end: 36px;
29
+ border: 1px solid var(--plugin-flexsearch-input-border-color);
30
+ border-radius: var(--plugin-flexsearch-input-border-radius);
31
+ background: var(--plugin-flexsearch-input-bg);
32
+ color: var(--plugin-flexsearch-input-color);
33
+ }
34
+
35
+ .flexsearch-search input::-webkit-search-decoration,
36
+ .flexsearch-search input::-webkit-search-cancel-button {
37
+ -webkit-appearance: none;
38
+ appearance: none;
39
+ }
40
+
41
+ .flexsearch-search .clear-button,
42
+ .flexsearch-search .kbd-group {
43
+ visibility: hidden;
44
+ display: flex;
45
+ gap: 0.15em;
46
+ position: absolute;
47
+ right: 7px;
48
+ top: 50%;
49
+ opacity: 0;
50
+ translate: 0 -50%;
51
+ transition-property: opacity, visibility;
52
+ transition-duration: var(--duration-medium);
53
+ }
54
+
55
+ .flexsearch-search input:valid ~ .clear-button,
56
+ .flexsearch-search input:invalid:where(:focus, :hover) ~ .kbd-group,
57
+ .flexsearch-search .kbd-group:hover {
58
+ visibility: visible;
59
+ opacity: 1;
60
+ }
61
+
62
+ .flexsearch-search .clear-button {
63
+ --_button-size: 20px;
64
+ --_content-size: 12px;
65
+
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ height: var(--_button-size);
70
+ width: var(--_button-size);
71
+ border: var(--plugin-flexsearch-reset-border);
72
+ border-radius: var(--plugin-flexsearch-reset-border-radius);
73
+ background: var(--plugin-flexsearch-reset-bg);
74
+ cursor: pointer;
75
+ }
76
+
77
+ .flexsearch-search .clear-button::before,
78
+ .flexsearch-search .clear-button::after {
79
+ content: "";
80
+ position: absolute;
81
+ height: 2px;
82
+ width: var(--_content-size);
83
+ color: var(--plugin-flexsearch-reset-color);
84
+ background: var(--plugin-flexsearch-reset-color);
85
+ }
86
+
87
+ .flexsearch-search .clear-button::before {
88
+ rotate: 45deg;
89
+ }
90
+
91
+ .flexsearch-search .clear-button::after {
92
+ rotate: -45deg;
93
+ }
94
+
95
+ .flexsearch-search kbd {
96
+ border: var(--plugin-flexsearch-kbd-border);
97
+ border-radius: var(--plugin-flexsearch-kbd-border-radius);
98
+ background: var(--plugin-flexsearch-kbd-bg);
99
+ color: var(--plugin-flexsearch-kbd-color);
100
+ font-size: var(--font-size-s);
101
+ }
102
+
103
+ .flexsearch-search a:hover {
104
+ color: var(--theme-color);
105
+ }
106
+
107
+ .flexsearch-search .results-panel:empty {
108
+ display: none;
109
+ }
110
+
111
+ .flexsearch-search:has(.results-panel:not(:empty)) ~ * {
112
+ display: none;
113
+ }
114
+
115
+ .flexsearch-search:where(:has(input:valid:focus), :has(.results-panel::empty))
116
+ ~ * {
117
+ opacity: 0.2;
118
+ }
119
+
120
+ .flexsearch-search .matching-post {
121
+ overflow: hidden;
122
+ padding: 1em 0 1.2em 0;
123
+ border-bottom: 1px solid var(--color-mono-2);
124
+ }
125
+
126
+ .flexsearch-search .matching-post:hover a {
127
+ text-decoration-color: transparent;
128
+ }
129
+
130
+ .flexsearch-search .matching-post:hover .title {
131
+ text-decoration: inherit;
132
+ text-decoration-color: var(--link-underline-color-hover);
133
+ }
134
+
135
+ .flexsearch-search .matching-post .title {
136
+ margin: 0 0 0.5em 0;
137
+ line-height: 1.4;
138
+ }
139
+
140
+ .flexsearch-search .matching-post .content {
141
+ margin: 0;
142
+ color: var(--color-mono-6);
143
+ font-size: var(--font-size-s);
144
+ }
145
+
146
+ .flexsearch-search .results-status {
147
+ margin-bottom: 0;
148
+ color: var(--color-mono-6);
149
+ font-size: var(--font-size-s);
150
+ }
151
+
152
+ .flexsearch-search .results-status:empty {
153
+ display: none;
154
+ }
155
+
156
+ /* Modal */
157
+ /* ================================== */
158
+ .flexsearch-modal {
159
+ position: fixed;
160
+ inset: 0;
161
+ display: none;
162
+ z-index: 9999;
163
+ }
164
+
165
+ .flexsearch-modal.is-open {
166
+ display: block;
167
+ }
168
+
169
+ .flexsearch-modal__backdrop {
170
+ position: absolute;
171
+ inset: 0;
172
+ background: rgba(0, 0, 0, 0.35);
173
+ }
174
+
175
+ .flexsearch-modal__dialog {
176
+ position: relative;
177
+ margin: 8vh auto 0 auto;
178
+ max-width: min(720px, calc(100vw - 24px));
179
+ max-height: 80vh;
180
+ overflow: hidden;
181
+ display: flex;
182
+ flex-direction: column;
183
+ background: var(--sidebar-background, var(--color-bg));
184
+ border: 1px solid var(--sidebar-border-color, var(--color-mono-2));
185
+ border-radius: 10px;
186
+ box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
187
+ }
188
+
189
+ .flexsearch-modal__dialog .flexsearch-search {
190
+ margin: 12px;
191
+ display: flex;
192
+ flex-direction: column;
193
+ min-height: 0;
194
+ flex: 1 1 auto;
195
+ }
196
+
197
+ .flexsearch-modal__dialog .flexsearch-search .results-panel {
198
+ overflow: auto;
199
+ min-height: 0;
200
+ flex: 1 1 auto;
201
+ }
202
+
203
+ /* Modal trigger (sidebar) */
204
+ /* ================================== */
205
+ .flexsearch-trigger {
206
+ margin: var(--plugin-flexsearch-margin);
207
+ }
208
+
209
+ .flexsearch-trigger .input-wrap {
210
+ position: relative;
211
+ }
212
+
213
+ .flexsearch-trigger input {
214
+ width: 100%;
215
+ padding-inline-end: 36px;
216
+ border: 1px solid var(--plugin-flexsearch-input-border-color);
217
+ border-radius: var(--plugin-flexsearch-input-border-radius);
218
+ background: var(--plugin-flexsearch-input-bg);
219
+ color: var(--plugin-flexsearch-input-color);
220
+ cursor: pointer;
221
+ }
222
+
223
+ .flexsearch-trigger .kbd-group {
224
+ visibility: hidden;
225
+ display: flex;
226
+ gap: 0.15em;
227
+ position: absolute;
228
+ right: 7px;
229
+ top: 50%;
230
+ opacity: 0;
231
+ translate: 0 -50%;
232
+ transition-property: opacity, visibility;
233
+ transition-duration: var(--duration-medium);
234
+ }
235
+
236
+ .flexsearch-trigger input:where(:focus, :hover) ~ .kbd-group,
237
+ .flexsearch-trigger .kbd-group:hover {
238
+ visibility: visible;
239
+ opacity: 1;
240
+ }
241
+
242
+ .flexsearch-trigger kbd {
243
+ border: var(--plugin-flexsearch-kbd-border);
244
+ border-radius: var(--plugin-flexsearch-kbd-border-radius);
245
+ background: var(--plugin-flexsearch-kbd-bg);
246
+ color: var(--plugin-flexsearch-kbd-color);
247
+ font-size: var(--font-size-s);
248
+ }