1
1
{
2
2
lib ,
3
- helpers ,
4
3
...
5
4
} :
6
5
let
7
6
inherit ( lib ) types ;
7
+ inherit ( lib . nixvim ) defaultNullOpts ;
8
8
in
9
9
lib . nixvim . plugins . mkVimPlugin {
10
10
name = "markdown-preview" ;
@@ -42,74 +42,74 @@ lib.nixvim.plugins.mkVimPlugin {
42
42
] ;
43
43
44
44
settingsOptions = {
45
- auto_start = helpers . defaultNullOpts . mkFlagInt 0 ''
45
+ auto_start = defaultNullOpts . mkFlagInt 0 ''
46
46
Open the preview window after entering the markdown buffer.
47
47
'' ;
48
48
49
- auto_close = helpers . defaultNullOpts . mkFlagInt 1 ''
49
+ auto_close = defaultNullOpts . mkFlagInt 1 ''
50
50
Auto close current preview window when change from markdown buffer to another buffer.
51
51
'' ;
52
52
53
- refresh_slow = helpers . defaultNullOpts . mkFlagInt 0 ''
53
+ refresh_slow = defaultNullOpts . mkFlagInt 0 ''
54
54
Refresh markdown when save the buffer or leave from insert mode, default `0` is auto
55
55
refresh markdown as you edit or move the cursor.
56
56
'' ;
57
57
58
- command_for_global = helpers . defaultNullOpts . mkFlagInt 0 ''
58
+ command_for_global = defaultNullOpts . mkFlagInt 0 ''
59
59
Enable markdown preview for all files (by default, the plugin is only enabled for markdown
60
60
files).
61
61
'' ;
62
62
63
- open_to_the_world = helpers . defaultNullOpts . mkFlagInt 0 ''
63
+ open_to_the_world = defaultNullOpts . mkFlagInt 0 ''
64
64
Make the preview server available to others in your network.
65
65
By default, the server listens on localhost (127.0.0.1).
66
66
'' ;
67
67
68
- open_ip = helpers . defaultNullOpts . mkStr "" ''
68
+ open_ip = defaultNullOpts . mkStr "" ''
69
69
Custom IP used to open the preview page.
70
70
This can be useful when you work in remote vim and preview on local browser.
71
71
For more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9.
72
72
'' ;
73
73
74
- browser = helpers . defaultNullOpts . mkStr "" ''
74
+ browser = defaultNullOpts . mkStr "" ''
75
75
The browser to open the preview page.
76
76
'' ;
77
77
78
- echo_preview_url = helpers . defaultNullOpts . mkFlagInt 0 ''
78
+ echo_preview_url = defaultNullOpts . mkFlagInt 0 ''
79
79
Echo preview page url in command line when opening the preview page.
80
80
'' ;
81
81
82
- browserfunc = helpers . defaultNullOpts . mkStr "" ''
82
+ browserfunc = defaultNullOpts . mkStr "" ''
83
83
A custom vim function name to open preview page.
84
84
This function will receive url as param.
85
85
'' ;
86
86
87
- preview_options = helpers . mkNullOrOption ( types . submodule {
87
+ preview_options = lib . nixvim . mkNullOrOption ( types . submodule {
88
88
freeformType = types . attrs ;
89
89
90
90
options = {
91
- mkit = helpers . defaultNullOpts . mkListOf types . str [ ] ''
91
+ mkit = defaultNullOpts . mkListOf types . str [ ] ''
92
92
`markdown-it` options for render.
93
93
'' ;
94
94
95
- katex = helpers . defaultNullOpts . mkListOf types . str [ ] ''
95
+ katex = defaultNullOpts . mkListOf types . str [ ] ''
96
96
`katex` options for math.
97
97
'' ;
98
98
99
- uml = helpers . defaultNullOpts . mkListOf types . str [ ] ''
99
+ uml = defaultNullOpts . mkListOf types . str [ ] ''
100
100
`markdown-it-plantuml` options.
101
101
'' ;
102
102
103
- maid = helpers . defaultNullOpts . mkListOf types . str [ ] ''
103
+ maid = defaultNullOpts . mkListOf types . str [ ] ''
104
104
`mermaid` options.
105
105
'' ;
106
106
107
- disable_sync_scroll = helpers . defaultNullOpts . mkFlagInt 0 ''
107
+ disable_sync_scroll = defaultNullOpts . mkFlagInt 0 ''
108
108
Disable sync scroll.
109
109
'' ;
110
110
111
111
sync_scroll_type =
112
- helpers . defaultNullOpts . mkEnumFirstDefault
112
+ defaultNullOpts . mkEnumFirstDefault
113
113
[
114
114
"middle"
115
115
"top"
@@ -122,62 +122,62 @@ lib.nixvim.plugins.mkVimPlugin {
122
122
- "relative": The cursor position is always shown at the relative position of the preview page.
123
123
'' ;
124
124
125
- hide_yaml_meta = helpers . defaultNullOpts . mkFlagInt 1 ''
125
+ hide_yaml_meta = defaultNullOpts . mkFlagInt 1 ''
126
126
Hide yaml metadata.
127
127
'' ;
128
128
129
- sequence_diagrams = helpers . defaultNullOpts . mkListOf types . str [ ] ''
129
+ sequence_diagrams = defaultNullOpts . mkListOf types . str [ ] ''
130
130
`js-sequence-diagrams` options.
131
131
'' ;
132
132
133
- flowchart_diagrams = helpers . defaultNullOpts . mkListOf types . str [ ] ''
133
+ flowchart_diagrams = defaultNullOpts . mkListOf types . str [ ] ''
134
134
`flowcharts` diagrams options.
135
135
'' ;
136
136
137
- content_editable = helpers . defaultNullOpts . mkFlagInt 0 ''
137
+ content_editable = defaultNullOpts . mkFlagInt 0 ''
138
138
Content editable from the preview page.
139
139
'' ;
140
140
141
- disable_filename = helpers . defaultNullOpts . mkFlagInt 0 ''
141
+ disable_filename = defaultNullOpts . mkFlagInt 0 ''
142
142
Disable filename header for the preview page.
143
143
'' ;
144
144
145
- toc = helpers . defaultNullOpts . mkListOf types . str [ ] ''
145
+ toc = defaultNullOpts . mkListOf types . str [ ] ''
146
146
Toc options.
147
147
'' ;
148
148
} ;
149
149
} ) "Preview options" ;
150
150
151
- markdown_css = helpers . defaultNullOpts . mkStr "" ''
151
+ markdown_css = defaultNullOpts . mkStr "" ''
152
152
Custom markdown style.
153
153
Must be an absolute path like `"/Users/username/markdown.css"` or
154
154
`{__raw = "vim.fn.expand('~/markdown.css')";}`.
155
155
'' ;
156
156
157
- highlight_css = helpers . defaultNullOpts . mkStr "" ''
157
+ highlight_css = defaultNullOpts . mkStr "" ''
158
158
Custom highlight style.
159
159
Must be an absolute path like "/Users/username/highlight.css" or
160
160
`{__raw = "vim.fn.expand('~/highlight.css')";}`.
161
161
'' ;
162
162
163
- port = helpers . defaultNullOpts . mkStr "" ''
163
+ port = defaultNullOpts . mkStr "" ''
164
164
Custom port to start server or empty for random.
165
165
'' ;
166
166
167
- page_title = helpers . defaultNullOpts . mkStr "「\ $\{ name}」" ''
167
+ page_title = defaultNullOpts . mkStr "「\ $\{ name}」" ''
168
168
Preview page title.
169
169
`$${name}` will be replaced with the file name.
170
170
'' ;
171
171
172
- images_path = helpers . defaultNullOpts . mkStr "" ''
172
+ images_path = defaultNullOpts . mkStr "" ''
173
173
Use a custom location for images.
174
174
'' ;
175
175
176
- filetypes = helpers . defaultNullOpts . mkListOf types . str [ "markdown" ] ''
176
+ filetypes = defaultNullOpts . mkListOf types . str [ "markdown" ] ''
177
177
Recognized filetypes. These filetypes will have `MarkdownPreview...` commands.
178
178
'' ;
179
179
180
- theme = helpers . defaultNullOpts . mkEnum' {
180
+ theme = defaultNullOpts . mkEnum' {
181
181
values = [
182
182
"dark"
183
183
"light"
@@ -188,13 +188,13 @@ lib.nixvim.plugins.mkVimPlugin {
188
188
pluginDefault = lib . literalMD "chosen based on system preferences" ;
189
189
} ;
190
190
191
- combine_preview = helpers . defaultNullOpts . mkFlagInt 0 ''
191
+ combine_preview = defaultNullOpts . mkFlagInt 0 ''
192
192
Combine preview window.
193
193
If enable it will reuse previous opened preview window when you preview markdown file.
194
194
Ensure to set `auto_close = 0` if you have enable this option.
195
195
'' ;
196
196
197
- combine_preview_auto_refresh = helpers . defaultNullOpts . mkFlagInt 1 ''
197
+ combine_preview_auto_refresh = defaultNullOpts . mkFlagInt 1 ''
198
198
Auto refetch combine preview contents when change markdown buffer only when
199
199
`combine_preview` is `1`.
200
200
'' ;
0 commit comments