#!/bin/bash # This script takes the DocBook of the Koha manual and turns it into # files in the ePub and mobi formats. The mobi file is targeted at # the Kindle ebook reader. # ### Prerequisites # # dbtoepub - For converting from DocBook to ePub # # ebook-convert - For converting from ePub to mobi. This program # is part of the calibre ebook software. Unfortunately, it does not # seem to be possible to install just ebook-convert, without all the # graphical components of the full calibre software. A full install # on a Debian server would be ~211MB... # ### Installing the prerequsites on Debian # # sudo apt-get install dbtoepub calibre # ### Getting the manual in DocBook format # # git clone git://git.koha-community.org/kohadocs.git # # The repository must be kept up to date independently of this script # by running "git pull" on it. Please adjust $docbook below to reflect # the location of your own cloned repository. # ### Disclaimer # # This is experimental work in progress. You load the provided files # on your favourite device at your own risk! # ### TODO # # - Make this script keep the cloned repository up to date echo "Converting Koha manual from DocBook to ePub and mobi" docbook="/home/magnus/scripts/kohadocs/en/manual.xml" epub='manual.epub' mobi='manual.mobi' echo "DocBook -> ePub ..." dbtoepub -o $epub $docbook echo "done!" echo "ePub -> mobi ..." # Docs: # http://manual.calibre-ebook.com/cli/ebook-convert.html # http://manual.calibre-ebook.com/conversion.html ebook-convert $epub $mobi \ --output-profile=kindle \ --language=en echo "done!"