|
1 | | -*render-markdown.txt* For 0.10.0 Last change: 2025 February 02 |
| 1 | +*render-markdown.txt* For 0.10.0 Last change: 2025 February 06 |
2 | 2 |
|
3 | 3 | ============================================================================== |
4 | 4 | Table of Contents *render-markdown-table-of-contents* |
@@ -326,7 +326,7 @@ Default Configuration ~ |
326 | 326 | -- Replaces '#+' of 'atx_h._marker' |
327 | 327 | -- The number of '#' in the heading determines the 'level' |
328 | 328 | -- The 'level' is used to index into the list using a cycle |
329 | | - -- If the value is a function the input is the nesting level of the heading within sections |
| 329 | + -- If the value is a function the input context contains the nesting level of the heading within sections |
330 | 330 | icons = { ' ', ' ', ' ', ' ', ' ', ' ' }, |
331 | 331 | -- Determines how icons fill the available space: |
332 | 332 | -- right: '#'s are concealed and icon is appended to right side |
@@ -488,20 +488,20 @@ Default Configuration ~ |
488 | 488 | render_modes = false, |
489 | 489 | -- Replaces '-'|'+'|'*' of 'list_item' |
490 | 490 | -- How deeply nested the list is determines the 'level', how far down at that level determines the 'index' |
491 | | - -- If a function is provided both of these values are passed in using 1 based indexing |
| 491 | + -- If a function is provided both of these values are provided in the context using 1 based indexing |
492 | 492 | -- If a list is provided we index into it using a cycle based on the level |
493 | 493 | -- If the value at that level is also a list we further index into it using a clamp based on the index |
494 | 494 | -- If the item is a 'checkbox' a conceal is used to hide the bullet instead |
495 | 495 | icons = { '●', '○', '◆', '◇' }, |
496 | 496 | -- Replaces 'n.'|'n)' of 'list_item' |
497 | 497 | -- How deeply nested the list is determines the 'level', how far down at that level determines the 'index' |
498 | | - -- If a function is provided both of these values are passed in using 1 based indexing |
| 498 | + -- If a function is provided both of these values are provided in the context using 1 based indexing |
499 | 499 | -- If a list is provided we index into it using a cycle based on the level |
500 | 500 | -- If the value at that level is also a list we further index into it using a clamp based on the index |
501 | | - ordered_icons = function(level, index, value) |
502 | | - value = vim.trim(value) |
503 | | - local value_index = tonumber(value:sub(1, #value - 1)) |
504 | | - return string.format('%d.', value_index > 1 and value_index or index) |
| 501 | + ordered_icons = function(ctx) |
| 502 | + local value = vim.trim(ctx.value) |
| 503 | + local index = tonumber(value:sub(1, #value - 1)) |
| 504 | + return string.format('%d.', index > 1 and index or ctx.index) |
505 | 505 | end, |
506 | 506 | -- Padding to add to the left of bullet point |
507 | 507 | left_pad = 0, |
@@ -805,7 +805,7 @@ Heading Configuration ~ |
805 | 805 | -- Replaces '#+' of 'atx_h._marker' |
806 | 806 | -- The number of '#' in the heading determines the 'level' |
807 | 807 | -- The 'level' is used to index into the list using a cycle |
808 | | - -- If the value is a function the input is the nesting level of the heading within sections |
| 808 | + -- If the value is a function the input context contains the nesting level of the heading within sections |
809 | 809 | icons = { ' ', ' ', ' ', ' ', ' ', ' ' }, |
810 | 810 | -- Determines how icons fill the available space: |
811 | 811 | -- right: '#'s are concealed and icon is appended to right side |
@@ -1019,20 +1019,20 @@ Bullet Point Configuration ~ |
1019 | 1019 | render_modes = false, |
1020 | 1020 | -- Replaces '-'|'+'|'*' of 'list_item' |
1021 | 1021 | -- How deeply nested the list is determines the 'level', how far down at that level determines the 'index' |
1022 | | - -- If a function is provided both of these values are passed in using 1 based indexing |
| 1022 | + -- If a function is provided both of these values are provided in the context using 1 based indexing |
1023 | 1023 | -- If a list is provided we index into it using a cycle based on the level |
1024 | 1024 | -- If the value at that level is also a list we further index into it using a clamp based on the index |
1025 | 1025 | -- If the item is a 'checkbox' a conceal is used to hide the bullet instead |
1026 | 1026 | icons = { '●', '○', '◆', '◇' }, |
1027 | 1027 | -- Replaces 'n.'|'n)' of 'list_item' |
1028 | 1028 | -- How deeply nested the list is determines the 'level', how far down at that level determines the 'index' |
1029 | | - -- If a function is provided both of these values are passed in using 1 based indexing |
| 1029 | + -- If a function is provided both of these values are provided in the context using 1 based indexing |
1030 | 1030 | -- If a list is provided we index into it using a cycle based on the level |
1031 | 1031 | -- If the value at that level is also a list we further index into it using a clamp based on the index |
1032 | | - ordered_icons = function(level, index, value) |
1033 | | - value = vim.trim(value) |
1034 | | - local value_index = tonumber(value:sub(1, #value - 1)) |
1035 | | - return string.format('%d.', value_index > 1 and value_index or index) |
| 1032 | + ordered_icons = function(ctx) |
| 1033 | + local value = vim.trim(ctx.value) |
| 1034 | + local index = tonumber(value:sub(1, #value - 1)) |
| 1035 | + return string.format('%d.', index > 1 and index or ctx.index) |
1036 | 1036 | end, |
1037 | 1037 | -- Padding to add to the left of bullet point |
1038 | 1038 | left_pad = 0, |
|
0 commit comments