Hi all,

in my attempts to validate epub export from my context source, I made the 
following changes to back-up.lua and mtx-epub.lua

1) the actual context language is put in the epub
2) changed the OPS directory to OEBPS. The 2.0.1 Standard does not actually say 
that is has to have that name, but I only found examples using that one, 
including the sample documents in the 2.0.1 white paper. 
3) changed opf:scheme to UUID, since that is used and not a ISBN number
4) added the encoding info in the opf file
5) changed the single in double-quotes in the opf file manifest. I do not know 
if it is necessary, but this seams to be more consistent

Andy

diff back-exp_old.lua back-exp.lua 
2370a2371
>             language   = languagenames[tex.count.mainlanguagenumber],


diff mtx-epub_old.lua mtx-epub.lua 
46c46
< <?xml version="1.0" encoding="UTF-8" ?>
---
> <?xml version="1.0" encoding="UTF-8"?>
50c50
<         <rootfile full-path="OPS/%s" 
media-type="application/oebps-package+xml"/>
---
>         <rootfile full-path="OEBPS/%s" 
> media-type="application/oebps-package+xml"/>
56c56
< <?xml version="1.0"?>
---
> <?xml version="1.0" encoding="UTF-8"?>
62,63c62,63
<         <dc:language>en</dc:language>
<         <dc:identifier id="%s" >urn:uuid:%s</dc:identifier>
---
>         <dc:language>%s</dc:language>
>         <dc:identifier id="%s" opf:scheme="UUID">urn:uuid:%s</dc:identifier>
79c79
< local item = [[        <item id='%s' href='%s' media-type='%s'/>]]
---
> local item = [[        <item id="%s" href="%s" media-type="%s"/>]]
196a197
>         local language   = specification.language   or "en"
211c212
<         lfs.mkdir(file.join(epubpath,"OPS"))
---
>         lfs.mkdir(file.join(epubpath,"OEBPS"))
220c221
<                 local target = file.join(epubpath,"OPS",filename)
---
>                 local target = file.join(epubpath,"OEBPS",filename)
256c257
<         package   = 
format(package,identifier,identifier,os.uuid(),os.date("!%Y-%m-%dT%H:%M:%SZ"),concat(used,"\n"),idmaker(root))
---
>         package   = 
> format(package,identifier,language,identifier,os.uuid(),os.date("!%Y-%m-%dT%H:%M:%SZ"),concat(used,"\n"),idmaker(root))
261,262c262,263
<         io.savedata(file.join(epubpath,"OPS",epubroot),package)
<         io.savedata(file.join(epubpath,"OPS",epubtoc),toc)
---
>         io.savedata(file.join(epubpath,"OEBPS",epubroot),package)
>         io.savedata(file.join(epubpath,"OEBPS",epubtoc),toc)
275c276
<                 os.execute(format(zipper.compressed,epubfile,"OPS"))
---
>                 os.execute(format(zipper.compressed,epubfile,"OEBPS"))

___________________________________________________________________________________
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 via email to