<commit_before>#!/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
<commit_msg>update genepub.sh<commit_after>#!/bin/sh
if [ ! -f build-web-application-with-golang ];then
	go build
fi

if [ ! -d html ];then
	mkdir html 
fi
cd html
cp ../*.md .
for i in *.md;do
	#重新格式化md文件
	sed -i  '/^[#]\{1,\}/s!^\([#]\{1,\}\)\([^#]\{1,\}\)!\1 \2!' $i
	sed -i  '/^[#]\{1,\}/s!  ! !' $i
	#处理md文件中的image src属性
	sed -i  '/!\[\](images/s#images\(.*\)?raw=true#../Images\1#' $i

done
../build-web-application-with-golang >/dev/null
rm *.md
echo "文件已经就绪，请使用sigil导入html目录中的html文件和images目录中的图片文件，制作epub"

{'fraction_non_alphanumeric': 0.29439252336448596, 'fraction_numerical': 0.015186915887850467, 'mean_word_length': 2.825892857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1392572', 'n_tokens_mistral': 445, 'n_tokens_neox': 418, 'n_words': 83}