File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ by the user.
49
49
50
50
``` lua
51
51
require (' render-markdown' ).setup ({
52
+ -- Configure whether Markdown should be rendered by default or not
53
+ start_enabled = true ,
52
54
-- Capture groups that get pulled from markdown
53
55
markdown_query = [[
54
56
(atx_heading [
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ local M = {}
34
34
--- @field public checked ? string
35
35
36
36
--- @class UserConfig
37
+ --- @field public start_enabled ? boolean
37
38
--- @field public markdown_query ? string
38
39
--- @field public inline_query ? string
39
40
--- @field public log_level ? ' debug' | ' error'
@@ -52,6 +53,7 @@ local M = {}
52
53
function M .setup (opts )
53
54
--- @type Config
54
55
local default_config = {
56
+ start_enabled = true ,
55
57
markdown_query = [[
56
58
(atx_heading [
57
59
(atx_h1_marker)
@@ -128,9 +130,10 @@ function M.setup(opts)
128
130
latex = ' @markup.math' ,
129
131
quote = ' @markup.quote' ,
130
132
},
133
+ enabled = true ,
131
134
}
132
- state .enabled = true
133
135
state .config = vim .tbl_deep_extend (' force' , default_config , opts or {})
136
+ state .enabled = state .config .start_enabled
134
137
state .markdown_query = vim .treesitter .query .parse (' markdown' , state .config .markdown_query )
135
138
state .inline_query = vim .treesitter .query .parse (' markdown_inline' , state .config .inline_query )
136
139
@@ -169,3 +172,4 @@ M.toggle = function()
169
172
end
170
173
171
174
return M
175
+
Original file line number Diff line number Diff line change 29
29
--- @field public checked string
30
30
31
31
--- @class Config
32
+ --- @field public start_enabled boolean
32
33
--- @field public markdown_query string
33
34
--- @field public inline_query string
34
35
--- @field public log_level ' debug' | ' error'
You can’t perform that action at this time.
0 commit comments