Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr2145 :: Daily notes and todo list with markdown

How I use markdown and git to keep up with what I do

<< First, < Previous, Latest >>

Hosted by norrist on 2016-10-21 is flagged as Clean and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (6)

Using Markdown and git to store your todo list and daily journal

Why markdown
  • No distractions
  • Simple syntax
  • Plain text, Human readable.
  • Inline HTML
  • Easy conversion to other formats
Why git
  • Any SCM probably OK
  • Github and Gitlab render markdown.
The todo page
    # TODO

    ### Can do now
    * Bullet 1
    * Bullet 2

    ### Near term
    1. Numbered 1
    1. Numbered 2

    ### Long term
The journal script
    DAILYFILE="/Users/norrist/Projects/todo/daily/$(/bin/date +%F).md"
    DAILYPATH="/Users/norrist/Projects/todo/daily/"
    LOCKFILE="/Users/norrist/Projects/todo/daily/LOCK"
    TODOFILE="/Users/norrist/Projects/todo/todo.md"

    if [ -f $LOCKFILE ]
        then
            echo "$LOCKFILE PRESENT - ABORTING"
            read -n1 -p "Remove and Continue? [y,n]" doit
                case $doit in
                    y|Y) echo "Continuing with $LOCKFILE PRESENT" ;;
                    *) exit 1 ;;
                esac


        else
            echo "NO LOKCFILE"
            touch $LOCKFILE

    fi


    if [ -f $DAILYFILE ]
        then
            echo "$DAILYFILE exists"
        else
            echo  >> $DAILYFILE
            echo  "-----">> $DAILYFILE
            echo "# $(/bin/date +%F)" >> $DAILYFILE
            echo  >> $DAILYFILE
            echo "### Projects" >> $DAILYFILE
            echo  >> $DAILYFILE
            echo "### Tickets" >> $DAILYFILE
            echo  >> $DAILYFILE
            echo "### Walkups" >> $DAILYFILE
    fi

    /usr/local/bin/edit -w --new-window $DAILYFILE
    /opt/local/bin/aspell -c $DAILYFILE
    /opt/local/bin/aspell -c $TODOFILE

    rm $LOCKFILE
    rm $DAILYPATH/README.md

    cat $TODOFILE >> $DAILYPATH/README.md

    for f in $(ls  -r $DAILYPATH/2*md)
     do cat $f >> $DAILYPATH/README.md
     echo >>$DAILYPATH/README.md
     done

    cd /Users/norrist/Projects/todo; /usr/bin/git add . && /usr/bin/git commit -m "$(date)" && /usr/bin/git push origin master

Daily file template

    # 2016-08-02

    -----

    ### Projects

    ### Tickets

    ### Walkups
aspell is awesome

Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2016-10-21T06:05:01Z by b-yeezi

Love this Idea

Thanks for this show. I agree with your reasons for using markdown. It gets out of your way so you can write. I also find the idea of using git interesting, but I would be concerned about privacy. I guess you can host your own gitlab...

Can't wait for your next show.

Comment #2 posted on 2016-10-24T15:07:12Z by Fin

Nice! Licence?

Nice show! Sweet script! Is it up on a public git repo somewhere?

TL;DR Would you mind adding a licence?

You might think of it as just a little, personal convenience script that doesn't mean much, that anyone can adapt if they please right? But, technically speaking, you've got the copyright (by default) and I can't legally use this code.

You may consider it open source by being on a web page that is covered by the CC-BY-SA licence but they advise against it's use for software as it doesn't explicitly cover distribution of source code (see https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software).

I ask you to consider adding a licence to make it clear what people can do with your script. I'd sure love to use it but, if I make changes and want to share it, we're in a grey area ;)

Comment #3 posted on 2016-10-25T23:04:41Z by norrist

Version with copyright notice

Thanks for the feedback. Here is a link to the script with an ISC license header.

http://norrist.devio.us/pub/todo.sh


Comment #4 posted on 2016-11-30T20:47:38Z by Matt

question about the script

I love your script idea and will probably be copying lots of it. THANKS!

however, in the last "for" loop where you cat your files into the new "README" file, i don't understand this bit:

$(ls -r $DAILYPATH/2*md)

more specifically, the "2*/md" bit. Is this some kind of BASH specific notation? Is this a Mac thing?

OTW, great episode and very helpful!

cheers,
matt

Comment #5 posted on 2016-12-01T16:58:29Z by norrist

"2*/md"

There isnt anything special about "2*/md". All the files that I want combined into the readme are named by date and have the md suffix. so "2*/md" matches 2016-12-01.md as well as all the other daily files. The only reason for "2*/md" to be there is incase I have some other files in the directory that I dont want included in the readme.

Comment #6 posted on 2016-12-04T00:08:05Z by Matt

of course!

thanks... i wasn't thinking about dates starting with 2... duh

Cheers,
matt

Leave Comment

Powered by Comment Script