refactor: 문서 개선 중

This commit is contained in:
donghyeon-ka
2026-09-21 14:30:55 +09:00
parent c93cdea150
commit 805a18f486
1497 changed files with 525837 additions and 59152 deletions
+61
View File
@@ -9,4 +9,65 @@ if [ ! -d "$TECHVIZ_HOME/src/techviz" ]; then
exit 1
fi
export TECHVIZ_HOME
if [ "${1:-}" = "render" ]; then
PYTHONPATH="$TECHVIZ_HOME/src${PYTHONPATH:+:$PYTHONPATH}" python3 -m techviz "$@"
spec="${2:-}"
out=""
args=("$@")
for ((i = 0; i < ${#args[@]}; i++)); do
case "${args[$i]}" in
-o|--output|--out-dir)
if (( i + 1 < ${#args[@]} )); then
out="${args[$((i + 1))]}"
fi
;;
esac
done
if [ -n "$spec" ] && [ -n "$out" ]; then
python3 - "$spec" "$out" <<'PY'
from __future__ import annotations
import hashlib
import json
import pathlib
import sys
spec_path = pathlib.Path(sys.argv[1])
out_dir = pathlib.Path(sys.argv[2])
if not spec_path.is_file() or not out_dir.is_dir():
raise SystemExit(0)
spec = json.loads(spec_path.read_text(encoding="utf-8"))
spec_id = spec.get("id")
if not isinstance(spec_id, str) or not spec_id:
raise SystemExit(0)
manifest_path = out_dir / f"{spec_id}.manifest.json"
if not manifest_path.is_file():
raise SystemExit(0)
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
hashes: dict[str, str] = {}
for name in manifest.get("outputs") or []:
if not isinstance(name, str):
continue
path = out_dir / name
if not path.is_file():
continue
hashes[name] = hashlib.sha256(path.read_bytes()).hexdigest()
manifest["source_spec_file_sha256"] = hashlib.sha256(spec_path.read_bytes()).hexdigest()
manifest["output_sha256"] = hashes
manifest_path.write_text(
json.dumps(manifest, ensure_ascii=False, indent=2) + "\n",
encoding="utf-8",
)
PY
fi
exit 0
fi
PYTHONPATH="$TECHVIZ_HOME/src${PYTHONPATH:+:$PYTHONPATH}" exec python3 -m techviz "$@"