3 ms·
I wrote a Bash command: Scripts andi$ cat idea.sh #!/bin/sh IDEAS_PATH='/Users/andi/Google Drive/ideas' ARGS=$@ FILENAME="${IDEAS_PATH}/${ARGS// /-}.md" echo
by nexuist 8y ago
I wrote a Bash command:
Scripts andi$ cat idea.sh
#!/bin/sh
IDEAS_PATH='/Users/andi/Google Drive/ideas'
ARGS=$@
FILENAME="${IDEAS_PATH}/${ARGS// /-}.md"
echo "---
date: $(date +"%Y-%m-%dT%H:%M")
type: FILL THIS IN
---
A great new idea." >> "$FILENAME"
macdown "$FILENAME"
Usage (aliased):
Scripts andi$ idea my great new idea
Results:
A markdown file in my ideas folder titled my-great-new-idea.md with automatically generated front matter (date/type). If I wanted to keep track of more things (like the weather or something) I can just script its addition into front matter and then query by type through grep or something similar. Also, the file automatically opens in Macdown (https://macdown.uranusjr.com/ https://macdown.uranusjr.com/).