feat(gen-docs): also get source of package
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
a4c953df3b
commit
d2c7ee7e25
2 changed files with 14 additions and 3 deletions
|
@ -1,12 +1,23 @@
|
||||||
|
packageMetaFunc=$(cat << EOF
|
||||||
|
(x: {
|
||||||
|
attrs = builtins.mapAttrs (_: v: {
|
||||||
|
desc = v.meta.description or "";
|
||||||
|
homepage = v.meta.homepage or "";
|
||||||
|
}) x.\${builtins.currentSystem};
|
||||||
|
})
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
substitute() {
|
substitute() {
|
||||||
echo '' | pandoc --metadata-file <(
|
echo '' | pandoc --metadata-file <(
|
||||||
nix eval \
|
nix eval \
|
||||||
--impure \
|
--impure \
|
||||||
--json \
|
--json \
|
||||||
.#"$1" \
|
.#"$1" \
|
||||||
--apply "(x: {attrs = builtins.mapAttrs (_: v: v.meta.description or \"\") x.\${builtins.currentSystem};})" |
|
--apply "$packageMetaFunc" |
|
||||||
jq -r
|
jq -r
|
||||||
) -t markdown --template "$2" -o "$3"
|
) -t markdown --template "$2" -o "$3"
|
||||||
}
|
}
|
||||||
|
|
||||||
substitute "devShells" "./templates/devShells.md" "$FLAKE/devShells/README.md"
|
substitute "devShells" "$FLAKE/apps/gen-docs/templates/devShells.md" "$FLAKE/devShells/README.md"
|
||||||
|
|
|
@ -7,5 +7,5 @@ This directory contains every derivations for devShells exposed by this flake.
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| ---- | ----------- |
|
| ---- | ----------- |
|
||||||
$for(attrs/pairs)$
|
$for(attrs/pairs)$
|
||||||
| $it.key$ | $it.value$ |
|
| $it.key$ | $it.value.desc$ |
|
||||||
$endfor$
|
$endfor$
|
||||||
|
|
Loading…
Reference in a new issue