1- *render-markdown.txt* For 0.10.0 Last change: 2024 July 05
1+ *render-markdown.txt* For 0.10.0 Last change: 2024 July 06
22
33==============================================================================
44Table of Contents *render-markdown-table-of-contents*
@@ -11,6 +11,10 @@ Table of Contents *render-markdown-table-of-contents*
1111 - packer.nvim | render-markdown-install-packer.nvim |
12125. Commands | render-markdown-commands |
13136. Setup | render-markdown-setup |
14+ - Icon | render-markdown-setup-icon |
15+ - Highlight | render-markdown-setup-highlight |
16+ - Style | render-markdown-setup-style |
17+ - Window Options | render-markdown-setup-window-options |
14187. Additional Info | render-markdown-additional-info |
1519
1620==============================================================================
@@ -38,7 +42,8 @@ Plugin to improve viewing Markdown files in Neovim
3842 - Headings: highlight depending on level and replaces `#` with icon
3943 - Horizontal breaks: replace with full-width lines
4044 - Code blocks: highlight to better stand out
41- - Adds language icon, requires `nvim- web- devicons` and neovim >= `0.10 .0 `
45+ - Adds language icon, requires icon provider (`mini.icons` or `nvim- web- devicons` )
46+ and neovim >= `0.10 .0 `
4247 - Inline code: highlight to better stand out
4348 - List bullet points: replace with provided icon based on level
4449 - Checkboxes: replace with provided icon based on whether they are checked
@@ -114,8 +119,14 @@ PACKER.NVIM *render-markdown-install-packer.nvim*
114119==============================================================================
1151206. Setup *render-markdown-setup*
116121
117- Below is the configuration that gets used by default, any part of it can be
118- modified by the user.
122+ The full default configuration is provided below for reference.
123+
124+ Any part of it can be modified however for many fields this does not make much
125+ sense.
126+
127+ Some of the more useful fields are discussed further down.
128+
129+ Full Default Configuration ~
119130
120131>lua
121132 require('render-markdown').setup({
@@ -243,14 +254,7 @@ modified by the user.
243254 -- Background of heading line
244255 backgrounds = { 'DiffAdd', 'DiffChange', 'DiffDelete' },
245256 -- Foreground of heading character only
246- foregrounds = {
247- 'markdownH1',
248- 'markdownH2',
249- 'markdownH3',
250- 'markdownH4',
251- 'markdownH5',
252- 'markdownH6',
253- },
257+ foregrounds = { 'markdownH1', 'markdownH2', 'markdownH3', 'markdownH4', 'markdownH5', 'markdownH6' },
254258 },
255259 -- Horizontal break
256260 dash = 'LineNr',
@@ -286,6 +290,133 @@ modified by the user.
286290 })
287291<
288292
293+ There are 4 main types of settings:
294+
295+ 1. Icon: the text that gets rendered
296+ 2. Highlight: the color for text & backgrounds
297+ 3. Style: how different components are rendered
298+ 4. Window Options: handles conceal behavior
299+
300+ There are 2 main ways array like values are accessed:
301+
302+ 1. Cycle: Indexed `mod ` the length.
303+ Example: `{ 1, 2, 3 }` @ 4 = 1.
304+ 2. Clamp: Indexed normally but larger values use the last value in the array.
305+ Example: `{ 1, 2, 3 }` @ 4 = 3.
306+
307+
308+ ICON *render-markdown-setup-icon*
309+
310+
311+ HEADINGS ~
312+
313+ Replace the `#` characters in front of headings.
314+
315+ The number of `#` characters in the heading determines the level of the
316+ heading.
317+
318+ The level is used to index into the table using a cycle.
319+
320+ The icon is pre-pendeded with spaces to fill the gap and hide any additional
321+ `#` .
322+
323+
324+ DASH ~
325+
326+ Gets repeated across the window’s width when a `thematic_break` is found.
327+
328+
329+ BULLETS ~
330+
331+ Replace the `- ` , `+ ` , and `* ` characters in front of list items.
332+
333+ A different bullet is used depending on the level of nesting for the list item.
334+
335+ The nesting level is used to index into the table using a cycle.
336+
337+ If the character is before a checkbox, rather than changing the icon a conceal
338+ is used to hide the character.
339+
340+
341+ CHECKBOX ~
342+
343+ The checked `[ ]` & unchecked `[x ]` are directly replaced with these values.
344+
345+
346+ QUOTE ~
347+
348+ Replaces the `|` character in front of `block_quotes` .
349+
350+
351+ CALLOUT ~
352+
353+ This is a special instance of a `block_quote` .
354+
355+ When the `callout` syntax is used the start, i.e.� `[! NOTE]` , is replaced with
356+ this text.
357+
358+
359+ HIGHLIGHT *render-markdown-setup-highlight*
360+
361+ Options are all contained in the `highlights` table.
362+
363+ For the most part the highlight group is used directly when writing the
364+ associated icons. We’ll cover some of the specific behaviors.
365+
366+
367+ HEADING ~
368+
369+ Both `backgrounds` and `foregrounds` are indexed by the level of the heading
370+ using a clamp.
371+
372+ Both values are applied to the icon, however the background extends through the
373+ entire line.
374+
375+
376+ TABLE ~
377+
378+ The `head` is used for the table heading, delimitter, and the line above.
379+
380+ The `row` is used for everything else, so the main table rows and the line
381+ below.
382+
383+
384+ STYLE *render-markdown-setup-style*
385+
386+
387+ CODE_STYLE ~
388+
389+ Determines how `fenced_code_block` s are rendered.
390+
391+ - `none ` : disables all rendering
392+ - `normal ` : adds background highlight group to the code block
393+ - `full` : `normal ` + language icon & name above the code block
394+
395+
396+ TABLE_STYLE ~
397+
398+ Determines how `table` s are rendered.
399+
400+ - `none ` : disables all rendering
401+ - `normal ` : applies the `cell_style` rendering to each row of the table
402+ - `full` : `normal ` + a top & bottom line that fill out the table when lengths match
403+
404+
405+ CELL_STYLE ~
406+
407+ Determines how `table cell`s are rendered.
408+
409+ - `overlay` : writes completely over the table, removing conceal behavior and highlights
410+ - `raw` : replaces only the `|` icons in each row, leaving the cell completely unmodified
411+
412+
413+ WINDOW OPTIONS *render-markdown-setup-window-options*
414+
415+ Options are all contained in the `win_options` table.
416+
417+ This changes the `conceallevel` & `concealcursor` when rendering. When not
418+ rendering the value is changed back to the users configured value.
419+
289420
290421==============================================================================
2914227. Additional Info *render-markdown-additional-info*
0 commit comments