mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-11 05:16:35 +02:00
docs/fix-links: init
The README/CONTRIBUTING files are authored with GitHub in mind, but we want to re-use them for the docs website. Replace the existing simple substitution with a pandoc AST-based filter.
This commit is contained in:
parent
ff63fc92ed
commit
7f29e4b2ae
3 changed files with 84 additions and 6 deletions
33
docs/fix-links/default.nix
Normal file
33
docs/fix-links/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
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 markdown \
|
||||
--to markdown-raw_attribute \
|
||||
--lua-filter filter.lua \
|
||||
$src
|
||||
''
|
Loading…
Add table
Add a link
Reference in a new issue