-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Center & Padding for text body #200
Comments
## Details Request: #200 Adds a new paragraph configuration which has 2 properties in addition to the standard `enabled` field. - `min_width`: allows you to specify a minimum width for each paragraph to improve general alignment when using long and short paragraphs - `left_margin`: this functions in the same way as heading and code block margin where a value < 1 is treated as a fraction of the available window space and values >= 1 are just then number of cells to use for margin. We use margin rather than padding since paragraphs do not support a background so padding would not have any visual distenction. Includes a minor refactor to allow `list.clamp` to resolve either a single value or an array of values rather than only having this availble in the heading module. That's still the only place that it's used but in general I think it makes sense to have it more available.
Added the feature here under a new You can try something like: require('render-markdown').setup({
paragraph = {
left_margin = 0.5,
min_width = 100,
},
}) To center paragraphs. Paragraphs are centered individually, so if you don't set a |
Thanks! it did work, adding a paragraph render is nice too, I guess I can play with similar attributes as in the header. |
Yeah, I'm not sure how to apply inline virtual text across wrapped lines. Currently I don't think it's possible, at least not easily. |
Is your feature request related to a problem? Please describe.
I was wondering if it is possible to center the written text (not codeblock or something, just normal paragraphs), not as much as center align but some padding on the left and right. The header is centered perfectly, but this adds readability for quick notes.
Describe the solution you'd like
A good enclosure could be this one, having a margin on the left and right:

Describe alternatives you've considered
Maybe handling terminal padding or in neovim config works, but I don't know if it's possible enabling this only on markdown files.
Additional information
No response
The text was updated successfully, but these errors were encountered: