Skip to content

Commit 71782d7

Browse files
Fix health check, unit tests, add highlight to README
1 parent 8e263a6 commit 71782d7

File tree

5 files changed

+116
-107
lines changed

5 files changed

+116
-107
lines changed

README.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ require('render-markdown').setup({
240240
below = '',
241241
-- Highlight for code blocks & inline code
242242
highlight = 'RenderMarkdownCode',
243+
highlight_inline = 'RenderMarkdownCodeInline',
243244
},
244245
dash = {
245246
-- Turn on / off thematic break rendering
@@ -469,6 +470,7 @@ require('render-markdown').setup({
469470
below = '',
470471
-- Highlight for code blocks & inline code
471472
highlight = 'RenderMarkdownCode',
473+
highlight_inline = 'RenderMarkdownCodeInline',
472474
},
473475
})
474476
```
@@ -661,38 +663,39 @@ require('render-markdown').setup({
661663

662664
The table below shows all the highlight groups with their default link
663665

664-
| Highlight Group | Default Group | Description |
665-
| ----------------------- | ---------------------------------- | ------------------------- |
666-
| RenderMarkdownH1 | @markup.heading.1.markdown | H1 icons |
667-
| RenderMarkdownH2 | @markup.heading.2.markdown | H2 icons |
668-
| RenderMarkdownH3 | @markup.heading.3.markdown | H3 icons |
669-
| RenderMarkdownH4 | @markup.heading.4.markdown | H4 icons |
670-
| RenderMarkdownH5 | @markup.heading.5.markdown | H5 icons |
671-
| RenderMarkdownH6 | @markup.heading.6.markdown | H6 icons |
672-
| RenderMarkdownH1Bg | DiffAdd | H1 background line |
673-
| RenderMarkdownH2Bg | DiffChange | H2 background line |
674-
| RenderMarkdownH3Bg | DiffDelete | H3 background line |
675-
| RenderMarkdownH4Bg | DiffDelete | H4 background line |
676-
| RenderMarkdownH5Bg | DiffDelete | H5 background line |
677-
| RenderMarkdownH6Bg | DiffDelete | H6 background line |
678-
| RenderMarkdownCode | ColorColumn | Code block background |
679-
| RenderMarkdownBullet | Normal | List item bullet points |
680-
| RenderMarkdownQuote | @markup.quote | Block quote marker |
681-
| RenderMarkdownDash | LineNr | Thematic break line |
682-
| RenderMarkdownLink | @markup.link.label.markdown_inline | Image & hyperlink icons |
683-
| RenderMarkdownSign | SignColumn | Sign column background |
684-
| RenderMarkdownMath | @markup.math | LaTeX lines |
685-
| RenderMarkdownUnchecked | @markup.list.unchecked | Unchecked checkbox |
686-
| RenderMarkdownChecked | @markup.list.checked | Checked checkbox |
687-
| RenderMarkdownTodo | @markup.raw | Todo custom checkbox |
688-
| RenderMarkdownTableHead | @markup.heading | Pipe table heading rows |
689-
| RenderMarkdownTableRow | Normal | Pipe table body rows |
690-
| RenderMarkdownTableFill | Conceal | Pipe table inline padding |
691-
| RenderMarkdownSuccess | DiagnosticOk | Success related callouts |
692-
| RenderMarkdownInfo | DiagnosticInfo | Info related callouts |
693-
| RenderMarkdownHint | DiagnosticHint | Hint related callouts |
694-
| RenderMarkdownWarn | DiagnosticWarn | Warning related callouts |
695-
| RenderMarkdownError | DiagnosticError | Error related callouts |
666+
| Highlight Group | Default Group | Description |
667+
| ------------------------ | ---------------------------------- | ------------------------- |
668+
| RenderMarkdownH1 | @markup.heading.1.markdown | H1 icons |
669+
| RenderMarkdownH2 | @markup.heading.2.markdown | H2 icons |
670+
| RenderMarkdownH3 | @markup.heading.3.markdown | H3 icons |
671+
| RenderMarkdownH4 | @markup.heading.4.markdown | H4 icons |
672+
| RenderMarkdownH5 | @markup.heading.5.markdown | H5 icons |
673+
| RenderMarkdownH6 | @markup.heading.6.markdown | H6 icons |
674+
| RenderMarkdownH1Bg | DiffAdd | H1 background line |
675+
| RenderMarkdownH2Bg | DiffChange | H2 background line |
676+
| RenderMarkdownH3Bg | DiffDelete | H3 background line |
677+
| RenderMarkdownH4Bg | DiffDelete | H4 background line |
678+
| RenderMarkdownH5Bg | DiffDelete | H5 background line |
679+
| RenderMarkdownH6Bg | DiffDelete | H6 background line |
680+
| RenderMarkdownCode | ColorColumn | Code block background |
681+
| RenderMarkdownCodeInline | RenderMarkdownCode | Inline code background |
682+
| RenderMarkdownBullet | Normal | List item bullet points |
683+
| RenderMarkdownQuote | @markup.quote | Block quote marker |
684+
| RenderMarkdownDash | LineNr | Thematic break line |
685+
| RenderMarkdownLink | @markup.link.label.markdown_inline | Image & hyperlink icons |
686+
| RenderMarkdownSign | SignColumn | Sign column background |
687+
| RenderMarkdownMath | @markup.math | LaTeX lines |
688+
| RenderMarkdownUnchecked | @markup.list.unchecked | Unchecked checkbox |
689+
| RenderMarkdownChecked | @markup.list.checked | Checked checkbox |
690+
| RenderMarkdownTodo | @markup.raw | Todo custom checkbox |
691+
| RenderMarkdownTableHead | @markup.heading | Pipe table heading rows |
692+
| RenderMarkdownTableRow | Normal | Pipe table body rows |
693+
| RenderMarkdownTableFill | Conceal | Pipe table inline padding |
694+
| RenderMarkdownSuccess | DiagnosticOk | Success related callouts |
695+
| RenderMarkdownInfo | DiagnosticInfo | Info related callouts |
696+
| RenderMarkdownHint | DiagnosticHint | Hint related callouts |
697+
| RenderMarkdownWarn | DiagnosticWarn | Warning related callouts |
698+
| RenderMarkdownError | DiagnosticError | Error related callouts |
696699

697700
# Info
698701

doc/render-markdown.txt

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2024 July 22
1+
*render-markdown.txt* For 0.10.0 Last change: 2024 July 23
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -280,6 +280,7 @@ Full Default Configuration ~
280280
below = '▀',
281281
-- Highlight for code blocks & inline code
282282
highlight = 'RenderMarkdownCode',
283+
highlight_inline = 'RenderMarkdownCodeInline',
283284
},
284285
dash = {
285286
-- Turn on / off thematic break rendering
@@ -509,6 +510,7 @@ CODE BLOCKS *render-markdown-setup-code-blocks*
509510
below = '▀',
510511
-- Highlight for code blocks & inline code
511512
highlight = 'RenderMarkdownCode',
513+
highlight_inline = 'RenderMarkdownCodeInline',
512514
},
513515
})
514516
<
@@ -711,77 +713,80 @@ SIGNS *render-markdown-setup-signs*
711713

712714
The table below shows all the highlight groups with their default link
713715

714-
------------------------------------------------------------------------------------
715-
Highlight Group Default Group Description
716-
------------------------- ------------------------------------ ---------------------
717-
RenderMarkdownH1 @markup.heading.1.markdown H1 icons
716+
-------------------------------------------------------------------------------------
717+
Highlight Group Default Group Description
718+
-------------------------- ------------------------------------ ---------------------
719+
RenderMarkdownH1 @markup.heading.1.markdown H1 icons
718720

719-
RenderMarkdownH2 @markup.heading.2.markdown H2 icons
721+
RenderMarkdownH2 @markup.heading.2.markdown H2 icons
720722

721-
RenderMarkdownH3 @markup.heading.3.markdown H3 icons
723+
RenderMarkdownH3 @markup.heading.3.markdown H3 icons
722724

723-
RenderMarkdownH4 @markup.heading.4.markdown H4 icons
725+
RenderMarkdownH4 @markup.heading.4.markdown H4 icons
724726

725-
RenderMarkdownH5 @markup.heading.5.markdown H5 icons
727+
RenderMarkdownH5 @markup.heading.5.markdown H5 icons
726728

727-
RenderMarkdownH6 @markup.heading.6.markdown H6 icons
729+
RenderMarkdownH6 @markup.heading.6.markdown H6 icons
728730

729-
RenderMarkdownH1Bg DiffAdd H1 background line
731+
RenderMarkdownH1Bg DiffAdd H1 background line
730732

731-
RenderMarkdownH2Bg DiffChange H2 background line
733+
RenderMarkdownH2Bg DiffChange H2 background line
732734

733-
RenderMarkdownH3Bg DiffDelete H3 background line
735+
RenderMarkdownH3Bg DiffDelete H3 background line
734736

735-
RenderMarkdownH4Bg DiffDelete H4 background line
737+
RenderMarkdownH4Bg DiffDelete H4 background line
736738

737-
RenderMarkdownH5Bg DiffDelete H5 background line
739+
RenderMarkdownH5Bg DiffDelete H5 background line
738740

739-
RenderMarkdownH6Bg DiffDelete H6 background line
741+
RenderMarkdownH6Bg DiffDelete H6 background line
740742

741-
RenderMarkdownCode ColorColumn Code block background
743+
RenderMarkdownCode ColorColumn Code block background
742744

743-
RenderMarkdownBullet Normal List item bullet
744-
points
745+
RenderMarkdownCodeInline RenderMarkdownCode Inline code
746+
background
745747

746-
RenderMarkdownQuote @markup.quote Block quote marker
748+
RenderMarkdownBullet Normal List item bullet
749+
points
747750

748-
RenderMarkdownDash LineNr Thematic break line
751+
RenderMarkdownQuote @markup.quote Block quote marker
749752

750-
RenderMarkdownLink @markup.link.label.markdown_inline Image & hyperlink
751-
icons
753+
RenderMarkdownDash LineNr Thematic break line
752754

753-
RenderMarkdownSign SignColumn Sign column
754-
background
755+
RenderMarkdownLink @markup.link.label.markdown_inline Image & hyperlink
756+
icons
755757

756-
RenderMarkdownMath @markup.math LaTeX lines
758+
RenderMarkdownSign SignColumn Sign column
759+
background
757760

758-
RenderMarkdownUnchecked @markup.list.unchecked Unchecked checkbox
761+
RenderMarkdownMath @markup.math LaTeX lines
759762

760-
RenderMarkdownChecked @markup.list.checked Checked checkbox
763+
RenderMarkdownUnchecked @markup.list.unchecked Unchecked checkbox
761764

762-
RenderMarkdownTodo @markup.raw Todo custom checkbox
765+
RenderMarkdownChecked @markup.list.checked Checked checkbox
763766

764-
RenderMarkdownTableHead @markup.heading Pipe table heading
765-
rows
767+
RenderMarkdownTodo @markup.raw Todo custom checkbox
766768

767-
RenderMarkdownTableRow Normal Pipe table body rows
769+
RenderMarkdownTableHead @markup.heading Pipe table heading
770+
rows
768771

769-
RenderMarkdownTableFill Conceal Pipe table inline
770-
padding
772+
RenderMarkdownTableRow Normal Pipe table body rows
771773

772-
RenderMarkdownSuccess DiagnosticOk Success related
773-
callouts
774+
RenderMarkdownTableFill Conceal Pipe table inline
775+
padding
774776

775-
RenderMarkdownInfo DiagnosticInfo Info related callouts
777+
RenderMarkdownSuccess DiagnosticOk Success related
778+
callouts
776779

777-
RenderMarkdownHint DiagnosticHint Hint related callouts
780+
RenderMarkdownInfo DiagnosticInfo Info related callouts
778781

779-
RenderMarkdownWarn DiagnosticWarn Warning related
780-
callouts
782+
RenderMarkdownHint DiagnosticHint Hint related callouts
781783

782-
RenderMarkdownError DiagnosticError Error related
783-
callouts
784-
------------------------------------------------------------------------------------
784+
RenderMarkdownWarn DiagnosticWarn Warning related
785+
callouts
786+
787+
RenderMarkdownError DiagnosticError Error related
788+
callouts
789+
-------------------------------------------------------------------------------------
785790

786791
==============================================================================
787792
8. Info *render-markdown-info*

lua/render-markdown/colors.lua

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,41 @@ M.prefix = 'RenderMarkdown'
1818
---@type table<string, string>
1919
M.colors = {
2020
-- Headings
21-
H1 = '@markup.heading.1.markdown',
22-
H2 = '@markup.heading.2.markdown',
23-
H3 = '@markup.heading.3.markdown',
24-
H4 = '@markup.heading.4.markdown',
25-
H5 = '@markup.heading.5.markdown',
26-
H6 = '@markup.heading.6.markdown',
27-
H1Bg = 'DiffAdd',
28-
H2Bg = 'DiffChange',
29-
H3Bg = 'DiffDelete',
30-
H4Bg = 'DiffDelete',
31-
H5Bg = 'DiffDelete',
32-
H6Bg = 'DiffDelete',
21+
H1 = '@markup.heading.1.markdown',
22+
H2 = '@markup.heading.2.markdown',
23+
H3 = '@markup.heading.3.markdown',
24+
H4 = '@markup.heading.4.markdown',
25+
H5 = '@markup.heading.5.markdown',
26+
H6 = '@markup.heading.6.markdown',
27+
H1Bg = 'DiffAdd',
28+
H2Bg = 'DiffChange',
29+
H3Bg = 'DiffDelete',
30+
H4Bg = 'DiffDelete',
31+
H5Bg = 'DiffDelete',
32+
H6Bg = 'DiffDelete',
3333
-- General
34-
Code = 'ColorColumn',
35-
CodeInline= 'RenderMarkdownCode',
36-
Bullet = 'Normal',
37-
Quote = '@markup.quote',
38-
Dash = 'LineNr',
39-
Link = '@markup.link.label.markdown_inline',
40-
Sign = 'SignColumn',
41-
Math = '@markup.math',
34+
Code = 'ColorColumn',
35+
CodeInline = 'RenderMarkdownCode',
36+
Bullet = 'Normal',
37+
Quote = '@markup.quote',
38+
Dash = 'LineNr',
39+
Link = '@markup.link.label.markdown_inline',
40+
Sign = 'SignColumn',
41+
Math = '@markup.math',
4242
-- Checkboxes
43-
Unchecked = '@markup.list.unchecked',
44-
Checked = '@markup.list.checked',
45-
Todo = '@markup.raw',
43+
Unchecked = '@markup.list.unchecked',
44+
Checked = '@markup.list.checked',
45+
Todo = '@markup.raw',
4646
-- Pipe tables
47-
TableHead = '@markup.heading',
48-
TableRow = 'Normal',
49-
TableFill = 'Conceal',
47+
TableHead = '@markup.heading',
48+
TableRow = 'Normal',
49+
TableFill = 'Conceal',
5050
-- Callouts
51-
Success = 'DiagnosticOk',
52-
Info = 'DiagnosticInfo',
53-
Hint = 'DiagnosticHint',
54-
Warn = 'DiagnosticWarn',
55-
Error = 'DiagnosticError',
51+
Success = 'DiagnosticOk',
52+
Info = 'DiagnosticInfo',
53+
Hint = 'DiagnosticHint',
54+
Warn = 'DiagnosticWarn',
55+
Error = 'DiagnosticError',
5656
}
5757

5858
function M.setup()

lua/render-markdown/state.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ function state.validate()
124124
above = { code.above, 'string' },
125125
below = { code.below, 'string' },
126126
highlight = { code.highlight, 'string' },
127+
highlight_inline = { code.highlight_inline, 'string' },
127128
})
128129

129130
local dash = config.dash

tests/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ M.inline_code = function(row, start_col, end_col)
126126
row = { row, row },
127127
col = { start_col, end_col },
128128
hl_eol = false,
129-
hl_group = M.prefix .. 'Code',
129+
hl_group = M.prefix .. 'CodeInline',
130130
}
131131
end
132132

0 commit comments

Comments
 (0)