Compare commits
4 commits
docs/prese
...
build/nix-
| Author | SHA1 | Date | |
|---|---|---|---|
| e76ace674f | |||
|
|
9fe68dd159 | ||
| 6f090fdcf3 | |||
|
|
31dcf9c91f |
2 changed files with 52 additions and 6 deletions
27
flake.nix
27
flake.nix
|
|
@ -19,9 +19,9 @@
|
||||||
{
|
{
|
||||||
formatter = forEachSystem (pkgs: pkgs.nixfmt-tree);
|
formatter = forEachSystem (pkgs: pkgs.nixfmt-tree);
|
||||||
|
|
||||||
devShells = forEachSystem (pkgs: {
|
devShells = forEachSystem (pkgs:
|
||||||
default = pkgs.mkShell {
|
let
|
||||||
packages = [
|
devTools = [
|
||||||
(pkgs.luajit.withPackages (
|
(pkgs.luajit.withPackages (
|
||||||
ps: with ps; [
|
ps: with ps; [
|
||||||
busted
|
busted
|
||||||
|
|
@ -32,9 +32,24 @@
|
||||||
pkgs.stylua
|
pkgs.stylua
|
||||||
pkgs.selene
|
pkgs.selene
|
||||||
pkgs.lua-language-server
|
pkgs.lua-language-server
|
||||||
pkgs.plantuml
|
|
||||||
];
|
];
|
||||||
};
|
in
|
||||||
});
|
{
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
packages = devTools;
|
||||||
|
};
|
||||||
|
presets = pkgs.mkShell {
|
||||||
|
packages = devTools ++ [
|
||||||
|
pkgs.typst
|
||||||
|
pkgs.texliveMedium
|
||||||
|
pkgs.tectonic
|
||||||
|
pkgs.pandoc
|
||||||
|
pkgs.asciidoctor
|
||||||
|
pkgs.quarto
|
||||||
|
pkgs.plantuml
|
||||||
|
pkgs.mermaid-cli
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,37 @@ M.plantuml = {
|
||||||
open = true,
|
open = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@type preview.ProviderConfig
|
||||||
|
M.mermaid = {
|
||||||
|
ft = 'mermaid',
|
||||||
|
cmd = { 'mmdc' },
|
||||||
|
args = function(ctx)
|
||||||
|
return { '-i', ctx.file, '-o', ctx.output }
|
||||||
|
end,
|
||||||
|
output = function(ctx)
|
||||||
|
return (ctx.file:gsub('%.mmd$', '.svg'))
|
||||||
|
end,
|
||||||
|
error_parser = function(output)
|
||||||
|
local diagnostics = {}
|
||||||
|
for line in output:gmatch('[^\r\n]+') do
|
||||||
|
local lnum = line:match('^%s*Parse error on line (%d+)')
|
||||||
|
if lnum then
|
||||||
|
table.insert(diagnostics, {
|
||||||
|
lnum = tonumber(lnum) - 1,
|
||||||
|
col = 0,
|
||||||
|
message = line,
|
||||||
|
severity = vim.diagnostic.severity.ERROR,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return diagnostics
|
||||||
|
end,
|
||||||
|
clean = function(ctx)
|
||||||
|
return { 'rm', '-f', (ctx.file:gsub('%.mmd$', '.svg')) }
|
||||||
|
end,
|
||||||
|
open = true,
|
||||||
|
}
|
||||||
|
|
||||||
---@type preview.ProviderConfig
|
---@type preview.ProviderConfig
|
||||||
M.quarto = {
|
M.quarto = {
|
||||||
ft = 'quarto',
|
ft = 'quarto',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue