Lately I've been finding most of my productive writing has been occurring in Markdown. Specifically, I enjoy using MacDown.
To jumpstart more habitual writing, I wanted dead-simple, 0-dependency, Markdown journaling.
- From desire to write, to actually writing, as quickly as possible.
- Automatic backups to iCloud storage, so I don't have to configure or worry about anything.
Upon searching around, most of the stuff in the simple Markdown journal category came with a lot of extra fluff, required Dropbox, or had a host of dependencies.
This is JournalDown.
JournalDown is a BASH script that manages creating, timestamp-ing, and opening your journal with a cursor in a convenient location, ready to go.
- When you run
journal-down
for the first time it will create a file for you in your iCloud storage like this:/JournalDown/2017/09/2017-09-10.md
- JournalDown will add a header to the file with the current date, and day of the week like:
# September 10th, 2017 - Monday
- Additionally, JournalDown will create a subheading with the current time like:
## 08:44 PM
- MacDown will open with the current file and your cursor on a new line ready to type.
- Simply
⌘-Q
out of MacDown when you're finished. - Come back and start writing again by running
journal-down
and MacDown will open today's journal, add newlines, create a timestamp subheading, and your cursor will be ready to write.
Simple, easy, Markdown journaling.
That is JournalDown.
- macOS
- MacDown, the Open Source Markdown editor for macOS (https://macdown.uranusjr.com).
- iCloud Storage with a default setup.
Be sure you've installed MacDown.
Copy the journal-down
file to an accessible location like your home directory.
Make sure the file is executable with: chmod +x journal-down
.
Run journal-down
to start journaling like this:
./journal-down
For help using journal-down
you can use the -h
flag like:
~/journal-down -h
This is JournalDown.
Requires:
MacDown - The open source Markdown editor for macOS.
https://macdown.uranusjr.com
...or with Homebrew Cask: brew cask install macdown
Default iCloud Storage configuration.
Usage:
journal-down Open journal file for today with a new timestamp.
journal-down -h Display this help message.
journal-down -o Open journal for today.
journal-down -r <YYYY-MM-DD> Open a journal for a given valid date like: 2017-09-10.
This was a pretty fun project that I have a feeling I'll be re-visiting quite a bit. Originally, I wrote this as a PHP script since that's the language I'm most comfortable in.
While the PHP script did the job, it had two problems:
- PHP was a dependency. I wanted something that was dead easy to get running on a Mac with MacDown installed.
- It was verbose.
I knew that BASH would be a better choice from the get-go, so I went ahead and decided to dust off the ol' BASH-hacking skills. Unfortunately, I couldn't find them anywhere in the noggin so I checked up on some of the current best practices, and leaned on a few people in #bash
on Freenode to come up with what we've got here.
There's probably some ways I could improve things, so please feel free to open some issues or throw some pull requests in there.
Copyright (c) 2017 David Drake
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
David Drake