calibre recipes for kindle paperwhite
calibre
is a free and open source e-book library management application. It provides BasicNewsRecipe for writing recipies and can scrapy news or htmls from internet and convert them to e-books. You can checkout API Document and sourcecode of BasicNewsRecipe for more details. While you still need to know the BeautifulSoup to parse html/xml and handle the Tag and NavigableString object.
Avoiding to install calibre
from source, check linux install for more details.
Debian/Ubuntu:
apt-get install calibre
RedHat/Fedora/CentOS:
yum -y install calibre
When you write your own calibre recipe, you need to override parse_index
method, and the return structure of this method likes :
Element, Type; Sub-Element, Sub-Type, Sub-Element, Sub-Type
- Book, List; Volumn, Tuple
- Volumn, Tuple; VolumnTitle, String, Chapters, List
- Chapters, List; Chapter, Map
- Chapter, Map; ChapterTitle,String, ChapterUrl, String
ebook-convert Swift.recipe Swift.mobi
ebook-viewer Swift.mobi
or
sh autorun.py Swift.recipe