37 lines
No EOL
696 B
Bash
37 lines
No EOL
696 B
Bash
#!/bin/bash
|
|
# new-study.sh - Scaffold a new research markdown file
|
|
# Usage: ./scripts/new-study.sh <topic-name> [YYYY-MM-DD]
|
|
set -e
|
|
TOPIC="${1:?topic name required}"
|
|
DATE="${2:-$(date +%Y-%m-%d)}"
|
|
FILE="research/tech-study/${DATE}-${TOPIC}.md"
|
|
mkdir -p "$(dirname "$FILE")"
|
|
|
|
cat > "$FILE" <<EOF
|
|
---
|
|
title: "${TOPIC}"
|
|
date: ${DATE}
|
|
tags: ["#${TOPIC}", "#tech-study"]
|
|
status: draft
|
|
related: []
|
|
---
|
|
|
|
# ${TOPIC//-/ }
|
|
|
|
## Purpose
|
|
Briefly describe the study's goal.
|
|
|
|
## Insights
|
|
-
|
|
|
|
## Sources
|
|
-
|
|
|
|
## Action Items
|
|
- [ ]
|
|
EOF
|
|
|
|
echo "Created $FILE"
|
|
# Append to knowledge-base/index.md
|
|
echo "- ${DATE}-${TOPIC}.md: ${TOPIC//-/ }" >> knowledge-base/index.md
|
|
echo "Appended entry to knowledge-base/index.md" |