From c3abc9b6c7563c4d49263912f442d392a6091902 Mon Sep 17 00:00:00 2001 From: yetist Date: Sat, 27 Oct 2012 14:19:49 +0800 Subject: [PATCH] add script for gen epub --- genepub.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 genepub.sh diff --git a/genepub.sh b/genepub.sh new file mode 100755 index 00000000..a21a0f81 --- /dev/null +++ b/genepub.sh @@ -0,0 +1,17 @@ +#!/bin/sh +if [ ! -f build-web-application-with-golang ];then + go build +fi + +if [ ! -d tmp ];then + mkdir tmp +fi +cd tmp +cp ../*.md . +for i in *.md;do + sed -i '/^[#]\{1,\}/s!^\([#]\{1,\}\)\([^#]\{1,\}\)!\1 \2!' $i + sed -i '/!\[\](images/s#images\(.*\)?raw=true#../Images\1#' $i + +done +../build-web-application-with-golang +rm *.md