Skip to content

Commit a48378d

Browse files
chore(docs): more details about rename for tokyonight & rocks.nvim
1 parent 96988cc commit a48378d

File tree

6 files changed

+77
-49
lines changed

6 files changed

+77
-49
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,27 @@ Plugin to improve viewing Markdown files in Neovim
44

55
> [!NOTE]
66
>
7-
> Repo has been renamed from `markdown.nvim` to make things less confusing and
8-
> more consistent. Github should redirect all requests so nothing should break.
7+
> Repo has been renamed from `markdown.nvim` to make things more consistent.
8+
>
9+
> Github will redirect all requests so nothing should break for most users.
10+
>
11+
> For `lazy.nvim` & `tokyonight.nvim` users changing the plugin name will remove
12+
> custom highlights until the following is merged [#620](https://github.com/folke/tokyonight.nvim/pull/620).
13+
>
14+
> In the meantime you can fix this by adding the following to your config:
15+
>
16+
> ```lua
17+
> require('tokyonight').setup({
18+
> plugins = { markdown = true },
19+
> })
20+
> ```
21+
>
22+
> For `rocks.nvim` users migrate to the new [LuaRock](https://luarocks.org/modules/MeanderingProgrammer/render-markdown.nvim).
23+
>
24+
> ```vim
25+
> :Rocks prune markdown.nvim
26+
> :Rocks install render-markdown.nvim
27+
> ```
928
1029
<!-- panvimdoc-ignore-start -->
1130

doc/render-markdown.txt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2024 August 05
1+
*render-markdown.txt* For 0.10.0 Last change: 2024 August 06
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -36,8 +36,23 @@ Plugin to improve viewing Markdown files in Neovim
3636

3737

3838
[!NOTE]
39-
Repo has been renamed from `markdown.nvim` to make things less confusing and
40-
more consistent. Github should redirect all requests so nothing should break.
39+
Repo has been renamed from `markdown.nvim` to make things more consistent.
40+
Github will redirect all requests so nothing should break for most users.
41+
For `lazy.nvim` & `tokyonight.nvim` users changing the plugin name will remove
42+
custom highlights until the following is merged #620
43+
<https://github.com/folke/tokyonight.nvim/pull/620>.
44+
In the meantime you can fix this by adding the following to your config:
45+
>lua
46+
require('tokyonight').setup({
47+
plugins = { markdown = true },
48+
})
49+
<
50+
For `rocks.nvim` users migrate to the new LuaRock
51+
<https://luarocks.org/modules/MeanderingProgrammer/render-markdown.nvim>.
52+
>vim
53+
:Rocks prune markdown.nvim
54+
:Rocks install render-markdown.nvim
55+
<
4156

4257
==============================================================================
4358
2. Features *render-markdown-features*

lua/render-markdown/handler/latex.lua

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
local list = require('render-markdown.list')
12
local logger = require('render-markdown.logger')
23
local state = require('render-markdown.state')
34
local str = require('render-markdown.str')
@@ -42,20 +43,14 @@ function M.parse(root, buf)
4243
return { { expression, latex.highlight } }
4344
end, expressions)
4445

45-
---@type render.md.Mark
46-
local latex_mark = {
47-
conceal = false,
48-
start_row = info.start_row,
49-
start_col = info.start_col,
50-
opts = {
51-
end_row = info.end_row,
52-
end_col = info.end_col,
53-
virt_lines = latex_lines,
54-
virt_lines_above = true,
55-
},
56-
}
57-
logger.debug('mark', latex_mark)
58-
return { latex_mark }
46+
local marks = {}
47+
list.add_mark(marks, false, info.start_row, info.start_col, {
48+
end_row = info.end_row,
49+
end_col = info.end_col,
50+
virt_lines = latex_lines,
51+
virt_lines_above = true,
52+
})
53+
return marks
5954
end
6055

6156
return M

lua/render-markdown/handler/markdown.lua

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ local pipe_table_parser = require('render-markdown.parser.pipe_table')
99
local state = require('render-markdown.state')
1010
local str = require('render-markdown.str')
1111
local ts = require('render-markdown.ts')
12-
local util = require('render-markdown.util')
1312

1413
---@class render.md.handler.buf.Markdown
1514
---@field private buf integer
@@ -72,20 +71,7 @@ end
7271
---@param opts vim.api.keyset.set_extmark
7372
---@return boolean
7473
function Handler:add(conceal, start_row, start_col, opts)
75-
-- Inline extmarks require neovim >= 0.10.0
76-
if opts.virt_text_pos == 'inline' and not util.has_10 then
77-
return false
78-
end
79-
---@type render.md.Mark
80-
local mark = {
81-
conceal = conceal,
82-
start_row = start_row,
83-
start_col = start_col,
84-
opts = opts,
85-
}
86-
logger.debug('mark', mark)
87-
table.insert(self.marks, mark)
88-
return true
74+
return list.add_mark(self.marks, conceal, start_row, start_col, opts)
8975
end
9076

9177
---@private

lua/render-markdown/handler/markdown_inline.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
local component = require('render-markdown.component')
22
local context = require('render-markdown.context')
3+
local list = require('render-markdown.list')
34
local logger = require('render-markdown.logger')
45
local state = require('render-markdown.state')
56
local str = require('render-markdown.str')
67
local ts = require('render-markdown.ts')
7-
local util = require('render-markdown.util')
88

99
---@class render.md.handler.buf.MarkdownInline
1010
---@field private buf integer
@@ -48,20 +48,7 @@ end
4848
---@param opts vim.api.keyset.set_extmark
4949
---@return boolean
5050
function Handler:add(start_row, start_col, opts)
51-
-- Inline extmarks require neovim >= 0.10.0
52-
if opts.virt_text_pos == 'inline' and not util.has_10 then
53-
return false
54-
end
55-
---@type render.md.Mark
56-
local mark = {
57-
conceal = true,
58-
start_row = start_row,
59-
start_col = start_col,
60-
opts = opts,
61-
}
62-
logger.debug('mark', mark)
63-
table.insert(self.marks, mark)
64-
return true
51+
return list.add_mark(self.marks, true, start_row, start_col, opts)
6552
end
6653

6754
---@private

lua/render-markdown/list.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
1+
local logger = require('render-markdown.logger')
2+
local util = require('render-markdown.util')
3+
14
---@class render.md.ListHelper
25
local M = {}
36

7+
---@param marks render.md.Mark[]
8+
---@param conceal boolean
9+
---@param start_row integer
10+
---@param start_col integer
11+
---@param opts vim.api.keyset.set_extmark
12+
---@return boolean
13+
function M.add_mark(marks, conceal, start_row, start_col, opts)
14+
-- Inline extmarks require neovim >= 0.10.0
15+
if opts.virt_text_pos == 'inline' and not util.has_10 then
16+
return false
17+
end
18+
---@type render.md.Mark
19+
local mark = {
20+
conceal = conceal,
21+
start_row = start_row,
22+
start_col = start_col,
23+
opts = opts,
24+
}
25+
logger.debug('mark', mark)
26+
table.insert(marks, mark)
27+
return true
28+
end
29+
430
---@param values string[]
531
---@param index integer
632
---@return string?

0 commit comments

Comments
 (0)