Skip to content

Commit c269e1b

Browse files
committedJan 24, 2025
plugins/markdown-preview: remove helpers
1 parent c0dda6c commit c269e1b

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed
 

‎plugins/by-name/markdown-preview/default.nix

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
lib,
3-
helpers,
43
...
54
}:
65
let
76
inherit (lib) types;
7+
inherit (lib.nixvim) defaultNullOpts;
88
in
99
lib.nixvim.plugins.mkVimPlugin {
1010
name = "markdown-preview";
@@ -42,74 +42,74 @@ lib.nixvim.plugins.mkVimPlugin {
4242
];
4343

4444
settingsOptions = {
45-
auto_start = helpers.defaultNullOpts.mkFlagInt 0 ''
45+
auto_start = defaultNullOpts.mkFlagInt 0 ''
4646
Open the preview window after entering the markdown buffer.
4747
'';
4848

49-
auto_close = helpers.defaultNullOpts.mkFlagInt 1 ''
49+
auto_close = defaultNullOpts.mkFlagInt 1 ''
5050
Auto close current preview window when change from markdown buffer to another buffer.
5151
'';
5252

53-
refresh_slow = helpers.defaultNullOpts.mkFlagInt 0 ''
53+
refresh_slow = defaultNullOpts.mkFlagInt 0 ''
5454
Refresh markdown when save the buffer or leave from insert mode, default `0` is auto
5555
refresh markdown as you edit or move the cursor.
5656
'';
5757

58-
command_for_global = helpers.defaultNullOpts.mkFlagInt 0 ''
58+
command_for_global = defaultNullOpts.mkFlagInt 0 ''
5959
Enable markdown preview for all files (by default, the plugin is only enabled for markdown
6060
files).
6161
'';
6262

63-
open_to_the_world = helpers.defaultNullOpts.mkFlagInt 0 ''
63+
open_to_the_world = defaultNullOpts.mkFlagInt 0 ''
6464
Make the preview server available to others in your network.
6565
By default, the server listens on localhost (127.0.0.1).
6666
'';
6767

68-
open_ip = helpers.defaultNullOpts.mkStr "" ''
68+
open_ip = defaultNullOpts.mkStr "" ''
6969
Custom IP used to open the preview page.
7070
This can be useful when you work in remote vim and preview on local browser.
7171
For more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9.
7272
'';
7373

74-
browser = helpers.defaultNullOpts.mkStr "" ''
74+
browser = defaultNullOpts.mkStr "" ''
7575
The browser to open the preview page.
7676
'';
7777

78-
echo_preview_url = helpers.defaultNullOpts.mkFlagInt 0 ''
78+
echo_preview_url = defaultNullOpts.mkFlagInt 0 ''
7979
Echo preview page url in command line when opening the preview page.
8080
'';
8181

82-
browserfunc = helpers.defaultNullOpts.mkStr "" ''
82+
browserfunc = defaultNullOpts.mkStr "" ''
8383
A custom vim function name to open preview page.
8484
This function will receive url as param.
8585
'';
8686

87-
preview_options = helpers.mkNullOrOption (types.submodule {
87+
preview_options = lib.nixvim.mkNullOrOption (types.submodule {
8888
freeformType = types.attrs;
8989

9090
options = {
91-
mkit = helpers.defaultNullOpts.mkListOf types.str [ ] ''
91+
mkit = defaultNullOpts.mkListOf types.str [ ] ''
9292
`markdown-it` options for render.
9393
'';
9494

95-
katex = helpers.defaultNullOpts.mkListOf types.str [ ] ''
95+
katex = defaultNullOpts.mkListOf types.str [ ] ''
9696
`katex` options for math.
9797
'';
9898

99-
uml = helpers.defaultNullOpts.mkListOf types.str [ ] ''
99+
uml = defaultNullOpts.mkListOf types.str [ ] ''
100100
`markdown-it-plantuml` options.
101101
'';
102102

103-
maid = helpers.defaultNullOpts.mkListOf types.str [ ] ''
103+
maid = defaultNullOpts.mkListOf types.str [ ] ''
104104
`mermaid` options.
105105
'';
106106

107-
disable_sync_scroll = helpers.defaultNullOpts.mkFlagInt 0 ''
107+
disable_sync_scroll = defaultNullOpts.mkFlagInt 0 ''
108108
Disable sync scroll.
109109
'';
110110

111111
sync_scroll_type =
112-
helpers.defaultNullOpts.mkEnumFirstDefault
112+
defaultNullOpts.mkEnumFirstDefault
113113
[
114114
"middle"
115115
"top"
@@ -122,62 +122,62 @@ lib.nixvim.plugins.mkVimPlugin {
122122
- "relative": The cursor position is always shown at the relative position of the preview page.
123123
'';
124124

125-
hide_yaml_meta = helpers.defaultNullOpts.mkFlagInt 1 ''
125+
hide_yaml_meta = defaultNullOpts.mkFlagInt 1 ''
126126
Hide yaml metadata.
127127
'';
128128

129-
sequence_diagrams = helpers.defaultNullOpts.mkListOf types.str [ ] ''
129+
sequence_diagrams = defaultNullOpts.mkListOf types.str [ ] ''
130130
`js-sequence-diagrams` options.
131131
'';
132132

133-
flowchart_diagrams = helpers.defaultNullOpts.mkListOf types.str [ ] ''
133+
flowchart_diagrams = defaultNullOpts.mkListOf types.str [ ] ''
134134
`flowcharts` diagrams options.
135135
'';
136136

137-
content_editable = helpers.defaultNullOpts.mkFlagInt 0 ''
137+
content_editable = defaultNullOpts.mkFlagInt 0 ''
138138
Content editable from the preview page.
139139
'';
140140

141-
disable_filename = helpers.defaultNullOpts.mkFlagInt 0 ''
141+
disable_filename = defaultNullOpts.mkFlagInt 0 ''
142142
Disable filename header for the preview page.
143143
'';
144144

145-
toc = helpers.defaultNullOpts.mkListOf types.str [ ] ''
145+
toc = defaultNullOpts.mkListOf types.str [ ] ''
146146
Toc options.
147147
'';
148148
};
149149
}) "Preview options";
150150

151-
markdown_css = helpers.defaultNullOpts.mkStr "" ''
151+
markdown_css = defaultNullOpts.mkStr "" ''
152152
Custom markdown style.
153153
Must be an absolute path like `"/Users/username/markdown.css"` or
154154
`{__raw = "vim.fn.expand('~/markdown.css')";}`.
155155
'';
156156

157-
highlight_css = helpers.defaultNullOpts.mkStr "" ''
157+
highlight_css = defaultNullOpts.mkStr "" ''
158158
Custom highlight style.
159159
Must be an absolute path like "/Users/username/highlight.css" or
160160
`{__raw = "vim.fn.expand('~/highlight.css')";}`.
161161
'';
162162

163-
port = helpers.defaultNullOpts.mkStr "" ''
163+
port = defaultNullOpts.mkStr "" ''
164164
Custom port to start server or empty for random.
165165
'';
166166

167-
page_title = helpers.defaultNullOpts.mkStr "「\$\{name}」" ''
167+
page_title = defaultNullOpts.mkStr "「\$\{name}」" ''
168168
Preview page title.
169169
`$${name}` will be replaced with the file name.
170170
'';
171171

172-
images_path = helpers.defaultNullOpts.mkStr "" ''
172+
images_path = defaultNullOpts.mkStr "" ''
173173
Use a custom location for images.
174174
'';
175175

176-
filetypes = helpers.defaultNullOpts.mkListOf types.str [ "markdown" ] ''
176+
filetypes = defaultNullOpts.mkListOf types.str [ "markdown" ] ''
177177
Recognized filetypes. These filetypes will have `MarkdownPreview...` commands.
178178
'';
179179

180-
theme = helpers.defaultNullOpts.mkEnum' {
180+
theme = defaultNullOpts.mkEnum' {
181181
values = [
182182
"dark"
183183
"light"
@@ -188,13 +188,13 @@ lib.nixvim.plugins.mkVimPlugin {
188188
pluginDefault = lib.literalMD "chosen based on system preferences";
189189
};
190190

191-
combine_preview = helpers.defaultNullOpts.mkFlagInt 0 ''
191+
combine_preview = defaultNullOpts.mkFlagInt 0 ''
192192
Combine preview window.
193193
If enable it will reuse previous opened preview window when you preview markdown file.
194194
Ensure to set `auto_close = 0` if you have enable this option.
195195
'';
196196

197-
combine_preview_auto_refresh = helpers.defaultNullOpts.mkFlagInt 1 ''
197+
combine_preview_auto_refresh = defaultNullOpts.mkFlagInt 1 ''
198198
Auto refetch combine preview contents when change markdown buffer only when
199199
`combine_preview` is `1`.
200200
'';

0 commit comments

Comments
 (0)
Please sign in to comment.