On my another posting about Everyday Text File and emacs LISP Customization, I made a fast way to make a text file every day for diary. Also, there was a way to find information from diaries. However, sometimes, I want to see yesterday’s diary, and previous/next day’s diary of current diary file. To make this, I wrote a bash script and LISP functions.

M-x prevfile takes current buffer name, which is the file name, and open previous file in the diary directory. I set short cuts using global-set-key.
Ctrl+Shift+PageUp opens previous day’s diary
Ctrl+Shift+PageDown opens next day’s diary
and in my case, Ctrl+PageUp/PageDown opens previous/next buffer in emacs.

Recently, I started to use Markdown format as a personal memo format. This is by far the one I was looking for. I always wanted a text format that can be easily formatted as HTML, at the same time, it should be easy to write, and text file itself should be readable. Markdown has all that features and it is already widely being used.
I was thinking about using wiki format. There is local wiki editor and viewer called Zim Desktop Wiki. Emacs also has wiki mode. However, sharing with other devices was painful.

About Markdown

Markdown is developed in 2004 by John Gruber “to write using an easy-to-read, easy-to-write plain text format, and optionally convert it to structurally valid XHTML”

Rules

Benefit in the local memo file with emacs

To write everyday activities, I was using text files that are everyday generated by emacs (link). It was good, but to share it, I had to copy it to evernote or something.
By using emacs’ Markdown mode, I can see the text with little bit of formatting using color and bold. Also, it gives fast way to insert Markdown formatting keywords.
Now all my text file extension is .md and emacs generates it automatically.

Benefit in mobile sharing with dropbox

When I put the diary directory’s link to dropbox sync directory, the files are automatically synchronized as soon as I edit them.
There is an Android app called “Draft“. It supports Dropbox synchronization for Text and Markdown format. Also it shows formatted Markdown. Of course, it has editing feature.
As a result, when I add or edit a text in the Android Draft app, it is synchronized to my laptop’s diary directory. Now, I do not need evernote. “Draft” looks like this :

Benefit with github

github uses Markdown as readme and all kind of text file. So, if I write my local file using markdown, it can be directly used as github text.

Benefit with wordpress

wordpress supports Markdown. This posting and previous posting was written using Markdown. It is much faster than typing html tag for making list and table. Also, my Markdown memo can be directly posted as a wordpress posting.

Chrome Extension

There is a Markdown Preview Plus chrome extension. If the markdown file is opened by chrome using “file:///home/hosung/diary/diary2015_02_08.md” or drag-drop, it shows generated HTML on the page using CSS for github style or other style. Optionally, the page can reload changed file every 1+ seconds.

Emacs Integration

I wrote a simple LISP script to add into .emacs file. By using it, currently editing file can be quickly opened in chrome by typing M-x chrome or Ctrl-Shift-c.