Skip to content

Feature Request: New code block style with reduced padding #62

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

Closed
tristan-harris opened this issue Jul 11, 2024 · 4 comments
Closed

Feature Request: New code block style with reduced padding #62

tristan-harris opened this issue Jul 11, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@tristan-harris
Copy link

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

'Normal' style code blocks have a full line of padding at both ends and can look ugly.

Describe the solution you'd like

An added code block style that uses half block characters at the borders so that padding is reduced.

after

Describe alternatives you've considered

N/A

Additional information

Thank you for the work you have put into this plugin, I can't imagine going back to just raw Markdown.

@tristan-harris tristan-harris added the enhancement New feature or request label Jul 11, 2024
@MeanderingProgrammer
Copy link
Owner

Thank you, glad you are enjoying it!

This wouldn't exactly remove padding right? Since the half height characters would still take up a full line.

I guess visually you would end up with less padding and a larger margin.

Is that kind of what you're looking for?

@tristan-harris
Copy link
Author

Thank you for your response, I'll clarify what I mean.

The code block will still occupy the same number of lines, but two lines will be saved by being able to place text immediately above and below the code block without the border of the code block touching said text.

It's a minor aesthetic thing, but the idea is to allow for more condensed markdown notes while still maintaining clear visual separation between blocks of code and text.

MeanderingProgrammer added a commit that referenced this issue Jul 14, 2024
## Details

Request: #62

Rather than using a highlight group for the entire range of code blocks
allow half height characters to be used when start and end of code
block are entirely concealed.

This involves using the inverse of the code highlight group and
repeating the configured characters across the width.

Allow using the original implementation with `{ border = 'thick' }`.

When rendering the body we now need to be aware of how the language
was rendered, since placing a language above the code block interferes
with the half height row. To fix this we need to handle the language
from the top level code block logic, instead of using 2 separate
capture groups for code block & language.

Add sign configuration to README as well.
@MeanderingProgrammer
Copy link
Owner

Merged in: 3114d70

Please update and LMK if it's what you had in mind!

@tristan-harris
Copy link
Author

Yes this is what I had in mind, thank you for implementing my request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants