these grapes are sweet -- lesson #23
this thread explains how to digitize a book quickly and easily. search archive.org for "booksculture00mabiuoft" for the book. *** again, here's our z.m.l. "master", the latest version of our text:
so now we're generating e-books from this "master" .zml file. it's important to recognize that we're building all our e-books from this single text-file, minimizing our file-handling chores. in our last lesson, we created a .mobi e-book, for the kindle. today we do the code that generates material for the .epub... .epub is more complicated -- _not_ "more sophisticated", just more _complicated_ -- because we have to "chop up" the book into chunks that are no bigger than 300k, because some of the .epub viewer-programs were evidently coded by sick baboons, and can't handle any more text than 300k or they will choke... this includes the viewer-app from adobe, which incorporates d.r.m., and is often required by corporate publishing houses, so sometimes you have no option to use some other viewer... so now people all over the world have to chop up our e-books, because the coders at adobe are incompetent at what they do... hurray for .epub! aren't you glad we finally have "a standard"? i find this whole idea of chopping up the book very distasteful. it reminds me of the way you have to chop up a piece of meat into teensy-tiny pieces so grampa -- who's lost all his teeth -- can gum it successfully. life shouldn't need to be this difficult. at any rate, here is the code that creates a folder of .html files:
http://zenmarkuplanguage.com/grapes123.py http://zenmarkuplanguage.com/grapes123.txt
and here's the subdirectory where those files were created:
this folder of files can then be dropped on "epubzip", which is a little app that zips up the folder in the way .epub requires... (they made it so you couldn't use just _any_ old zip-program, because that would have been far too simple and made sense.) once you've dropped the folder onto "epubzip", you'll get this:
you'll then wanna drop that .epub onto "epubcheck", to ensure it validates your parking for you. love that validated parking... *** again, as before, this code is _not_ "hardened", nor does it handle anything over and above which was in this p-book -- entirely headers and paragraphs save for a few blockquotes -- because it is the minimal set needed to do _this_book_... so it's nothing more than "proof of concept". but it _is_ that. *** so we've got a kindle and an .epub. now we just need a .pdf... -bowerbird
participants (1)
-
Bowerbird@aol.com