From b32fbc08bdf8bf98335a1dca5fa85b299cec0c37 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 20 Jan 2025 11:40:10 -0500 Subject: [PATCH] feat(gen-docs): clean up presentation of output --- apps/gen-docs/default.nix | 3 ++- apps/gen-docs/script.sh | 4 ++-- apps/gen-docs/templates/devShells.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/gen-docs/default.nix b/apps/gen-docs/default.nix index 5877a31d..f0d095ac 100644 --- a/apps/gen-docs/default.nix +++ b/apps/gen-docs/default.nix @@ -1,10 +1,11 @@ { writeShellApplication, + jq, pandoc, ... }: writeShellApplication { name = "gen-docs"; - runtimeInputs = [pandoc]; + runtimeInputs = [jq pandoc]; text = builtins.readFile ./script.sh; } diff --git a/apps/gen-docs/script.sh b/apps/gen-docs/script.sh index 0d2af308..48018425 100755 --- a/apps/gen-docs/script.sh +++ b/apps/gen-docs/script.sh @@ -1,9 +1,9 @@ packageMetaFunc=$(cat << EOF (x: { attrs = builtins.mapAttrs (_: v: { - desc = v.meta.description or ""; + desc = builtins.replaceStrings ["\n"] [""] (v.meta.description or ""); homepage = v.meta.homepage or ""; - }) x.\${builtins.currentSystem}; + }) (builtins.removeAttrs x.\${builtins.currentSystem} ["default"]); }) EOF ) diff --git a/apps/gen-docs/templates/devShells.md b/apps/gen-docs/templates/devShells.md index 3fd71fa7..e608570a 100644 --- a/apps/gen-docs/templates/devShells.md +++ b/apps/gen-docs/templates/devShells.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.desc$ | +| $it.key$ | $it.value.desc/nowrap$ | $endfor$