![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 9/4/2013 3:19 AM, Thangalin wrote:
Hi,
The attached t.tex file produces the attached t.xhtml file. I have looked at the following documents:
* http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0..1 http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1 * http://en.wikipedia.org/wiki/DTBook * http://www.idpf.org/epub/20/spec/OPS_2.0.1_draft.htm * http://www.w3.org/TR/xhtml11/doctype.html * http://www.w3.org/TR/html5/sections.html
It seems that the macros in t.tex are being written out as XML elements, verbatim. It is my understanding that these XML elements, however, do not conform to the minimal content models associated with XHTML 1.1.
you get a representation in xml indeed, but not verbatim, but as close as possible to the genaric (parent) structure elements in context of course we could alternatively export all as <div class="tag-subtag-..."> but i don't like that too much; html itself is not rich enough for our purpose
What needs to happen to take a minimal ConTeXt file (such as the attached) to produce a minimum viable EPUB that:
* Generates XHTML headers (including <!DOCTYPE and <html...>)
not needed as we're 'standalone'
* Produces images as img tags, rather than float tags.
the css can deal with them (info is written to files for that) the only real problematic thing is hyperlinks as css has no provision for that so there's an option to inject <a>...
* Uses typical XHTML tags for <body> elements (e.g., <ol> for ordered lists).
xhtml has no typical tags .. it's xml + css (or xslt) ... unfortunately browsers have messed up html so much (extensions, too tolerant support for unmatched tags, different rendering models) that xhtml never really took off the export of context is in fact just xml, and by tagging it as xhtml we can apply css to it; but if someone has a workflow for producing epub an option if to postprocess that xml file into whatever epub one wants (i.e. the export is generic and carries as much info as possible)
Ideally, I would like to do something such as:
* context t.tex * mtxrun --script epub --make t.specification
to generate an EPUB that passes validation of epubcheck http://code.google.com/p/epubcheck/wiki/Library, with an output XHTML file that more closely matches the XHTML specification.
Everytime we look into epub there's another issue ... it's not a standard but reversed engineered application mess (happen soften with xml: turn some application data structures into xml and call it a standard) I only tested (long ago already) with some firefox plugin (i don't have a recent epub device, only an old firts generation one which is dead slow, never relly used, probably broken by now) and i refuse to buy a new one till resolution is decent (and i only want generic devices, not something bound to some shop)
How can I help?
by testing as i have no real use/demand for epub it's not something i look into on a daily basis Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------