MeanderingProgrammer / render-markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
1.44k stars 35 forks source link

feature: Indent top-level unordered ("bulleted") list items #181

Open proofer opened 2 hours ago

proofer commented 2 hours ago

Is your feature request related to a problem? Please describe.

Unordered list items, e.g.,

| <-- left margin, if this were not a github markdown code block in order to render literal hyphens
- first item  
- second item

should be rendered indented, should't they?

Describe the solution you'd like

--Using github's markdown rendering to show what I'd like; the pre-rendering hyphens are at the left margin

Describe alternatives you've considered

I don't know what other solutions or features to consider, given that I otherwise like render-markdown.nvim a lot.

Additional information

No response

proofer commented 2 hours ago

This works

    opts = {
        bullet = {
            left_pad = 4,
        },
    },

except the wrapped portion of a line-wrapped list item now doesn't indent nicely so that its first character is horizontally aligned with the first character of the item.

MeanderingProgrammer commented 1 hour ago

I'm not trying to render the markdown like github or any other specific software by default. The default is really my personal preference, which is to strike a balance between what I consider looking nice, without shifting the text too much, I more or less like an overlay. That's why all the indentation features are off / set to zero by default. From there it's up to individuals to set the configuration to their preference.

I do have a notion of presets though: https://github.com/MeanderingProgrammer/render-markdown.nvim/blob/main/lua/render-markdown/presets.lua#L15, if you want to offer up a suggested config for github I'd be more than happy to add it :)

It looks like you found the left_pad option, is the issue now just about applying the padding to the entire list item, rather than just the first line?

proofer commented 1 hour ago

is the issue now just about applying the padding to the entire list item, rather than just the first line? Yes.

I ought to have found left_pad before posting, but I thought I'd leave the post as a lesson to others who don't take sufficient time to read the available opts. Thanks for your understanding.