File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3,20 +3,17 @@ if ! which pandoc >/dev/null ;then
33 echo " 请先安装pandoc,然后再次运行"
44 exit 0
55fi
6- [ -f build-web-application-with-golang ] || go build
7- [ -d html ] || mkdir html
8- pushd html > /dev/null; cp ../* .md .
6+
97sed -i ' s!https://github.com/astaxie/build-web-application-with-golang/blob/master/!!g' README.md
108for i in * .md; do
119 # 重新格式化md文件
1210 sed -i ' /^[#]\{1,\}/s!^\([#]\{1,\}\)\([^#]\{1,\}\)!\1 \2!' $i # 以#开头的行,在#后增加空格
1311 sed -i ' /^[#]\{1,\}/s! ! !' $i # 以#开头的行, 删除多余的空格
1412 # sed -i '/!\[\](images/s#images\(.*\)?raw=true#../Images\1#' $i
15- sed -i ' /!\[\](images/s#images\(.*\)?raw=true#../images\1#' $i # 处理md文件中的image src属性
13+ # sed -i '/!\[\](images/s#images\(.*\)?raw=true#../images\1#' $i #处理md文件中的image src属性
1614 sed -i ' /[#]\{2,\} links/,/[ ]\{0,\}Id\$.*/d' $i # 删除页面链接
1715done
18- ../build-web-application-with-golang > /dev/null
19- list=" README.html ` ls [0-9]* .html | sort -h` LICENSE.html"
16+ list=" ` ls [0-9]* .html | sort ` "
2017cat > metadata.txt << EOF
2118<dc:creator>Astaxie</dc:creator>
2219<dc:description>一本开源的Go Web编程书籍</dc:description>
2724
2825pandoc --reference-links -S --toc -f html -t epub --epub-metadata=metadata.txt --epub-cover-image=../images/cover.png \
2926-o ../build-web-application-with-golang.epub $list
30- popd > /dev/null
27+
3128rm -rf html
3229echo " build-web-application-with-golang.epub 已经建立"
Original file line number Diff line number Diff line change 1+ ebook/images/
You can’t perform that action at this time.
0 commit comments