[oXygen-user] This might have been foolish, but ...

Ben McGinnes
Sat Sep 26 13:53:12 CDT 2015


Hello,
	So I was poking around in the oxygen/templates/ directory and
had a little look at the ePub 3.0 template in there.

Given what I've said about ePub 3.0 and internal structure in the
past, it was inevitable that I modify the template in there to add a
version with subdirectories for assorted purposes and it certainly
looks like it's behaving at least as far as being an additional global
template.  Obviously there would be no point in mentioning it here if
I wasn't sharing.  Anyone interested can find it here:

https://github.com/adversary-org/epub-tools/tree/master/oxygen/templates

In that directory you'll find the original template, mainly for
comparison (and yes, making an oxygen/templates/ path in that repo is
solely to make it obvious to others where to install/copy to).  The
template I'm referring to here is the one called "EPUB 3.0
DroidBook.epub.bin" and is so named for the embedded font I've dumped
in there (Droid Sans Fallback Full).

There's another template in there as well, "EPUB 3.0
BrythonBook.epub.bin" and you're welcome to play with it, of course,
but I should warn you that it is *highly* experimental.  It's
basically built on the DroidBook template, but includes a complete
implementation of Brython.

Brython is an implementation of Python 3.3 for browsers and
javascript.  It allows you to use python code in the same way as one
might normally use javascript and since ePub 3 is supposed to allow a
subset of javascript I figured I'd see whether I could get this thing
to work in an ePub too.  I won't be too surprised if it goes nowhere
and it's quite possible it might do Bad Things™ instead.  On the other
hand, there's nothing lost by trying it and seeing what breaks.

Even if it doesn't play nicely with ePub, it ought to play quite well
with regular HTML and XHTML projects.  As is amply demonstrated on its
website and described on GitHub:

    http://brython.info/
    https://github.com/brython-dev/brython

If anyone does decide to play with Brython and ePub, I'll be
interested to hear how it goes; whether that be a success or a
catastrophic failure.  With regards to licenses; the original
templates from oXygenXML followed fairly basic specifications from the
IDPF, Brython uses a BSD license (the license file is in the ePub, in
the resurced subdirectory with the README and the Droid Sans font).

My bits barely qualify as needing a license, but if you must have one
then my WTFNMF Public License ought to do the job nicely.  You can
find the terms of that here:

    https://github.com/adversary-org/wtfnmf

Oh, yes, the manifest for the Brython experiment does include all the
files for the implementation (you're welcome).  So it should just be a
matter of calling brython.js by its relative path in any HTML or XHTML
file to make it work.  At least in theory, there's been zero testing
yet.


Regards,
Ben

-- 
Ben McGinnes  http://www.adversary.org/  Twitter: benmcginnes
    Writer, Systems Administrator, Trainer, ICT Consultant
GPGME Python 3 API Maintainer, GNU Privacy Guard  https://www.gnupg.org/
Encrypted email preferred, primary OpenPGP/GPG key: 0x321E4E2373590E5D
OpenPGP/GPG key here: http://goo.gl/GVGwT and http://goo.gl/SDs0D
OpenPGP/GPG key transition: http://www.adversary.org/keyswitch.txt.asc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 630 bytes
Desc: OpenPGP digital signature
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20150927/3f18a506/attachment.sig>


More information about the oXygen-user mailing list