From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76751 Path: news.gmane.org!not-for-mail From: Andy Thomas Newsgroups: gmane.comp.tex.context Subject: Re: back-up.lua; mtx-epub.lua Date: Thu, 7 Jun 2012 00:00:15 +0200 Message-ID: <8E68CF1E-5817-4F6C-B768-3EB03D02F3AE@web.de> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1339020024 29120 80.91.229.3 (6 Jun 2012 22:00:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2012 22:00:24 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 07 00:00:24 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ScOH7-0002Nj-Pe for gctc-ntg-context-518@m.gmane.org; Thu, 07 Jun 2012 00:00:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 94A05101E4; Thu, 7 Jun 2012 00:00:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DuzyMqhfijC4; Thu, 7 Jun 2012 00:00:19 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AB0EC101E1; Thu, 7 Jun 2012 00:00:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EC02C101E1 for ; Thu, 7 Jun 2012 00:00:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jrxC0Zq+7EsO for ; Thu, 7 Jun 2012 00:00:17 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 95BF4101E0 for ; Thu, 7 Jun 2012 00:00:17 +0200 (CEST) Original-Received: from mout.web.de (mout.web.de [212.227.17.12]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q56M0Gvn002610 for ; Thu, 7 Jun 2012 00:00:16 +0200 Original-Received: from [10.0.1.2] ([78.94.219.187]) by smtp.web.de (mrweb002) with ESMTPS (Nemesis) id 0LjaR6-1S0rbE0RL6-00bQOz for ; Thu, 07 Jun 2012 00:00:16 +0200 In-Reply-To: X-Mailer: Apple Mail (2.1257) X-Provags-ID: V02:K0:DGIX15N749nrpoUIIwLUAMs9mooRdo7I0Gl6x6oFGqw yQsGFPZ7Wb+bzGwENMhotBHGNFDSfjScuMomVP23LlAWEpeIw/ suKxUCOkBR//I9DhU2H95vchx4CEHuaJPbGlkIRRhHnZ+dHV1d YsBJo0lgW6g1ZoV4JJTI9iMPrVqk25qScN4nsuOi987gx3Uagc U4aGxG1xl2ujesFwWZQdw== X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=212.227.17.12; country=DE; region=02; city=Munich; latitude=48.1500; longitude=11.5833; http://maps.google.com/maps?q=48.1500,11.5833&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0THja0gOn - 01cfcbf17d23 - 20120606 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.13 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:76751 Archived-At: Hello all, I do not know, how many people are using the epub export, but here are two more changes in order to achieve a valid epub file with information from the context source: On Jun 5, 2012, at 9:09 PM, Andy Thomas wrote: > 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 6) the title is taken from \setupinteraction 7) the author is taken from \setupinteraction Andy The diff against the actual standalone is diff back-exp_old.lua back-exp_2.lua 2364a2365,2378 > local identity = interactions.general.getidentity() > local title > local author > for i=1,#fields do > local key = fields[i] > local value = identity[key] > if value and value ~= "" then > if key=="title" then > title = value > elseif key=="author" then > author = value > end > end > end 2370a2385,2387 > language = languagenames[tex.count.mainlanguagenumber], > title = title, > author = author, and the epub make script diff mtx-epub_old.lua mtx-epub_2.lua 46c46 < --- > 50c50 < --- > 56c56 < --- > 61,64c61,64 < My Title < en < urn:uuid:%s < MySelf --- > %s > %s > urn:uuid:%s > %s 79c79 < local item = [[ ]] --- > local item = [[ ]] 196a197,199 > local language = specification.language or "en" > local creator = specification.author or "My Self" > local title = specification.title or "My Title" 211c214 < lfs.mkdir(file.join(epubpath,"OPS")) --- > lfs.mkdir(file.join(epubpath,"OEBPS")) 220c223 < local target = file.join(epubpath,"OPS",filename) --- > local target = file.join(epubpath,"OEBPS",filename) 256,257c259,260 < package = format(package,identifier,identifier,os.uuid(),os.date("!%Y-%m-%dT%H:%M:%SZ"),concat(used,"\n"),idmaker(root)) < toc = format(toc,identifier,"title",root) --- > package = format(package,identifier,title,language,identifier,os.uuid(),creator,os.date("!%Y-%m-%dT%H:%M:%SZ"),concat(used,"\n"),idmaker(root)) > toc = format(toc,identifier,title,root) 261,262c264,265 < 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) 275c278 < 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 ___________________________________________________________________________________