summaryrefslogtreecommitdiff
path: root/xslt
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2011-05-15 19:48:51 -0400
committerShaun McCance <shaunm@gnome.org>2011-05-15 19:49:35 -0400
commit4e2d15aae9f6f9dac641cfebe4ada868b4c07611 (patch)
tree02ade564333806ea7a2493fa21bf6ff17c8b7716 /xslt
parent2cf4c475ead66ca184073aed37227340863e6b4d (diff)
downloadyelp-tools-4e2d15aae9f6f9dac641cfebe4ada868b4c07611.tar.gz
yelp-build: Place generated files in yelp subdir in epub
Diffstat (limited to 'xslt')
-rw-r--r--xslt/Makefile.am1
-rw-r--r--xslt/mal-epub.xsl7
-rw-r--r--xslt/mal-opf.xsl.in31
3 files changed, 25 insertions, 14 deletions
diff --git a/xslt/Makefile.am b/xslt/Makefile.am
index 4edcc83..de4eee2 100644
--- a/xslt/Makefile.am
+++ b/xslt/Makefile.am
@@ -1,6 +1,7 @@
xsldir=$(datadir)/yelp-tools/xslt
xsl_DATA = \
+ mal-epub.xsl \
mal-opf.xsl \
mal-ncx.xsl \
mal-rng.xsl
diff --git a/xslt/mal-epub.xsl b/xslt/mal-epub.xsl
new file mode 100644
index 0000000..2a585bb
--- /dev/null
+++ b/xslt/mal-epub.xsl
@@ -0,0 +1,7 @@
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:mal="http://projectmallard.org/1.0/"
+ exclude-result-prefixes="mal"
+ version="1.0">
+
+</xsl:stylesheet>
diff --git a/xslt/mal-opf.xsl.in b/xslt/mal-opf.xsl.in
index c6ab921..b56b524 100644
--- a/xslt/mal-opf.xsl.in
+++ b/xslt/mal-opf.xsl.in
@@ -11,7 +11,7 @@
version="1.0">
<xsl:param name="opf.id"/>
-<xsl:param name="opf.icons"/>
+<xsl:param name="opf.data"/>
<xsl:include href="file://@XSL_MAL_LINK@"/>
<xsl:include href="file://@XSL_MAL_SORT@"/>
@@ -90,19 +90,22 @@
<manifest>
<item id="ncx" href="ncx.ncx" media-type="application/x-dtbncx+xml"/>
- <xsl:for-each select="mal:page/@xml:lang[not(. = ../preceding-sibling::mal:page/@xml:lang)]">
- <item id="stylesheet-{.}.css" href="{.}.css" media-type="text/css"/>
- </xsl:for-each>
- <xsl:if test="mal:page[not(@xml:lang)] and not(mal:page[@xml:lang = 'C'])">
- <item id="stylesheet-C.css" href="C.css" media-type="text/css"/>
- </xsl:if>
-
- <item id="data-jquery.js" href="jquery.js" media-type="text/javascript"/>
- <item id="data-jquery.syntax.js" href="jquery.syntax.js" media-type="text/javascript"/>
- <item id="data-yelp.js" href="yelp.js" media-type="text/javascript"/>
-
- <xsl:for-each select="str:split(normalize-space($opf.icons))">
- <item id="data-{.}" href="{.}" media-type="image/png"/>
+ <xsl:for-each select="str:split(normalize-space($opf.data))">
+ <item id="data-{.}" href="{.}">
+ <xsl:attribute name="media-type">
+ <xsl:choose>
+ <xsl:when test="substring(., string-length(.) - 3) = '.png'">
+ <xsl:text>image/png</xsl:text>
+ </xsl:when>
+ <xsl:when test="substring(., string-length(.) - 3) = '.css'">
+ <xsl:text>text/css</xsl:text>
+ </xsl:when>
+ <xsl:when test="substring(., string-length(.) - 2) = '.js'">
+ <xsl:text>text/javascript</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ </item>
</xsl:for-each>
<xsl:variable name="media">