Skip to content

Commit d67975c

Browse files
committed
修改了genepub.sh
在根目录添加了一个目录链接images 修改了genepub.sh,取消了一些东西
1 parent bcaf5c6 commit d67975c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

ebook/genepub.sh

100644100755
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@ if ! which pandoc >/dev/null ;then
33
echo "请先安装pandoc,然后再次运行"
44
exit 0
55
fi
6-
[ -f build-web-application-with-golang ] || go build
7-
[ -d html ] || mkdir html
8-
pushd html >/dev/null; cp ../*.md .
6+
97
sed -i 's!https://github.com/astaxie/build-web-application-with-golang/blob/master/!!g' README.md
108
for 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 #删除页面链接
1715
done
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 `"
2017
cat > metadata.txt <<EOF
2118
<dc:creator>Astaxie</dc:creator>
2219
<dc:description>一本开源的Go Web编程书籍</dc:description>
@@ -27,6 +24,6 @@ EOF
2724

2825
pandoc --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+
3128
rm -rf html
3229
echo "build-web-application-with-golang.epub 已经建立"

images

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ebook/images/

0 commit comments

Comments
 (0)