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] render-markdown plugin support #362

Open
SebastianMusic opened this issue Oct 4, 2024 · 1 comment
Open

[FEATURE] render-markdown plugin support #362

SebastianMusic opened this issue Oct 4, 2024 · 1 comment
Assignees

Comments

@SebastianMusic
Copy link

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

Hello, this is my first issue ever on github so please redirect me if i posted this in the wrong place.

I wanted to use this plugin for rendering markdown in my neovim. I came across an issue pretty quickly though, which was that the gruvbox colorscheme did not apply to the markdown headings. As you can see in the image below

image

Describe the solution you'd like

I ended up finding a fix for it though so now it looks like this. You can add background colours yourself but i prefer a transparent background.
image

I simply added the code snippet under to my overrides inside of the opts of the gruvbox.lua colorscheme file.
I based the colours of how the obsidian gruvbox theme colours different headings, and i took the hex values from the colour pallete on the gruvbox github page.

-- add colour code inside of bg=' ' if you want background colours
   overrides = {
      RenderMarkdownH1Bg = { fg = '#cc241d', bg = '', bold = true },
      RenderMarkdownH2Bg = { fg = '#d79921', bg = '', bold = true },
      RenderMarkdownH3Bg = { fg = '#98971a', bg = '', bold = true },
      RenderMarkdownH4Bg = { fg = '#689d6a', bg = '', bold = true },
      RenderMarkdownH5Bg = { fg = '#458588', bg = '', bold = true },
      RenderMarkdownH6Bg = { fg = '#b16286', bg = '', bold = true },
    },

I would like to either get better gruvbox integration with the render-markdown plugin.
If that is not feasible it would be great if this could solution be added to a wiki somewhere, such that the others who stumble upon this problem can find a quick fix.

@SebastianMusic
Copy link
Author

i got help from the owner of the render-markdown repository

Now this should interact with treesitter directly making it a much better general improvement to the colorscheme.
This is how i use it currently for the gruvbox theme.

    overrides = {
      -- Markdown Header Background Overrides with Foreground Colors
      ['@markup.heading.1.markdown'] = { fg = '#fb4934', bg = '', bold = true },
      ['@markup.heading.2.markdown'] = { fg = '#fabd2f', bg = '', bold = true },
      ['@markup.heading.3.markdown'] = { fg = '#b8bb26', bg = '', bold = true },
      ['@markup.heading.4.markdown'] = { fg = '#8ec07c', bg = '', bold = true },
      ['@markup.heading.5.markdown'] = { fg = '#83a598', bg = '', bold = true },
      ['@markup.heading.6.markdown'] = { fg = '#d3869b', bg = '', bold = true },
    },

with this change though if you want transparent background on the different headers, you need to add the code snippet below inside of the opts of your render-markdown.lua file

      backgrounds = {
        '',
        '',
        '',
        '',
        '',
        '',
      },

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

No branches or pull requests

2 participants