mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(image): mermaid theme. Closes #1282
This commit is contained in:
parent
f4583da710
commit
8117fb4cbb
2 changed files with 9 additions and 2 deletions
|
@ -93,11 +93,13 @@ local commands = {
|
|||
end,
|
||||
},
|
||||
mmd = {
|
||||
ft = "png",
|
||||
cmd = {
|
||||
cmd = "mmdc",
|
||||
args = { "-i", "{src}", "-o", "{file}", "-b", "transparent", "-t", "{bg}", "-s", "{scale}" },
|
||||
args = Snacks.image.config.convert.mermaid,
|
||||
},
|
||||
file = function(convert, ctx)
|
||||
return convert:tmpfile(vim.o.background .. ".png")
|
||||
end,
|
||||
},
|
||||
identify = {
|
||||
pipe = false,
|
||||
|
|
|
@ -102,6 +102,11 @@ local defaults = {
|
|||
env = {},
|
||||
---@class snacks.image.convert.Config
|
||||
convert = {
|
||||
---@type snacks.image.args
|
||||
mermaid = function()
|
||||
local theme = vim.o.background == "light" and "neutral" or "dark"
|
||||
return { "-i", "{src}", "-o", "{file}", "-b", "transparent", "-t", theme, "-s", "{scale}" }
|
||||
end,
|
||||
---@type table<string,snacks.image.args>
|
||||
magick = {
|
||||
default = { "{src}[0]", "-scale", "1920x1080>" },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue