#!/bin/sh
# Author:
# Juhapekka Tolvanen
# http://iki.fi/juhtolv
# juhtolv (at) iki (dot) fi
# this script is public domain
# there is no warranty
if test -f ./shellconfigs.rc.sh
then
. ./shellconfigs.rc.sh
else
echo "Could not include ./shellconfigs.rc.sh from working firectory." >&2
exit 1
fi
echo 'FORMATSLEVEL = '"$FORMATSLEVEL"
sleep 1
### (X)HTML
### http://en.wikipedia.org/wiki/HTML
### http://en.wikipedia.org/wiki/XHTML
rm -fv ${DOCSBASENAME}.html
rst2html --language=${TWOLETTERLANG} --report=5 --toc-entry-backlinks \
--footnote-backlinks --section-numbering --strip-comments \
${DOCSBASENAME}.txt ${DOCSBASENAME}.html
if test $FORMATSLEVEL -le 1
then
echo "Only formats of level 1 were made."
exit 0
fi
### LaTeX
### portrait
### 12 pt
rm -fv ${DOCSBASENAME}.12pt.aux ${DOCSBASENAME}.12pt.bbl ${DOCSBASENAME}.12pt.blg \
${DOCSBASENAME}.12pt.brf ${DOCSBASENAME}.12pt.tmp ${DOCSBASENAME}.12pt.log \
${DOCSBASENAME}.12pt.toc ${DOCSBASENAME}.12pt.lot ${DOCSBASENAME}.12pt.out \
${DOCSBASENAME}.12pt.tex ${DOCSBASENAME}.12pt.pdf ${DOCSBASENAME}.12pt.ps \
${DOCSBASENAME}.12pt.fls
### http://en.wikipedia.org/wiki/ReStructuredText
### http://docutils.sourceforge.net/
### http://docutils.sourceforge.net/rst.html
rst2xetex \
--config=./docutils.12pt.conf --stylesheet=RST_Palatino_OpenSans_12pt \
--language=${TWOLETTERLANG} --report=5 --toc-entry-backlinks \
--no-section-numbering --strip-comments \
--use-verbatim-when-possible \
--hyperlink-color=false \
--compound-enumerators --section-prefix-for-enumerators --section-subtitles \
${DOCSBASENAME}.txt \
${DOCSBASENAME}.12pt.tex
### http://en.wikipedia.org/wiki/XeTeX
${MYXELATEXCMD} ${DOCSBASENAME}.12pt.tex
while grep 'Rerun to get' ${DOCSBASENAME}.12pt.log > /dev/null
do
${MYXELATEXCMD} ${DOCSBASENAME}.12pt.tex
done
${MYXELATEXCMD} ${DOCSBASENAME}.12pt.tex
### You may need to comment these away during debugging:
rm -fv ${DOCSBASENAME}.12pt.aux ${DOCSBASENAME}.12pt.bbl ${DOCSBASENAME}.12pt.blg \
${DOCSBASENAME}.12pt.brf ${DOCSBASENAME}.12pt.tmp ${DOCSBASENAME}.12pt.log \
${DOCSBASENAME}.12pt.toc ${DOCSBASENAME}.12pt.lot ${DOCSBASENAME}.12pt.out \
${DOCSBASENAME}.12pt.fls
### http://en.wikipedia.org/wiki/Portable_Document_Format
### http://en.wikipedia.org/wiki/Poppler_%28software%29
### http://poppler.freedesktop.org/
### http://en.wikipedia.org/wiki/PostScript
pdftops -level2 -paper A4 -expand ${DOCSBASENAME}.12pt.pdf
if test $FORMATSLEVEL -le 2
then
echo "Only formats of level 2 were made."
exit 0
fi
### LaTeX
### portrait and twoside
### 12 pt
rm -fv ${DOCSBASENAME}.twoside.12pt.aux ${DOCSBASENAME}.twoside.12pt.bbl ${DOCSBASENAME}.twoside.12pt.blg \
${DOCSBASENAME}.twoside.12pt.brf ${DOCSBASENAME}.twoside.12pt.tmp ${DOCSBASENAME}.twoside.12pt.log \
${DOCSBASENAME}.twoside.12pt.toc ${DOCSBASENAME}.twoside.12pt.lot ${DOCSBASENAME}.twoside.12pt.out \
${DOCSBASENAME}.twoside.12pt.tex ${DOCSBASENAME}.twoside.12pt.pdf ${DOCSBASENAME}.twoside.12pt.ps \
${DOCSBASENAME}.twoside.12pt.fls
rst2xetex \
--config=./docutils.twoside.12pt.conf --stylesheet=RST_Palatino_OpenSans_12pt \
--language=${TWOLETTERLANG} --report=5 --toc-entry-backlinks \
--no-section-numbering --strip-comments \
--use-verbatim-when-possible \
--hyperlink-color=false \
--compound-enumerators --section-prefix-for-enumerators --section-subtitles \
${DOCSBASENAME}.txt \
${DOCSBASENAME}.twoside.12pt.tex
${MYXELATEXCMD} ${DOCSBASENAME}.twoside.12pt.tex
while grep 'Rerun to get' ${DOCSBASENAME}.twoside.12pt.log > /dev/null
do
${MYXELATEXCMD} ${DOCSBASENAME}.twoside.12pt.tex
done
${MYXELATEXCMD} ${DOCSBASENAME}.twoside.12pt.tex
### You may need to comment these away during debugging:
rm -fv ${DOCSBASENAME}.twoside.12pt.aux ${DOCSBASENAME}.twoside.12pt.bbl ${DOCSBASENAME}.twoside.12pt.blg \
${DOCSBASENAME}.twoside.12pt.brf ${DOCSBASENAME}.twoside.12pt.tmp ${DOCSBASENAME}.twoside.12pt.log \
${DOCSBASENAME}.twoside.12pt.toc ${DOCSBASENAME}.twoside.12pt.lot ${DOCSBASENAME}.twoside.12pt.out \
${DOCSBASENAME}.twoside.12pt.fls
pdftops -level2 -paper A4 -expand ${DOCSBASENAME}.twoside.12pt.pdf
if test $FORMATSLEVEL -le 3
then
echo "Only formats of level 3 were made."
exit 0
fi
### LaTeX
### portrait
### 10 pt
### LaTeX http://en.wikipedia.org/wiki/LaTeX
### portrait http://en.wikipedia.org/wiki/Page_orientation
rm -fv ${DOCSBASENAME}.aux ${DOCSBASENAME}.bbl ${DOCSBASENAME}.blg \
${DOCSBASENAME}.brf ${DOCSBASENAME}.tmp ${DOCSBASENAME}.log \
${DOCSBASENAME}.toc ${DOCSBASENAME}.lot ${DOCSBASENAME}.out \
${DOCSBASENAME}.tex ${DOCSBASENAME}.pdf ${DOCSBASENAME}.ps \
${DOCSBASENAME}.fls
### http://en.wikipedia.org/wiki/ReStructuredText
### http://docutils.sourceforge.net/
### http://docutils.sourceforge.net/rst.html
rst2xetex \
--stylesheet=RST_Palatino_OpenSans \
--language=${TWOLETTERLANG} --report=5 --toc-entry-backlinks \
--no-section-numbering --strip-comments \
--use-verbatim-when-possible \
--hyperlink-color=false \
--compound-enumerators --section-prefix-for-enumerators --section-subtitles \
${DOCSBASENAME}.txt \
${DOCSBASENAME}.tex
### http://en.wikipedia.org/wiki/XeTeX
${MYXELATEXCMD} ${DOCSBASENAME}.tex
while grep 'Rerun to get' ${DOCSBASENAME}.log > /dev/null
do
${MYXELATEXCMD} ${DOCSBASENAME}.tex
done
${MYXELATEXCMD} ${DOCSBASENAME}.tex
### You may need to comment these away during debugging:
rm -fv ${DOCSBASENAME}.aux ${DOCSBASENAME}.bbl ${DOCSBASENAME}.blg \
${DOCSBASENAME}.brf ${DOCSBASENAME}.tmp ${DOCSBASENAME}.log \
${DOCSBASENAME}.toc ${DOCSBASENAME}.lot ${DOCSBASENAME}.out \
${DOCSBASENAME}.fls
### http://en.wikipedia.org/wiki/Portable_Document_Format
### http://en.wikipedia.org/wiki/Poppler_%28software%29
### http://poppler.freedesktop.org/
### http://en.wikipedia.org/wiki/PostScript
pdftops -level2 -paper A4 -expand ${DOCSBASENAME}.pdf
### LaTeX
### 10 pt
### portrait and twoside
rm -fv ${DOCSBASENAME}.twoside.aux ${DOCSBASENAME}.twoside.bbl ${DOCSBASENAME}.twoside.blg \
${DOCSBASENAME}.twoside.brf ${DOCSBASENAME}.twoside.tmp ${DOCSBASENAME}.twoside.log \
${DOCSBASENAME}.twoside.toc ${DOCSBASENAME}.twoside.lot ${DOCSBASENAME}.twoside.out \
${DOCSBASENAME}.twoside.tex ${DOCSBASENAME}.twoside.pdf ${DOCSBASENAME}.twoside.ps \
${DOCSBASENAME}.twoside.fls
rst2xetex \
--config=./docutils.twoside.conf --stylesheet=RST_Palatino_OpenSans \
--language=${TWOLETTERLANG} --report=5 --toc-entry-backlinks \
--no-section-numbering --strip-comments \
--use-verbatim-when-possible \
--hyperlink-color=false \
--compound-enumerators --section-prefix-for-enumerators --section-subtitles \
${DOCSBASENAME}.txt \
${DOCSBASENAME}.twoside.tex
${MYXELATEXCMD} ${DOCSBASENAME}.twoside.tex
while grep 'Rerun to get' ${DOCSBASENAME}.twoside.log > /dev/null
do
${MYXELATEXCMD} ${DOCSBASENAME}.twoside.tex
done
${MYXELATEXCMD} ${DOCSBASENAME}.twoside.tex
### You may need to comment these away during debugging:
rm -fv ${DOCSBASENAME}.twoside.aux ${DOCSBASENAME}.twoside.bbl ${DOCSBASENAME}.twoside.blg \
${DOCSBASENAME}.twoside.brf ${DOCSBASENAME}.twoside.tmp ${DOCSBASENAME}.twoside.log \
${DOCSBASENAME}.twoside.toc ${DOCSBASENAME}.twoside.lot ${DOCSBASENAME}.twoside.out \
${DOCSBASENAME}.twoside.fls
pdftops -level2 -paper A4 -expand ${DOCSBASENAME}.twoside.pdf
### LaTeX
### landscape
rm -fv ${DOCSBASENAME}.landscape.aux ${DOCSBASENAME}.landscape.bbl ${DOCSBASENAME}.landscape.blg \
${DOCSBASENAME}.landscape.brf ${DOCSBASENAME}.landscape.tmp ${DOCSBASENAME}.landscape.log \
${DOCSBASENAME}.landscape.toc ${DOCSBASENAME}.landscape.lot ${DOCSBASENAME}.landscape.out \
${DOCSBASENAME}.landscape.tex ${DOCSBASENAME}.landscape.pdf ${DOCSBASENAME}.landscape.ps \
${DOCSBASENAME}.landscape.fls
rst2xetex \
--config=./docutils.landscape.conf --stylesheet=RST_landscape \
--language=${TWOLETTERLANG} --report=5 --toc-entry-backlinks \
--no-section-numbering --strip-comments \
--use-verbatim-when-possible \
--compound-enumerators --section-prefix-for-enumerators --section-subtitles \
${DOCSBASENAME}.txt \
${DOCSBASENAME}.landscape.tex
${MYXELATEXCMD} ${DOCSBASENAME}.landscape.tex
while grep 'Rerun to get' ${DOCSBASENAME}.landscape.log > /dev/null
do
${MYXELATEXCMD} ${DOCSBASENAME}.landscape.tex
done
${MYXELATEXCMD} ${DOCSBASENAME}.landscape.tex
### You may need to comment these away during debugging:
rm -fv ${DOCSBASENAME}.landscape.aux ${DOCSBASENAME}.landscape.bbl ${DOCSBASENAME}.landscape.blg \
${DOCSBASENAME}.landscape.brf ${DOCSBASENAME}.landscape.tmp ${DOCSBASENAME}.landscape.log \
${DOCSBASENAME}.landscape.toc ${DOCSBASENAME}.landscape.lot ${DOCSBASENAME}.landscape.out \
${DOCSBASENAME}.landscape.fls
pdftops -level2 -paper A4 -expand ${DOCSBASENAME}.landscape.pdf
### LaTeX
### woodeneye
rm -fv ${DOCSBASENAME}.woodeneye.aux ${DOCSBASENAME}.woodeneye.bbl ${DOCSBASENAME}.woodeneye.blg \
${DOCSBASENAME}.woodeneye.brf ${DOCSBASENAME}.woodeneye.tmp ${DOCSBASENAME}.woodeneye.log \
${DOCSBASENAME}.woodeneye.toc ${DOCSBASENAME}.woodeneye.lot ${DOCSBASENAME}.woodeneye.out \
${DOCSBASENAME}.woodeneye.tex ${DOCSBASENAME}.woodeneye.pdf ${DOCSBASENAME}.woodeneye.ps \
${DOCSBASENAME}.woodeneye.fls
rst2xetex \
--config=./docutils.woodeneye.conf --stylesheet=RST_woodeneye \
--language=${TWOLETTERLANG} --report=5 --toc-entry-backlinks \
--no-section-numbering --strip-comments \
--use-verbatim-when-possible \
--compound-enumerators --section-prefix-for-enumerators --section-subtitles \
${DOCSBASENAME}.txt \
${DOCSBASENAME}.woodeneye.tex
${MYXELATEXCMD} ${DOCSBASENAME}.woodeneye.tex
while grep 'Rerun to get' ${DOCSBASENAME}.woodeneye.log > /dev/null
do
${MYXELATEXCMD} ${DOCSBASENAME}.woodeneye.tex
done
${MYXELATEXCMD} ${DOCSBASENAME}.woodeneye.tex
### You may need to comment these away during debugging:
rm -fv ${DOCSBASENAME}.woodeneye.aux ${DOCSBASENAME}.woodeneye.bbl ${DOCSBASENAME}.woodeneye.blg \
${DOCSBASENAME}.woodeneye.brf ${DOCSBASENAME}.woodeneye.tmp ${DOCSBASENAME}.woodeneye.log \
${DOCSBASENAME}.woodeneye.toc ${DOCSBASENAME}.woodeneye.lot ${DOCSBASENAME}.woodeneye.out \
${DOCSBASENAME}.woodeneye.fls
pdftops -level2 -paper A4 -expand ${DOCSBASENAME}.woodeneye.pdf
if test $FORMATSLEVEL -le 4
then
echo "Only formats of level 4 were made."
exit 0
fi
### http://johnmacfarlane.net/pandoc/
### Plain text http://en.wikipedia.org/wiki/Plain_text
rm -fv ${DOCSBASENAME}.plain.txt
pandoc --toc -f rst -t plain -s -o ${DOCSBASENAME}.plain.txt ${DOCSBASENAME}.txt
### To be used in very narrow windows, for example in Nintendo DS Lite
### and its homebrew software called Moonshell.
### http://en.wikipedia.org/wiki/MoonShell
rm -fv ${DOCSBASENAME}.plain40.txt
pandoc --columns=39 --toc -f rst -t plain -s -o ${DOCSBASENAME}.plain40.txt ${DOCSBASENAME}.txt
### DocBook XML
### http://en.wikipedia.org/wiki/DocBook
### http://en.wikipedia.org/wiki/XML
rm -fv ${DOCSBASENAME}.xml
pandoc -f rst -t docbook -s ${DOCSBASENAME}.txt \
> ${DOCSBASENAME}.xml
### pandoc:in versiossa 1.6 oli tällainen bugi:
### http://bugs.debian.org/611328
### Se korjattiin versiossa 1.8 (2011–01–30):
### http://johnmacfarlane.net/pandoc/releases.html
### ”Skip blank lines at beginning of file. Resolves Debian #611328.”
### Mutta jos pandoc on tuolla lailla buginen, voidaan se bugi kiertää
### jättämällä dokumentin alusta tyhjät rivit veks.
# | sed 's/\#*//g' \
# | sed 's/
<\/title>/Läsnäolon voima -kirjan harjoitukset<\/title>/' \
# > ${DOCSBASENAME}.xml
### The most common eBook-formats:
### EPUB http://en.wikipedia.org/wiki/EPUB
### http://fedorahosted.org/publican/
### VIAT: Teksti usein liian kiinni lihavoidun tekstin perässä.
#rm -fv ${DOCSBASENAME}.epub
#cp -fv ${DOCSBASENAME}.xml publican/fi/${DOCSBASENAME}.xml
#cd publican/fi/
#tidy -m -xml -utf8 ${DOCSBASENAME}.xml
#cd ..
#publican clean
#publican clean_ids
###rm -fv ../publican_errors.txt
###publican build --langs=fi --formats=test --nocolours 2> ../publican_errors.txt
###publican build --langs=fi --formats=test
#publican build --langs=fi --formats=epub
#cp -fv tmp/fi/harjoitukset-0-harjoitukset-fi.epub ../${DOCSBASENAME}.epub
#publican clean
#publican clean_ids
#cd ..
### https://fedorahosted.org/xmlto/
#rm -fv ${DOCSBASENAME}.epub
#xmlto -vv epub ${DOCSBASENAME}.xml
### http://docbook.sourceforge.net/release/xsl/current/epub/README
#rm -fv ${DOCSBASENAME}.epub
#dbtoepub -o ${DOCSBASENAME}.epub ${DOCSBASENAME}.xml
rm -fv ${DOCSBASENAME}.epub
pandoc --toc -f rst -t epub -s -o ${DOCSBASENAME}.epub ${DOCSBASENAME}.txt
# NOTE! You must have very new version of pandoc or this command will
# fail and you can not run all subsequent commands:
rm -fv ${DOCSBASENAME}.epub3.epub
pandoc --toc -f rst -t epub3 -s -o ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.txt
### http://en.wikipedia.org/wiki/Calibre_%28software%29
### MOBI (.mobi , .prc or .azw) http://en.wikipedia.org/wiki/Mobipocket
rm -fv ${DOCSBASENAME}.mobi
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.mobi -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG} --toc-title "${TOCTITLE}"
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.mobi -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG} --toc-title "${TOCTITLE}"
### KF8 http://en.wikipedia.org/wiki/Kindle_Format_8 (?)
rm -fv ${DOCSBASENAME}.azw3
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.azw3 -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG} --toc-title "${TOCTITLE}"
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.azw3 -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG} --toc-title "${TOCTITLE}"
if test $FORMATSLEVEL -le 5
then
echo "Only formats of level 5 were made."
exit 0
fi
### DjVU http://en.wikipedia.org/wiki/DjVu
### http://code.google.com/p/pdf2djvu/
rm -fv ${DOCSBASENAME}.djvu
pdf2djvu ${DJVUOPTS} -o ${DOCSBASENAME}.djvu ${DOCSBASENAME}.pdf
rm -fv ${DOCSBASENAME}.12pt.djvu
pdf2djvu ${DJVUOPTS} -o ${DOCSBASENAME}.12pt.djvu ${DOCSBASENAME}.12pt.pdf
rm -fv ${DOCSBASENAME}.twoside.djvu
pdf2djvu ${DJVUOPTS} -o ${DOCSBASENAME}.twoside.djvu ${DOCSBASENAME}.twoside.pdf
rm -fv ${DOCSBASENAME}.twoside.12pt.djvu
pdf2djvu ${DJVUOPTS} -o ${DOCSBASENAME}.twoside.12pt.djvu ${DOCSBASENAME}.twoside.12pt.pdf
rm -fv ${DOCSBASENAME}.landscape.djvu
pdf2djvu ${DJVUOPTS} -o ${DOCSBASENAME}.landscape.djvu ${DOCSBASENAME}.landscape.pdf
rm -fv ${DOCSBASENAME}.woodeneye.djvu
pdf2djvu ${DJVUOPTS} -o ${DOCSBASENAME}.woodeneye.djvu ${DOCSBASENAME}.woodeneye.pdf
if test $FORMATSLEVEL -le 6
then
echo "Only formats of level 6 were made."
exit 0
fi
### ODT http://en.wikipedia.org/wiki/OpenDocument
### VIAT: Sisällysluettelo puuttuu täysin. Kieli on muka
### amerikanenglanti
#rm -fv ${DOCSBASENAME}.odt
### http://johnmacfarlane.net/pandoc/
#pandoc --toc -f rst -t odt -s -o ${DOCSBASENAME}.odt ${DOCSBASENAME}.txt
### VIAT: Sisällysluettelo mukana, mutta sen sivunumerot pitäisi
### päivittää käsin OpenOffice.org:issa
### Dokumentin kieli on muka amerikanenglanti.
rm -fv ${DOCSBASENAME}.odt
rst2odt --generator --date --time --toc-entry-backlinks \
--footnote-backlinks --section-numbering --strip-comments \
--language=${TWOLETTERLANG} \
--title="${DOCTITLE}" \
${DOCSBASENAME}.txt ${DOCSBASENAME}.odt
### DOCX http://en.wikipedia.org/wiki/Office_Open_XML
rm -fv ${DOCSBASENAME}.docx
pandoc --toc -f rst -t docx -s -o ${DOCSBASENAME}.docx ${DOCSBASENAME}.txt
### RTF http://en.wikipedia.org/wiki/Rich_Text_Format
### VIAT: Sisällysluettelo puuttuu täysin.
rm -fv ${DOCSBASENAME}.rtf
pandoc --toc -f rst -t rtf -s -o ${DOCSBASENAME}.rtf ${DOCSBASENAME}.txt
if test $FORMATSLEVEL -le 7
then
echo "Only formats of level 7 were made."
exit 0
fi
### Formats of Unix-people:
### man http://en.wikipedia.org/wiki/Man_page
rm -fv ${DOCSBASENAME}.man
rst2man --title="$DOCSBASENAME" -g -d -t --report=5 --strip-comments ${DOCSBASENAME}.txt ${DOCSBASENAME}.man
### texinfo http://en.wikipedia.org/wiki/Texinfo
rm -fv ${DOCSBASENAME}.texi
pandoc -f rst -t texinfo -s -o ${DOCSBASENAME}.texi ${DOCSBASENAME}.txt
### info http://en.wikipedia.org/wiki/Info_%28Unix%29
rm -fv ${DOCSBASENAME}.info
makeinfo -v --number-sections --no-split --enable-encoding ${DOCSBASENAME}.texi
if test $FORMATSLEVEL -le 8
then
echo "Only formats of level 8 were made."
exit 0
fi
### Exotic ebook-formats:
### FB2 http://en.wikipedia.org/wiki/FictionBook
rm -fv ${DOCSBASENAME}.fb2
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.fb2 -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.fb2 -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### HTMLZ
### http://www.fileinfo.com/extension/htmlz
### http://www.file-extensions.org/htmlz-file-extension
rm -fv ${DOCSBASENAME}.htmlz
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.htmlz -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.htmlz -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### LIT http://en.wikipedia.org/wiki/Microsoft_Reader
rm -fv ${DOCSBASENAME}.lit
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.lit -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.lit -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### LRF http://en.wikipedia.org/wiki/BBeB
rm -fv ${DOCSBASENAME}.lrf
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.lrf -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.lrf -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### VERY OLD AND OBSOLETE FORMATS:
### PDB (and PML ?) http://en.wikipedia.org/wiki/PDB_%28Palm_OS%29
rm -fv ${DOCSBASENAME}.pdb
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.pdb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.pdb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### Calibre uses file-extension .pdb
#rm -fv ${DOCSBASENAME}.pml
#echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.pml -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
#ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.pml -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### TCR http://en.wikipedia.org/wiki/TCR
# Text Compression for Reader (.tcr), a compressed text file format
# used by Psion e-book reader software
rm -fv ${DOCSBASENAME}.tcr
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.tcr -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.tcr -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### RB (RocketBook or RocketEdition)
# http://filext.com/file-extension/RB
rm -fv ${DOCSBASENAME}.rb
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.rb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.rb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### SNB (Shanda Bambook eBook file)
# http://www.file-extensions.org/snb-file-extension
rm -fv ${DOCSBASENAME}.snb
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.snb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.snb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### TXTZ
rm -fv ${DOCSBASENAME}.txtz
echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.txtz -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.txtz -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
if test $FORMATSLEVEL -le 9
then
#echo "Only formats of level 9 were made."
echo "Formats of level 9 were made."
exit 0
fi
### Other formats:
### http://manual.calibre-ebook.com/faq.html#what-formats-does-app-support-conversion-to-from
### PML
### ”Output Formats: AZW3, EPUB, FB2, OEB, LIT, LRF, MOBI, HTMLZ, PDB,
### PML, RB, PDF, RTF, SNB, TCR, TXT, TXTZ”
### ”Note:
### PRC is a generic format, calibre supports PRC files with TextRead
### and MOBIBook headers. PDB is also a generic format. calibre
### supports eReder, Plucker, PML and zTxt PDB files. DJVU support is
### only for converting DJVU files that contain embedded text. These
### are typically generated by OCR software. MOBI books can be of two
### types Mobi6 and KF8. calibre fully supports both. MOBI files often
### have .azw or .azw3 file extensions”
### BUG: Creates a directory called juhtolv_tolle_harjoitukset.oeb
### OEB (.opf) http://en.wikipedia.org/wiki/Open_eBook
### Superseded by EPUB
#rm -fv ${DOCSBASENAME}.oeb
#echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.oeb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
#ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.oeb -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
### Calibre uses file-extension .oeb
#rm -fv ${DOCSBASENAME}.opf
#echo ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.opf -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
#ebook-convert ${DOCSBASENAME}.epub3.epub ${DOCSBASENAME}.opf -vv --authors "${DOCAUTHOR}" --pretty-print --base-font-size 12 --font-size-mapping 10,12,14,16,18,20,22,24 --insert-blank-line --language ${TWOLETTERLANG}
# Next to be added:
# (none)
# Wanted formats:
# - IMP
# - CHM http://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help
# xmlto can convert DocBook-XML to CHM, but it only creates a bunch of
# HTML-files and they must be compiled to final CHM file with some
# other software.
# Maybe this software could compile all those files to CHM-file:
# http://savannah.nongnu.org/projects/hhm