33 lines
703 B
Bash
Executable File
33 lines
703 B
Bash
Executable File
#!/bin/bash
|
|
INPUT="$1"
|
|
OUTPUT="$2"
|
|
|
|
cat > "$OUTPUT" << 'MD_START'
|
|
---
|
|
title: "Claude Code Conversation - modb_orno3"
|
|
author: "Claude & User"
|
|
date: "25 stycznia 2026"
|
|
geometry: margin=2cm
|
|
---
|
|
|
|
MD_START
|
|
|
|
jq -r '
|
|
select(.type == "user" or .type == "assistant") |
|
|
if .type == "user" then
|
|
"\n## 👤 User Query\n\n```\n" + (.message.content // "") + "\n```\n"
|
|
elif .type == "assistant" then
|
|
"\n## 🤖 Claude Response\n\n" + (
|
|
if (.message.content | type) == "array" then
|
|
(.message.content[] | select(.type == "text") | .text)
|
|
else
|
|
(.message.content // "")
|
|
end
|
|
) + "\n"
|
|
else
|
|
empty
|
|
end
|
|
' "$INPUT" >> "$OUTPUT"
|
|
|
|
echo "✓ Markdown saved to: $OUTPUT"
|