ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: EPUB XHTML Format
Date: Wed, 04 Sep 2013 11:20:54 +0200	[thread overview]
Message-ID: <5226FB76.8030602@wxs.nl> (raw)
In-Reply-To: <CAANrE7r9OaMc65SaiJYhZ8x3=GtrQzYRrmZrfiLvcHiuot=xJA@mail.gmail.com>

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2013-09-04  9:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04  1:19 Thangalin
2013-09-04  9:20 ` Hans Hagen [this message]
2013-09-04 17:55   ` Thangalin
2013-09-05 13:55     ` Hans Hagen
2013-09-12 14:32       ` Alan BRASLAU
2013-09-05 16:38   ` Hans Hagen
2013-09-05 16:57     ` Thangalin
2013-09-05 17:57       ` Khaled Hosny
2013-09-05 18:22         ` Hans Hagen
2013-09-05 17:22     ` Aditya Mahajan
2013-09-05 18:21       ` Hans Hagen
2013-09-05 18:11 ` honyk
     [not found] ` <00b501ceaa63$61805e50$24811af0$@tosovsky@email.cz>
2013-09-05 18:20   ` Aditya Mahajan
2013-09-05 18:24     ` Hans Hagen
2013-09-05 19:54       ` Mica Semrick
2013-09-05 21:15       ` Michael Hallgren
2013-09-05 22:00     ` Thangalin
2013-09-06 16:09       ` Hans Hagen
2013-09-06 16:36       ` Mica Semrick
2013-09-06 20:20         ` Thangalin
2013-09-06 21:22           ` Thangalin
2013-09-06 21:27             ` Aditya Mahajan
2013-09-07 12:07           ` Hans Hagen
2013-09-07 18:31             ` Thangalin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5226FB76.8030602@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).