ui framework extraction updates
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
# ./ctrl/theme.sh # bake — rewrite every generated block
|
||||
# ./ctrl/theme.sh check # fail if any page is stale; changes nothing
|
||||
# ./ctrl/theme.sh new [title] # a scaffold page to start from
|
||||
# ./ctrl/theme.sh run FILE [--list|--check] [--only NAME]
|
||||
# # every page a run file lists, each with a contract
|
||||
# ./ctrl/theme.sh parts # what can be added, and the markup that adds it
|
||||
# ./ctrl/theme.sh export [name...] # the contract for a subset, as one doc
|
||||
#
|
||||
@@ -30,6 +32,10 @@
|
||||
# hardcoded page list, and so was never baked once.
|
||||
set -e
|
||||
|
||||
# Where the caller stood. A run file is named relative to there, and the cd below
|
||||
# would otherwise make `run ./theme.toml` mean a different file.
|
||||
CALLER_DIR="$PWD"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
cd "$ROOT_DIR/soleprint"
|
||||
@@ -42,6 +48,22 @@ case "${1:-bake}" in
|
||||
parts)
|
||||
exec "$PYTHON" common/theme/bake.py --parts
|
||||
;;
|
||||
run)
|
||||
# A run file: every page a project has, its context, and a contract per
|
||||
# page for the LLM. See soleprint/common/theme/theme.example.toml.
|
||||
shift
|
||||
args=() file="" prev=""
|
||||
for a in "$@"; do
|
||||
if [[ -z "$file" && "$a" != -* && "$prev" != "--only" ]]; then
|
||||
file="$(cd "$CALLER_DIR" && realpath -m -- "$a")"
|
||||
args+=("$file")
|
||||
else
|
||||
args+=("$a")
|
||||
fi
|
||||
prev="$a"
|
||||
done
|
||||
exec "$PYTHON" common/theme/bake.py --run "${args[@]}"
|
||||
;;
|
||||
new)
|
||||
shift
|
||||
exec "$PYTHON" common/theme/bake.py --new "$@"
|
||||
@@ -52,7 +74,7 @@ case "${1:-bake}" in
|
||||
;;
|
||||
*)
|
||||
echo "Unknown: $1" >&2
|
||||
echo "Usage: ./ctrl/theme.sh [new [title]|parts|bake|check|export [name...]]" >&2
|
||||
echo "Usage: ./ctrl/theme.sh [new [title]|parts|bake|check|export [name...]|run FILE]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user