add better template.
This commit is contained in:
parent
e1575c85a1
commit
7d07c5fb2b
|
@ -0,0 +1,10 @@
|
|||
# changelog
|
||||
|
||||
## 0.1.1 - 2025-01-18
|
||||
|
||||
### added
|
||||
|
||||
- git tags.
|
||||
- readme install instructions.
|
||||
- added changelog.
|
||||
- more templates: schedule, buy.
|
44
plan.bak
44
plan.bak
|
@ -1,44 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd ~/.plan || {
|
||||
echo "Directory ~/.plan not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# YYYY-MM-DD format
|
||||
today=$(date +%F)
|
||||
|
||||
# create if None
|
||||
if ! ls "$today.md" >/dev/null 2>&1; then
|
||||
touch "$today.md"
|
||||
{
|
||||
printf "# %s\n\n" "$today"
|
||||
printf "# todo\n\n"
|
||||
# todo
|
||||
|
||||
- chore: shred documents.
|
||||
- workout: ymca.
|
||||
- buy: soda stream.
|
||||
- donate: table
|
||||
- hang: painting
|
||||
- code:
|
||||
|
||||
# meals
|
||||
|
||||
- breakfast: oatmeal
|
||||
- lunch: leftovers
|
||||
- dinner: curry
|
||||
|
||||
# groceries
|
||||
|
||||
} >>"$today.md"
|
||||
fi
|
||||
|
||||
# most recently modified
|
||||
recent_file=$(ls -t *.md | head -n 1)
|
||||
if [[ "$recent_file" != "$today.md" ]]; then
|
||||
recent_file="$today.md"
|
||||
fi
|
||||
|
||||
# Open the most recent file in Neovim and run the <C-e> command
|
||||
nvim "$recent_file" +":normal \<C-e\>"
|
|
@ -0,0 +1,24 @@
|
|||
import os
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from .templates import default
|
||||
|
||||
|
||||
def today() -> Path:
|
||||
today = datetime.today().strftime("%Y-%m-%d")
|
||||
today_path = Path().home() / ".plan" / f"{today}.md"
|
||||
return today_path
|
||||
|
||||
|
||||
def open(plan: Path):
|
||||
import subprocess
|
||||
|
||||
plan.parent.mkdir(parents=True, exist_ok=True)
|
||||
if not plan.exists():
|
||||
plan.touch()
|
||||
with plan.open("w") as f:
|
||||
f.write(default())
|
||||
editor = os.getenv("EDITOR", "nvim")
|
||||
os.chdir(Path().home() / ".plan")
|
||||
subprocess.run([editor, str(plan)])
|
|
@ -1,6 +1,6 @@
|
|||
import click
|
||||
from click_default_group import DefaultGroup
|
||||
from .path import open, today
|
||||
from . import open, today
|
||||
|
||||
|
||||
@click.group(cls=DefaultGroup, default="today", default_if_no_args=True)
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
import os
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from .templates import default
|
||||
|
||||
|
||||
def today() -> Path:
|
||||
today = datetime.today().strftime("%Y-%m-%d")
|
||||
today_path = Path().home() / ".plan" / f"{today}.md"
|
||||
return today_path
|
||||
|
||||
|
||||
def open(plan: Path):
|
||||
import subprocess
|
||||
|
||||
plan.parent.mkdir(parents=True, exist_ok=True)
|
||||
if not plan.exists():
|
||||
plan.touch()
|
||||
with plan.open("w") as f:
|
||||
f.write(default())
|
||||
editor = os.getenv("EDITOR", "nvim")
|
||||
os.chdir(Path().home() / ".plan")
|
||||
subprocess.run([editor, str(plan)])
|
|
@ -6,6 +6,7 @@
|
|||
- workout:
|
||||
- job:
|
||||
- comm:
|
||||
- buy:
|
||||
|
||||
## meals
|
||||
|
||||
|
@ -13,9 +14,38 @@
|
|||
- lunch: leftovers
|
||||
- dinner: curry
|
||||
|
||||
## schedule
|
||||
|
||||
- 5:00: sleep.
|
||||
- 6:00: breakfast.
|
||||
- 7:00: walk.
|
||||
- 8:00: meeting.
|
||||
- 9:00: code.
|
||||
- 10:00: code.
|
||||
- 11:00: walk.
|
||||
- 12:00: lunch.
|
||||
- 1:00: code.
|
||||
- 2:00: code.
|
||||
- 3:00: walk.
|
||||
- 4:00: code.
|
||||
- 5:30: trailhead.
|
||||
- 6:00: cook.
|
||||
- 7:00: dinner.
|
||||
- 8:00: wind down.
|
||||
- 9:00: read.
|
||||
- 10:00: sleep.
|
||||
|
||||
## groceries
|
||||
|
||||
- lx
|
||||
- spinach
|
||||
- apples
|
||||
- bananas
|
||||
- milk.
|
||||
- oatmeal.
|
||||
- lx.
|
||||
- passionfruit.
|
||||
- spinach.
|
||||
- bananas.
|
||||
- chicken.
|
||||
- crackers.
|
||||
- cheese.
|
||||
- apples.
|
||||
- bread.
|
||||
|
||||
|
|
Loading…
Reference in New Issue