diff options
Diffstat (limited to 'format.sh')
-rwxr-xr-x | format.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/format.sh b/format.sh new file mode 100755 index 0000000..609fc36 --- /dev/null +++ b/format.sh @@ -0,0 +1,14 @@ +#!/bin/bash +#find all text files (chapters), but nothing staring with an underscore +for y in `ls *.txt | grep -v _.*`; +do + #first kill all the blank lines + perl -p -e 's/^\n//g' $y > temp; + #now add a tab so paragraphs are indented + perl -pi -e 's/^/\n\t/g' temp; + #finally, respect the section breaks within chapters + perl -pi -e 's/-----/\n\n\n\n/g' temp; mv temp book/$y; + #a2x -f chunked -d book book/book.asc --verbose + #a2x -f pdf --fop -d book book/book.asc --verbose + #git scribe gen [site|html|pdf|epub|mobi|all] +done |