Skip to content
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: add a way to disable code borders while keeping opts.code.style = "language" #246

Closed
loqusion opened this issue Dec 1, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@loqusion
Copy link

loqusion commented Dec 1, 2024

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

opts.code.style = "full" looks quite nice on an opaque background. But on a transparent background, it's a different story...

image

This can be mitigated somewhat with opts.code.style = "language":

image

And then by setting opts.code.highlight = "Normal":

image

But the bottom border still persists.

There's also the nuclear option of opts.code.style = "none", but then we miss out on the language icon + name.

Describe the solution you'd like

Subjectively, I think opts.code.style = "language" should disable the borders entirely with no extra configuration needed.

Describe alternatives you've considered

If that's not an option, then perhaps a new configuration property in opts.code could be added. (But this places more burden on plugin users.)

Additional information

No response

@loqusion loqusion added the enhancement New feature or request label Dec 1, 2024
MeanderingProgrammer added a commit that referenced this issue Dec 1, 2024
## Details

Request: #246

Adds `none` to the possible values for `code.border`.

Using this value when paired with `code.disable_background = true`
allows the user to only keep the language icon rendering feature. The
`code.disable_background` feature functions in the same way as
`code.style = 'language'`.

Ideally I would remove the `style` options, it seems better to control
everything more granularly and then group settings under a `preset`
option, but it is what is is, will keep both around even though they end
up being redundant.

Will consider a major version bump that breaks styles in the future.
@MeanderingProgrammer
Copy link
Owner

Added none as an option for code.border here: f3cda24.

I'll rethink the language style behavior at some point in the future, debating how to handle styles in general. I may remove them or treat them more as presets, still not decided, leaning towards the latter.

You can use the language style along with the new border value or if you want consistent behavior that doesn't change when I modify style value behaviors you can use disable_background to remove the background from code blocks, so your config would look like:

require('render-markdown').setup({
    code = {
        disable_background = true,
        border = 'none',
    },
})

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