Skip to content

Commit

Permalink
feat: Add markdown.nvim integration (#740)
Browse files Browse the repository at this point in the history
* feat: Add markdown.nvim integration

* fix: option order

* fix: Use `render-markdown` name in README
  • Loading branch information
ValdezFOmar authored Aug 2, 2024
1 parent 10eda02 commit ba41328
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,20 @@ To use another flavour just replace `mocha` with the one you want to use.
</tr>
<!-- reactive.nvim -->

<!-- markdown.nvim -->
</tr>
<tr>
<td> <a href="https://github.com/MeanderingProgrammer/markdown.nvim">render-markdown (markdown.nvim)</a> </td>
<td>

```lua
render_markdown = true
```

</td>
</tr>
<!-- markdown.nvim -->

<!-- symbols-outline.nvim -->
</tr>
<tr>
Expand Down
27 changes: 27 additions & 0 deletions lua/catppuccin/groups/integrations/render_markdown.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local M = {}

-- markdown.nvim highlight groups:
-- https://github.com/MeanderingProgrammer/markdown.nvim?tab=readme-ov-file#colors

function M.get()
local groups = {
RenderMarkdownCode = { bg = C.surface0 },
RenderMarkdownCodeInline = { bg = C.surface1 },
RenderMarkdownBullet = { fg = C.sky },
RenderMarkdownTableHead = { fg = C.blue },
RenderMarkdownTableRow = { fg = C.lavender },
}

local syntax = require("catppuccin.groups.syntax").get()
local base = not O.transparent_background and C.base or nil

for i = 1, 6 do
local color = syntax["rainbow" .. i].fg
groups["RenderMarkdownH" .. i] = { fg = color }
groups["RenderMarkdownH" .. i .. "Bg"] = { bg = U.darken(color, 0.30, base) }
end

return groups
end

return M
1 change: 1 addition & 0 deletions lua/catppuccin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ local M = {
nvimtree = true,
ufo = true,
rainbow_delimiters = true,
render_markdown = true,
semantic_tokens = not is_vim,
telescope = { enabled = true },
treesitter = not is_vim,
Expand Down
1 change: 1 addition & 0 deletions lua/catppuccin/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
---@field overseer boolean?
---@field pounce boolean?
---@field rainbow_delimiters boolean?
---@field render_markdown boolean?
---@field sandwich boolean?
---@field semantic_tokens boolean?
---@field symbols_outline boolean?
Expand Down

0 comments on commit ba41328

Please sign in to comment.