-
Notifications
You must be signed in to change notification settings - Fork 2
/
create.sh
executable file
·46 lines (36 loc) · 958 Bytes
/
create.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
readonly HTMLIZE=./docs/htmlize.el
if [[ -z $1 ]] ; then
ORG_FILES="*.org"
else
ORG_FILES=$1
fi
echo $ORG_FILES
# Download the htmlize Emacs plugin if not present
url="https://github.com/hniksic/emacs-htmlize"
repo="emacs-htmlize"
if [[ ! -f "${HTMLIZE}" ]]
then
git clone ${url} \
&& cp ${repo}/htmlize.el ${HTMLIZE} \
&& rm -rf ${repo}
fi
# Assert htmlize is installed
[[ -f ${HTMLIZE} ]] \
|| exit 1
# Convert org to HTML
if [[ -f ./docs/htmlize.el ]]
then
for org in ${ORG_FILES}
do
echo "HTMLIZE: $org"
emacs --batch --load ./docs/htmlize.el --load ./docs/config.el $org -f org-html-export-to-html
done
else
for org in ${ORG_FILES}
do
echo "CONVERT: $org"
emacs --batch --load ./docs/config.el $org -f org-html-export-to-html
done
fi
mv *.html docs/