nix-community.nixvim/docs/fix-links/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
651 B
Nix
Raw Normal View History

{
lib,
runCommand,
pandoc,
githubUrl ? "https://github.com/nix-community/nixvim/blob/main/",
docsUrl ? "https://nix-community.github.io/nixvim/",
}:
src:
runCommand (src.name or (builtins.baseNameOf src))
{
inherit src;
bindings =
lib.generators.toLua
{
asBindings = true;
}
{
inherit githubUrl docsUrl;
};
filter = ./filter.lua;
nativeBuildInputs = [ pandoc ];
}
''
echo "$bindings" > filter.lua
cat $filter >> filter.lua
pandoc \
--output $out \
--from gfm \
--to gfm \
--lua-filter filter.lua \
$src
''