add htmlize package to color the code block
[blog.git] / Makefile
1 ## Makefile to export org in blog file to html
2
3 emacs ?= emacs
4 OUTDIR := 
5 FORCE := "no"
6 BLOGDIR := $(PWD)
7
8 # To color the code block, install htmlize package
9 INIT_PACKAGES = "(progn \
10                                 (require 'package) \
11                                 (add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\")) \
12                                 (package-initialize) \
13                                 (unless (package-installed-p 'htmlize) (package-refresh-contents) (package-install 'htmlize)))"
14
15 all:
16         $(emacs) -Q --script blog.el $(OUTDIR) $(FORCE)
17
18 # used for automation on server
19 update:
20         git pull && $(emacs) -Q --script blog.el "~/www/html" "true" 
21
22 publish:
23         $(emacs) -Q --batch -l my-publish.el index.org \
24                 --eval $(INIT_PACKAGES) \
25                 --eval '(setq debug-on-error t)' \
26                 --eval '(blog-setup-project-alist "$(BLOGDIR)" "$(OUTDIR)")' \
27                 --eval '(org-publish-current-project)'
28
29 # test will force publishing all files in the porject 
30 test:
31         $(emacs) -Q --batch -l my-publish.el index.org \
32                 --eval $(INIT_PACKAGES) \
33                 --eval '(setq debug-on-error t)' \
34                 --eval '(blog-setup-project-alist "$(BLOGDIR)")' \
35                 --eval '(org-publish-current-project t)'
36
37 clean:
38         rm -rf _site/*