ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Error in ePub script
Date: Thu, 6 Aug 2015 09:36:25 +0200	[thread overview]
Message-ID: <55C30E79.2090200@wxs.nl> (raw)
In-Reply-To: <885FFFD2-19BD-4359-96CA-5804D88AE0B7@fiee.net>

On 8/6/2015 6:33 AM, Henning Hraban Ramm wrote:
> Hi, I’m at creating an ePub once again and run into an error:
>
> $ mtxrun --script epub --make prd_MBL
>
> resolvers       | caching | skipping 'files' for 'home:texmf' from '/Users/hraban/Library/texmf/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/trees/54be04d87dd160089f572b19cb5c97e9' (version mismatch)
> mtx-epub        | using specification file 'prd_MBL-export/prd_MBL-pub.lua'
> mtx-epub        | cover page image 'cover.xhtml' is not present
> mtx-epub        | saving dummy coverpage to 'prd_MBL-export/cover.xhtml'
> mtx-epub        | 17 images checked, 0 updated, 17 kept, 0 skipped
> mtx-epub        | creating paths in tree 'prd_MBL-epub'
> mtx-epub        | removing 'prd_MBL-epub/OEBPS/styles/prd_MBL-images.css'
> mtx-epub        | checking image 'prd_MBL-export/images/MT-Logo_grau-page-1.svg' -> 'prd_MBL-epub/OEBPS/images/MT-Logo_grau-page-1.svg'
> mtx-epub        | copying 'prd_MBL-export/images/MT-Logo_grau-page-1.svg' to 'prd_MBL-epub/OEBPS/images/MT-Logo_grau-page-1.svg'
> mtx-epub        | checking image 'prd_MBL-export/images/blatt_esche.jpg' -> 'prd_MBL-epub/OEBPS/images/blatt_esche.jpg‘
> ...
> mtx-epub        | checking image 'prd_MBL-export/styles/prd_MBL-defaults.css' -> 'prd_MBL-epub/OEBPS/styles/prd_MBL-defaults.css'
> mtx-epub        | copying 'prd_MBL-export/styles/prd_MBL-defaults.css' to 'prd_MBL-epub/OEBPS/styles/prd_MBL-defaults.css'
> mtx-epub        | checking image 'prd_MBL-export/styles/prd_MBL-images.css' -> 'prd_MBL-epub/OEBPS/styles/prd_MBL-images.css'
> mtx-epub        | copying 'prd_MBL-export/styles/prd_MBL-images.css' to 'prd_MBL-epub/OEBPS/styles/prd_MBL-images.css'
> mtx-epub        | checking image 'prd_MBL-export/styles/prd_MBL-styles.css' -> 'prd_MBL-epub/OEBPS/styles/prd_MBL-styles.css'
> mtx-epub        | copying 'prd_MBL-export/styles/prd_MBL-styles.css' to 'prd_MBL-epub/OEBPS/styles/prd_MBL-styles.css'
> mtx-epub        | copying 'prd_MBL-export/prd_MBL-div.xhtml' to 'prd_MBL-epub/OEBPS/prd_MBL-div.xhtml'
> mtx-epub        | copying 'prd_MBL-export/cover.xhtml' to 'prd_MBL-epub/OEBPS/cover.xhtml'
> mtx-epub        | relocating images...texmf/tex/texmf-context/scripts/context/lua/mtx-epub.lua:285: attempt to index field '?' (a nil value)
>
> The error is in this function:
>
> local function relocateimages(imagedata,oldname,newname,subpath,rename)
>      local data = io.loaddata(oldname)
>      if data then
>          subpath = joinfile("..",subpath)
>          report("relocating images")
>          local n = 0
>          local done = gsub(data,[[(id=")(.-)(".-background%-image *: *url%()(.-)(%))]], function(s1,id,s2,name,s3)
>              local newname = imagedata[id].newname
> -- #### imagedata[id].newname throws the above error
>              if newname then
>                  if subpath then
>                      name = joinfile(subpath,basename(newname))
>                  else
>                      name = basename(newname)
>                  end
>               -- name = url.addscheme(name)
>              end
>              if newname then
>                  n = n + 1
>                  if rename then
>                      name = joinfile(subpath,addsuffix(id,suffix(name)))
>                  end
>                  return s1 .. id .. s2 .. name .. s3
>              end
>          end)
>          report("%s images relocated in %a",n,newname)
>          if newname then
>              io.savedata(newname,done)
>          end
>      end
>      return images
> end
>
> My prd_MBL-pub.lua looks like:
>
> return {
>   ["author"]="Henning Hraban Ramm",
>   ["htmlfiles"]={ "prd_MBL-div.xhtml" },
>   ["htmlroot"]="prd_MBL-div.xhtml",
>   ["identifier"]="96f59e0d-454d-93e6-3fa9-5a126440a831",
>   ["imagefile"]="styles/prd_MBL-images.css",
>   ["imagepath"]="images",
>   ["images"]={
>    ["image>1"]={
>     ["element"]="image",
>     ["height"]="1.875cm",
>     ["id"]="image-1",
>     ["name"]="MT-Logo_grau",
>     ["url"]="file:///MT-Logo_grau",
>     ["used"]="img/MT-Logo_grau.pdf",
>     ["width"]="2.671cm",
>    },
>    ["image>10"]={
>     ["element"]="image",
>     ["height"]="3.750cm",
>     ["id"]="image-10",
>     ["name"]="blatt_esche",
>     ["url"]="file:///blatt_esche",
>     ["used"]="img/blatt_esche.jpg",
>     ["width"]="4.038cm",
>    },
> ...
>   },
>   ["language"]="de",
>   ["name"]="prd_MBL",
>   ["stylepath"]="styles",
>   ["styles"]={ "prd_MBL-defaults.css", "prd_MBL-images.css", "prd_MBL-styles.css" },
>   ["title"]="MBL",
>   ["xhtmlfiles"]={ "prd_MBL-tag.xhtml" },
>   ["xmlfiles"]={ "prd_MBL-raw.xml" },
> }
>
> What’s wrong?

looks like an old mtx-epub, the latest one has a check

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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	other threads:[~2015-08-06  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06  4:33 Henning Hraban Ramm
2015-08-06  7:36 ` Hans Hagen [this message]
2015-08-06 13:01   ` Henning Hraban Ramm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55C30E79.2090200@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).