Update user scripts and table formatting

Add doc annotations to user scripts and refine prompts for user input.
Improve table.jq to use keys_unsorted for header generation.
This commit is contained in:
Chris Kruining 2026-02-17 15:39:55 +01:00
parent 10a1a324ce
commit b72681ff63
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
2 changed files with 10 additions and 8 deletions

View file

@ -27,10 +27,9 @@ def to_line(left; joiner; right):
[left, .[0], (.[1:] | map([joiner, .]) ), right] | flatten | join("");
def create(data; header_callback; cell_callback):
(data[0] | to_entries | map(.key)) as $keys
| ([$keys]) as $header
(data[0] | keys_unsorted) as $keys
| (data | map(to_entries | map(.value))) as $rows
| ($header + $rows) as $cells
| ([$keys] + $rows) as $cells
| (
$keys # Use keys so that we have an array of the correct size
| to_entries