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() {
|
||||
echo '' | pandoc --metadata-file <(
|
||||
nix eval \
|
||||
--impure \
|
||||
--json \
|
||||
.#"$1" \
|
||||
--apply "(x: {attrs = builtins.mapAttrs (_: v: v.meta.description or \"\") x.\${builtins.currentSystem};})" |
|
||||
--apply "$packageMetaFunc" |
|
||||
jq -r
|
||||
) -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 |
|
||||
| ---- | ----------- |
|
||||
$for(attrs/pairs)$
|
||||
| $it.key$ | $it.value$ |
|
||||
| $it.key$ | $it.value.desc$ |
|
||||
$endfor$
|
||||
|
|
Loading…
Reference in a new issue