summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-05-16 11:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2011-05-16 11:00:00 +0200
commit5eca07d318d43832522e3482a000ab933c25a420 (patch)
tree68f87db4e87702a1e7c554d1491c20eb691395e1 /scripts
parentb3be5baa491b69cc40ffd20267a5bae48fea65c3 (diff)
downloadcontext-5eca07d318d43832522e3482a000ab933c25a420.tar.gz
beta 2011.05.16 11:00
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-epub.lua26
1 files changed, 23 insertions, 3 deletions
diff --git a/scripts/context/lua/mtx-epub.lua b/scripts/context/lua/mtx-epub.lua
index 15282ddab..70ee7828c 100644
--- a/scripts/context/lua/mtx-epub.lua
+++ b/scripts/context/lua/mtx-epub.lua
@@ -6,6 +6,18 @@ if not modules then modules = { } end modules ['mtx-epub'] = {
license = "see context related readme files"
}
+-- The epub specification is far from beautiful. Especially the id related
+-- part is messy and devices/programs react differently on them (so an id is not
+-- really an id but has some special property). Then there is this ncx suffix
+-- thing. Somehow it give the impression of a reversed engineered application
+-- format so it will probably take a few cycles to let it become a real
+-- clean standard. Thanks to Adam Reviczky for helping to figure out all these
+-- puzzling details.
+
+-- This is preliminary code. At some point we will deal with images as well but
+-- first we need a decent strategy to export them. More information will be
+-- available on the wiki.
+
local format = string.format
local concat = table.concat
@@ -63,6 +75,14 @@ local package = [[
</package>
]]
+-- We need to figure out what is permitted; numbers only seem to give
+-- problems is some applications as do names with dashes.
+
+local function dumbid(filename)
+ -- return (string.gsub(os.uuid(),"%-%","")) -- to be tested
+ return file.nameonly(filename)
+end
+
local mimetypes = {
xhtml = "application/xhtml+xml",
css = "text/css",
@@ -70,9 +90,9 @@ local mimetypes = {
}
local idmakers = {
- ncx = function(filename) return "ncx" end,
- css = function(filename) return "stylesheet" end,
- default = function(filename) return file.nameonly(filename) end,
+ ncx = function(filename) return "ncx" end,
+ -- css = function(filename) return "stylesheet" end,
+ default = function(filename) return dubmid(filename) end,
}
-- specification = {