wxgeorge's picture
:sparkles: script to auto-generate model annotations.
caba5f3
raw
history blame
614 Bytes
#!/bin/bash
# update model cache
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
pushd $SCRIPT_DIR > /dev/null
cat << MARKDOWN
---
$(cat manual-metadata.yaml)
$(cat model-cache.json \
| jq '[to_entries[] | select(.key | test("70b|72b") | not) | .value[]] | sort | { models: . }' \
| node -e "
const fs = require('fs');
const YAML = require('yaml');
const input = fs.readFileSync(0, 'utf-8'); // Read from stdin
const json = JSON.parse(input);
const yamlStr = YAML.stringify(json);
console.log(yamlStr);"
)
---
$(cat body.md)
MARKDOWN
popd > /dev/null