On Thu, 5 Sep 2013, honyk wrote:
On 2013-09-04 Thangalin wrote:
What needs to happen to take a minimal ConTeXt file (such as the attached) to produce a minimum viable EPUB that:
It is always difficult to parse and further process not well structured plain text without advanced semantics. Garbage in, garbage out.
The typical ConTeXt document has a lot of structure, and the XML export generates a well structured XML output. That can be directly used in most modern browsers that handle XML+CSS well. However, most (all?) EPUB readers don't. So, the question is asking if instead ConTeXt could generate a XHTML
If you need both EPUB and PDF, start with a semantically rich XML vocabulary, e.g. DocBook. In this case you can relatively easy transfrom (XSLT) input data into almost any format. These basic outputs like EPUB or PDF (via XSL-FO) you can get out-of-the-box. The Context output can be generated using dbcontext: http://dblatex.sourceforge.net/
In sum, use XML as your primary source and from it derive everything else.
I haven't used XML-only toolchains. Is it possible to handle: - Automatic section numbering taking care of different conversions. - Automatic index generation and sorting - Inserting hyphenation points at the approriate place in the generated ouput (so that the browser can effectively rely on TeX's hyphenation algorithm to do linebreaking). - Convert TeX math to MathML. The current ConTeXT XML source can translate a well formed ConTeXt document into a XML document with the above features. Aditya