On 8-6-2012 23:28, Andy Thomas wrote:
Thank you for the suggestions. I will try to implement it, but might need until Sunday.
- I've added some keys to \setupexport: author title subtitle firstpage (also new key in mult) lastpage (aso new key in mult) - The title, subtitle and author inherit from \setupinteraction which already inherits from \setupdocument (metadata namespace). - In mtx-epub these variables are picked up (from the epub job specification) and firstpage / lastpage are added to the images list. Nothing has been checked and the firstpage/lastpage image names have to be pushed into some epub metadata blob I guess but that's for you to figure out in mtx-epub. It's probably best to assume that the images are present and suitable for epub. 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 -----------------------------------------------------------------
On Sat, 9 Jun 2012, Hans Hagen wrote:
On 8-6-2012 23:28, Andy Thomas wrote:
Thank you for the suggestions. I will try to implement it, but might need until Sunday.
- I've added some keys to \setupexport:
author title subtitle firstpage (also new key in mult) lastpage (aso new key in mult)
- The title, subtitle and author inherit from \setupinteraction which already inherits from \setupdocument (metadata namespace).
I never realized that there was a \setupdocument! This might be the best way to have a document title in ConTeXt: \startsetups document:start .... code to typeset document title .... \stopsetups \setupdocument [title={...}, author={...}, date={...}, ] \startdocument .... \stopdocument rather than the different custom solutions that are floating around. Aditya
On 9-6-2012 02:38, Aditya Mahajan wrote:
I never realized that there was a \setupdocument!
it has been there for a while ... the idea is to set up some vars at the top (of whatever) and use them later (e.g. variables used in a title page or colofon). Nothing mandate, just convenience.
This might be the best way to have a document title in ConTeXt:
\startsetups document:start .... code to typeset document title .... \stopsetups
\setupdocument [title={...}, author={...}, date={...}, ]
e.g. interaction's title is set up so that in inherits from documents "metadata:title" etc 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 -----------------------------------------------------------------
On Jun 9, 2012, at 1:31 AM, Hans Hagen wrote:
On 8-6-2012 23:28, Andy Thomas wrote:
Thank you for the suggestions. I will try to implement it, but might need until Sunday.
- I've added some keys to \setupexport:
author title subtitle firstpage (also new key in mult) lastpage (aso new key in mult)
- The title, subtitle and author inherit from \setupinteraction which already inherits from \setupdocument (metadata namespace).
- In mtx-epub these variables are picked up (from the epub job specification) and firstpage / lastpage are added to the images list.
Nothing has been checked and the firstpage/lastpage image names have to be pushed into some epub metadata blob I guess but that's for you to figure out in mtx-epub. It's probably best to assume that the images are present and suitable for epub.
I took the new keys and added the cover (page) generator to mtx-epub.lua. The name is hard coded (cover.xhtml), so if a user decides on naming the original file cover.tex... The validator likes it, next is the hard part: generating a valid xhtml. Is the xhtml generator only for the epub, i.e. can it be changed or is another output file just for the epub appropriate? Calibre is already happy with it and shows it just fine. Please note that some ebook readers (e.g. apple devices, calibre) have a nasty caching mechanism. If you want to see the new changes, I found that it is best to delete the old book before replacing it. Andy https://dl.dropbox.com/u/9089117/mtx-epub_4.lua P.S. I have no clue, why 'images[firstpage] = firstpage' works. I would expect 'images[#images+1] = firstpage'
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 -----------------------------------------------------------------
On 9-6-2012 14:58, Andy Thomas wrote:
On Jun 9, 2012, at 1:31 AM, Hans Hagen wrote:
On 8-6-2012 23:28, Andy Thomas wrote:
Thank you for the suggestions. I will try to implement it, but might need until Sunday.
- I've added some keys to \setupexport:
author title subtitle firstpage (also new key in mult) lastpage (aso new key in mult)
- The title, subtitle and author inherit from \setupinteraction which already inherits from \setupdocument (metadata namespace).
- In mtx-epub these variables are picked up (from the epub job specification) and firstpage / lastpage are added to the images list.
Nothing has been checked and the firstpage/lastpage image names have to be pushed into some epub metadata blob I guess but that's for you to figure out in mtx-epub. It's probably best to assume that the images are present and suitable for epub.
I took the new keys and added the cover (page) generator to mtx-epub.lua. The name is hard coded (cover.xhtml), so if a user decides on naming the original file cover.tex...
The validator likes it, next is the hard part: generating a valid xhtml. Is the xhtml generator only for the epub, i.e. can it be changed or is another output file just for the epub appropriate?
the only issue is that css has no method for mapping a link which is why the exporter produces two files (xml and xhtml)
Calibre is already happy with it and shows it just fine. Please note that some ebook readers (e.g. apple devices, calibre) have a nasty caching mechanism. If you want to see the new changes, I found that it is best to delete the old book before replacing it.
Andy
xmlns + doctype is probably a bit over the top for the coverpage
P.S. I have no clue, why 'images[firstpage] = firstpage' works. I would expect 'images[#images+1] = firstpage'
it's a hash mapping names onto real names (as we can have converted images) 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 -----------------------------------------------------------------
On Jun 11, 2012, at 12:21 AM, Hans Hagen wrote:
The validator likes it, next is the hard part: generating a valid xhtml. Is the xhtml generator only for the epub, i.e. can it be changed or is another output file just for the epub appropriate?
the only issue is that css has no method for mapping a link which is why the exporter produces two files (xml and xhtml)
I get an error by the epub validator if I feed it the generated epub. The content file is: -START------------ <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <!-- input filename : test_00 --> <!-- processing date : Mon Jun 11 07:03:39 2012 --> <!-- context version : 2012.06.11 00:21 --> <!-- exporter version : 0.30 --> <document xmlns:m="http://www.w3.org/1998/Math/MathML" version="0.30" language="de" date="Mon Jun 11 07:03:39 2012" file="test_00" context="2012.06.11 00:21" xmlns:xhtml="http://www.w3.org/1999/xhtml"> Hello world! </document> -END------------ the error is: -START------------ Epubcheck Version 3.0b5 Validating against EPUB version 2.0 ERROR: test_00.epub/OEBPS/test_00.xhtml(9,202): elements from namespace "" are not allowed Check finished with warnings or errors -END------------ A possible validatable file would be -START------------ <?xml version="1.0" encoding="UTF-8" ?> <!-- input filename : test_00 --> <!-- processing date : Sat Jun 9 14:36:39 2012 --> <!-- context version : 2012.06.09 01:22 --> <!-- exporter version : 0.30 --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>TITLE</title> </head> <body> <div id="test_00"> Hello world! </div> </body> </html> -END------------ It just wraps the filename without extension in title plus head and the main part in body plus a div. However, I did not try, yet, how many or which devices can read it just fine.
Calibre is already happy with it and shows it just fine. Please note that some ebook readers (e.g. apple devices, calibre) have a nasty caching mechanism. If you want to see the new changes, I found that it is best to delete the old book before replacing it.
Andy
xmlns + doctype is probably a bit over the top for the coverpage
I slavishly follow the mandatory epub specification and then add some things to make common devices work. Calibre, Adobe Digital Editions and Apple devices want a xhtml cover page in a very special way and ignore the cover image otherwise. The next thing I would add is a toc.xhtml. Here, a Kindle ignores the toc.ncx and wants a html toc as well. Unfortunately, this blows up mtx-epub, but at least that is the last issue with reading devices that I know. Andy
On 11-6-2012 07:41, Andy Thomas wrote:
On Jun 11, 2012, at 12:21 AM, Hans Hagen wrote:
The validator likes it, next is the hard part: generating a valid xhtml. Is the xhtml generator only for the epub, i.e. can it be changed or is another output file just for the epub appropriate?
the only issue is that css has no method for mapping a link which is why the exporter produces two files (xml and xhtml)
I get an error by the epub validator if I feed it the generated epub. The content file is:
-START------------ <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : test_00 --> <!-- processing date : Mon Jun 11 07:03:39 2012 --> <!-- context version : 2012.06.11 00:21 --> <!-- exporter version : 0.30 -->
<document xmlns:m="http://www.w3.org/1998/Math/MathML" version="0.30" language="de" date="Mon Jun 11 07:03:39 2012" file="test_00" context="2012.06.11 00:21" xmlns:xhtml="http://www.w3.org/1999/xhtml"> Hello world! </document> -END------------
the error is:
-START------------ Epubcheck Version 3.0b5
Validating against EPUB version 2.0 ERROR: test_00.epub/OEBPS/test_00.xhtml(9,202): elements from namespace "" are not allowed
maybe then mean that namespace mathml is not supported? ----------------------------------------------------------------- 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 -----------------------------------------------------------------
participants (3)
-
Aditya Mahajan
-
Andy Thomas
-
Hans Hagen