On Sat, 16 Nov 2013, Bill Meahan wrote: > I would /expect/ to get a valid EPUB file, or so I'm lead to believe. > > At the moment, I'm simply trying it out using Hans' "export-example.tex" file > that comes as part of the standard ConTeXt distribution, either Standalone or > part of one of the other distributions. I haven't even opened the > export-example.tex file in an editor (yet) in this round of trials and I've > even run the script against it right in the ..../base/ directory where it is > found in the distribution so I don't understand why it is not producing a > valid EPUB. Once I've got that sorted out, I can try applying the lessons > learned to my own documents. ConTeXt provides two types of exports. The first is an XML export. Consider a sample file: ~~~ {test.tex} \setupbackend[export=yes] \starttext \startsection[title={This is a test}] \startparagraph Some random text \startitemize \item First \item Second \stopitemize \stopparagraph \stopsection \stoptext ~~~ Running `context test.tex` generates a `test.export` file that looks as follows: ~~~ {test.export}
1 This is a test Some random text First Second
~~~ which is simply an XML representation of the document. In prinicple, if one adds an appropriate CSS file with that XML, any recent browser will be able to display it. So, if you change the first line of `test.tex` to ~~~ \setupbackend[export=yes, xhtml=yes, css=yes] ~~~ and run `context test.tex`, you will get four additional files: `test.xhtml`, `test-styles.css`, `test-images.css`, and `test.specification`. The `test.xhtml` file look as follows: ~~~{test.xhtml}
1 This is a test Some random text First Second
~~~ Notice that apart from the three lines specifying the CSS files, the rest of the document is the same as in XML export. The two css files, `test-styles.css` and `test-images.css` include the relevant code for the style modifications and images in the document. The css file `export-example.css` comes with the ConTeXt distribution and has the default values for most ConTeXt elements. If you open the `test.xhtml` file in any browser, it will work correctly (because an XHTML markup is extensible and can use any XML tags as long as the behavior of the tag is specified in a CSS file). This is, however, not a XHTML file that includes the default XHTML markup (

,

,