@@ -269,135 +269,119 @@ require('render-markdown').setup({
269269
270270</details >
271271
272- There are 4 main types of settings:
273-
274- 1 . Icon: the text that gets rendered
275- 2 . Highlight: the color for text & backgrounds
276- 3 . Style: how different components are rendered
277- 4 . Window Options: handles conceal behavior
278-
279- There are 2 main ways array like values are accessed:
272+ We use the following definitions when discussing indexing into arrays:
280273
2812741 . Cycle: Indexed ` mod ` the length.
282275 Example: ` { 1, 2, 3 } ` @ 4 = 1.
2832762 . Clamp: Indexed normally but larger values use the last value in the array.
284277 Example: ` { 1, 2, 3 } ` @ 4 = 3.
285278
286- ## Icon
279+ ## Headings
287280
288- ### headings
289-
290- Replace the ` # ` characters in front of headings.
281+ Icon: ` headings `
282+ Highlight: ` highlights.heading.backgrounds ` & ` highlights.heading.backgrounds `
283+ Style: N/A
291284
285+ The icons replace the ` # ` characters in front of headings.
292286The number of ` # ` characters in the heading determines the level of the heading.
287+ The level is used to index into the icon table using a cycle.
288+ The icon is left padded with spaces to fill the gap and hide any additional ` # ` .
289+ The level is also used to index into both highlights tables using a clamp.
290+ Both are applied to the icon and the background extends through the entire line.
293291
294- The level is used to index into the table using a cycle.
295-
296- The icon is pre-pendeded with spaces to fill the gap and hide any additional ` # ` .
292+ ## Dashed Line
297293
298- ### dash
294+ Icon: ` dash `
295+ Highlight: ` highlights.dash `
296+ Style: N/A
299297
300298Gets repeated across the window's width when a ` thematic_break ` is found.
301299
302- ### bullets
303-
304- Replace the ` - ` , ` + ` , and ` * ` characters in front of list items.
305-
306- A different bullet is used depending on the level of nesting for the list item.
307-
308- The nesting level is used to index into the table using a cycle.
300+ ## List Bullets
309301
310- If the character is before a checkbox, rather than changing the icon a conceal
311- is used to hide the character.
302+ Icon: ` bullets `
303+ Highlight: ` highlights.bullet `
304+ Style: N/A
312305
313- ### checkbox
306+ The icons replace the ` - ` , ` + ` , and ` * ` characters in front of list items.
307+ How deeply nested the list is determines the level of the list.
308+ The level is used to index into the icon table using a cycle.
309+ If the item is a ` checkbox ` a conceal is instead used to hide the bullet.
314310
315- The checked ` [ ] ` & unchecked ` [x] ` are directly replaced with these values.
311+ ## Checkboxes
316312
317- Additionally ` custom ` states can be specified, an example of this is provided with:
318- ` todo = { raw = '[-]', rendered = ' ', highlight = '@markup.raw' } ` .
313+ Icon: ` checkbox.unchecked ` , ` checkbox.checkbox ` , & ` checkbox.custom.rendered `
314+ Highlight: ` highlights.checkbox.unchecked ` , ` highlights.checkbox.checked ` , & ` checkbox.custom.highlight `
315+ Style: N/A
319316
320- This requires neovim >= ` 0.10.0 ` since it relies on ` inline ` extmarks.
317+ In the case of a standard checked ` [x] ` or unchecked ` [ ] ` checkbox state we simply
318+ overlay the appropriate icon and apply the appropriate highlight.
321319
322- The key in the ` custom ` table is unused. The parts of the value are:
323-
324- - ` raw ` : matched against the raw text of a ` shortcut_link ` , in the same way as ` callouts `
320+ Custom checkbox states setup through ` checkbox.custom ` are more involved as they
321+ are not part of the actual ` markdown ` grammar.
322+ As a result this requires neovim >= ` 0.10.0 ` since it relies on ` inline ` extmarks.
323+ An example comes with the default config:
324+ ` todo = { raw = '[-]', rendered = ' ', highlight = '@markup.raw' } `
325+ The key part in this case ` todo ` is unused. The parts of the value are:
326+ - ` raw ` : matched against the raw text of a ` shortcut_link `
325327- ` rendered ` : replaces the ` raw ` value when rendering
326328- ` highlight ` : color used for ` rendered ` text
327329
328- ### quote
329-
330- Replaces the ` | ` character in front of ` block_quotes ` .
330+ ## Standard Quotes
331331
332- ### callout
332+ Icon: ` quote `
333+ Highlight: ` highlights.quote `
334+ Style: N/A
333335
334- This is a special instance of a ` block_quote ` .
336+ The icon replaces the ` | ` character in front of ` block_quotes ` .
335337
336- When the ` callout ` syntax is used the start, i.e. ` [!NOTE] ` , is replaced
337- with this text.
338+ ## Callouts
338339
339- Additionally ` custom ` callouts can be specified, an example of this is provided with:
340- ` bug = { raw = '[!BUG]', rendered = ' Bug', highlight = 'DiagnosticError' } ` .
340+ Icon: ` callout ` & ` callout.custom.rendered `
341+ Highlight: ` highlights.callout ` & ` callout.custom.highlight `
342+ Style: N/A
341343
342- The key in the ` custom ` table is unused. The parts of the value are:
344+ Callouts are a special instance of a ` block_quote ` that start with a ` shortcut_link ` .
345+ When this pattern is seen the link text gets replaced by the icon.
346+ The highlight is then applied to the icon as well as the quote markers.
343347
348+ Custom callouts setup through ` callout.custom ` behave in much the same way.
349+ An example comes with the default config:
350+ ` bug = { raw = '[!BUG]', rendered = ' Bug', highlight = 'DiagnosticError' } `
351+ The key part in this case ` bug ` is unused. The parts of the value are:
344352- ` raw ` : matched against the raw text of a ` shortcut_link `
345353- ` rendered ` : replaces the ` raw ` value when rendering
346354- ` highlight ` : color used for ` rendered ` text
347355
348- ## Highlight
349-
350- Options are all contained in the ` highlights ` table.
351-
352- For the most part the highlight group is used directly when writing the
353- associated icons. We'll cover some of the specific behaviors.
354-
355- ### heading
356+ ## Code Blocks
356357
357- Both ` backgrounds ` and ` foregrounds ` are indexed by the level of the heading
358- using a clamp.
359-
360- Both values are applied to the icon, however the background extends through
361- the entire line.
362-
363- ### table
364-
365- The ` head ` is used for the table heading, delimitter, and the line above.
366-
367- The ` row ` is used for everything else, so the main table rows and the line below.
368-
369- ## Style
370-
371- ### code_style
372-
373- Determines how ` fenced_code_block ` s are rendered.
358+ Icon: N/A
359+ Highlight: ` highlights.code `
360+ Style: ` code_style `
374361
362+ ` code_style ` determines how code blocks are rendered:
375363- ` none ` : disables all rendering
376- - ` normal ` : adds background highlight group to the code block
364+ - ` normal ` : adds highlight group to the code block
377365- ` full ` : ` normal ` + language icon & name above the code block
378366
379- ### table_style
367+ ## Tables
380368
381- Determines how ` table ` s are rendered.
369+ Icon: N/A
370+ Highlight: ` highlights.table.head ` & ` highlights.table.row `
371+ Style: ` table_style ` & ` cell_style `
382372
373+ The ` head ` highlight is used for the table heading, delimitter, and the line above.
374+ The ` row ` highlight is used for everything else, main table rows and the line below.
375+
376+ ` table_style ` determines how the table as a whole is rendered:
383377- ` none ` : disables all rendering
384378- ` normal ` : applies the ` cell_style ` rendering to each row of the table
385379- ` full ` : ` normal ` + a top & bottom line that fill out the table when lengths match
386380
387- ### cell_style
388-
389- Determines how ` table cell ` s are rendered.
390-
381+ ` cell_style ` determines how individual cells of a table are rendered:
391382- ` overlay ` : writes completely over the table, removing conceal behavior and highlights
392383- ` raw ` : replaces only the ` | ` icons in each row, leaving the cell completely unmodified
393384
394- ## Window Options
395-
396- Options are all contained in the ` win_options ` table.
397-
398- This changes the ` conceallevel ` & ` concealcursor ` when rendering. When not rendering
399- the value is changed back to the users configured value.
400-
401385# Additional Info
402386
403387- [ Limitations] ( doc/limitations.md ) : Known limitations of this plugin
0 commit comments