Setup for A Plain Text Diary Tools
Background
Blog is a public text platform, while Diary is a private
shell, I need both. Last post I took down the settings for an
automatically post and publish blog tools, this time I also set up
an automatic diary tools on OS X or Linux. Since my working
platform changed to OS X, I hope it will also help on a Linux
environment.
Features
I define the automatic diary tools as generate and format are
automatically organized by the tools, not the contents. Therefore, it
has the features as follows:
- create a proper title for the diary file, eg. 2014-03-01.md or 01.03.2014.md or Saturday, 01. March 2014.md or even with time 2014-03-01 11:41:51.md
- insert markdown to html css color templete reference.
- joint all the markdown files together to one html file.
- convert each markdown file to a related html file.
- convert from html to pdf file, both for one whole pdf and individual pdf file.
Steps
- create an empty mardown file and open it with my editor (emacs or vim), the shell script name is
new_diary
, usage :./new_diary
, then it will generate a file with date or time as its name.
1 |
|
- joint all the markdown files to one html file, the shell script name is
md-joint
, usage :./md-joint
then input the file name for the whole one html file
1 |
|
- convert each .md file to its .html and .pdf file, I created a Makefile to handle this, all I need to do is type
make
for both html and pdf, or I can choose to generate html bymake html
or pdf bymake pdf
.
1 | # Makefile |
- publish all the pdf files as a complete pdf file with each diary on one page. This script was copied from pdfdir, I did not change any thing of the code. Usage: ./pdf-joint ../DIARY and it will create the DIARY.pdf at the same directory.
So, that’s all, I am happy to share my tools (life style) with all of you, thank you.