2025-11-30 Oddμ new
I recently decided I needed a new `oddmu new` command so that I could quickly start writing a new page. I ended up writing a `fish` function instead of adding code to Oddμ itself.
function oddmu
if test "$argv[1]" = new
set date (date --iso)
if test -z $argv[2]
set filename $date.md
else
set filename (date --iso)-$argv[2].md
end
if test ! -f "$filename"
echo "# $date " >> $filename
end
if $EDITOR $filename
oddmu notify $filename
end
else
command oddmu $argv
end
end
When I run `oddmu new something` on the command line, it creates a page for the current day and "today", calls my favourite editor to edit it, and calls `oddmu notify` on the newly created file at the end.
This works well with the `make snapshot`, `make download`, `make diff` and `make upload` commands based on the Makefile.