Skip to content

Commit 56959c5

Browse files
Modify readme to split default configuration and document behavior of various parameters
1 parent fe2ebe7 commit 56959c5

File tree

1 file changed

+53
-34
lines changed

1 file changed

+53
-34
lines changed

README.md

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,63 @@ Plugin is experimental at this time
2828
'MeanderingProgrammer/markdown.nvim',
2929
dependencies = { 'nvim-treesitter/nvim-treesitter' },
3030
config = function()
31-
require('markdown').setup({
32-
query = vim.treesitter.query.parse(
33-
'markdown',
34-
[[
35-
(atx_heading [
36-
(atx_h1_marker)
37-
(atx_h2_marker)
38-
(atx_h3_marker)
39-
(atx_h4_marker)
40-
(atx_h5_marker)
41-
(atx_h6_marker)
42-
] @heading)
43-
44-
(fenced_code_block) @code
45-
46-
(list_item) @item
47-
48-
(pipe_table_header) @table_head
49-
(pipe_table_delimiter_row) @table_delim
50-
(pipe_table_row) @table_row
51-
]]
52-
),
53-
render_modes = { 'n', 'c' },
54-
bullet = '',
55-
highlights = {
56-
headings = { 'DiffAdd', 'DiffChange', 'DiffDelete' },
57-
code = 'ColorColumn',
58-
bullet = 'Normal',
59-
table = {
60-
head = '@markup.heading',
61-
row = 'Normal',
62-
},
63-
},
64-
})
31+
require('markdown').setup({})
6532
end,
6633
}
6734
```
6835

36+
## Default Config
37+
38+
Below is the configuration that gets used by default, any part of it can be modified
39+
by the user.
40+
41+
```lua
42+
require('markdown').setup({
43+
-- Capture groups that get pulled from the markdown file, these are later
44+
-- used to modify how the file gets rendered
45+
query = vim.treesitter.query.parse(
46+
'markdown',
47+
[[
48+
(atx_heading [
49+
(atx_h1_marker)
50+
(atx_h2_marker)
51+
(atx_h3_marker)
52+
(atx_h4_marker)
53+
(atx_h5_marker)
54+
(atx_h6_marker)
55+
] @heading)
56+
57+
(fenced_code_block) @code
58+
59+
(list_item) @item
60+
61+
(pipe_table_header) @table_head
62+
(pipe_table_delimiter_row) @table_delim
63+
(pipe_table_row) @table_row
64+
]]
65+
),
66+
-- vim modes that will show a rendered view of the markdown file, all other
67+
-- modes will be uneffected by this plugin
68+
render_modes = { 'n', 'c' },
69+
-- Character to use for the bullet point in lists
70+
bullet = '',
71+
highlights = {
72+
-- Groups that get cycled through for rendering headings
73+
headings = { 'DiffAdd', 'DiffChange', 'DiffDelete' },
74+
-- Used when displaying code blocks
75+
code = 'ColorColumn',
76+
-- Used when displaying bullet points in list
77+
bullet = 'Normal',
78+
table = {
79+
-- Used when displaying header in a markdown table
80+
head = '@markup.heading',
81+
-- Used when displaying non header rows in a markdown table
82+
row = 'Normal',
83+
},
84+
},
85+
})
86+
```
87+
6988
# Related Projects
7089

7190
- [headlines.nvim](https://github.com/lukas-reineke/headlines.nvim) - Same high level

0 commit comments

Comments
 (0)