</object>
</xsl:when>
<xsl:otherwise>
+ <xsl:variable name="src">
+ <xsl:choose>
+ <xsl:when test="$img.src.path != '' and
+ $tag = 'img' and
+ not(starts-with($output_filename, '/')) and
+ not(contains($output_filename, '://'))">
+ <xsl:value-of select="$img.src.path"/>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:value-of select="$output_filename"/>
+ </xsl:variable>
+ <xsl:variable name="imgcontents">
<xsl:element name="{$tag}">
<xsl:if test="$tag = 'img' and ../../self::imageobjectco">
<xsl:variable name="mapname">
</xsl:if>
<xsl:attribute name="src">
- <xsl:choose>
- <xsl:when test="$img.src.path != '' and
- $tag = 'img' and
- not(starts-with($output_filename, '/')) and
- not(contains($output_filename, '://'))">
- <xsl:value-of select="$img.src.path"/>
- </xsl:when>
- </xsl:choose>
- <xsl:value-of select="$output_filename"/>
+ <xsl:value-of select="$src"/>
</xsl:attribute>
<xsl:if test="@align">
<xsl:with-param name="viewport" select="$viewport"/>
</xsl:call-template>
</xsl:element>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$link.to.self.for.mediaobject = 0">
+ <xsl:copy-of select="$imgcontents"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{$src}">
+ <xsl:copy-of select="$imgcontents"/>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!ENTITY linenumbering.separator SYSTEM "../params/linenumbering.separator.xml">
<!ENTITY linenumbering.width SYSTEM "../params/linenumbering.width.xml">
<!ENTITY link.mailto.url SYSTEM "../params/link.mailto.url.xml">
+<!ENTITY link.to.self.for.mediaobject SYSTEM "../params/link.to.self.for.mediaobject.xml">
<!ENTITY make.graphic.viewport SYSTEM "../params/make.graphic.viewport.xml">
<!ENTITY make.single.year.ranges SYSTEM "../params/make.single.year.ranges.xml">
<!ENTITY make.valid.html SYSTEM "../params/make.valid.html.xml">
&use.embed.for.svg;
&make.graphic.viewport;
&preferred.mediaobject.role;
+&link.to.self.for.mediaobject;
&use.role.for.mediaobject;
&ignore.image.scaling;
</reference>
--- /dev/null
+<refentry xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="5.0" xml:id="link.to.self.for.mediaobject">
+ <refmeta>
+ <refentrytitle>link.to.self.for.mediaobject</refentrytitle>
+ <refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
+ </refmeta>
+ <refnamediv>
+ <refname>link.to.self.for.mediaobject</refname>
+ <refpurpose>Include <tag>a</tag> element to image objects itself to go to a full-size, freely-zoomable version</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+<src:fragment xml:id="link.to.self.for.mediaobject.frag">
+<xsl:param name="link.to.self.for.mediaobject" select="0"/>
+</src:fragment>
+ </refsynopsisdiv>
+
+ <refsection>
+ <info>
+ <title>Description</title>
+ </info>
+ <para>In some cases, it can be very helpful to be able to click on an embedded <tag>figure</tag>
+ or <tag>informalfigure</tag> to get a full-size, freely-zoomable version of an image, for
+ instance when targeting readers on smartphones. This is implemented for images only, but not
+ for audio or video objects. </para>
+
+ <para>If non-zero, the image will be wrapped in an <tag>a</tag> element, using the <tag class="attribute">href</tag>
+ attribute pointing to the image itself: </para>
+ <screen><a href="source/image">
+ <!-- the image object -->
+</a></screen>
+
+ <para> If the value of <parameter>link.to.self.for.mediaobject.xml</parameter> is zero
+ (default), then no <tag>a</tag> container is added. </para>
+ </refsection>
+</refentry>
<!ENTITY linenumbering.separator SYSTEM "../params/linenumbering.separator.xml">
<!ENTITY linenumbering.width SYSTEM "../params/linenumbering.width.xml">
<!ENTITY link.mailto.url SYSTEM "../params/link.mailto.url.xml">
+<!ENTITY link.to.self.for.mediaobject SYSTEM "../params/link.to.self.for.mediaobject.xml">
<!ENTITY make.graphic.viewport SYSTEM "../params/make.graphic.viewport.xml">
<!ENTITY make.single.year.ranges SYSTEM "../params/make.single.year.ranges.xml">
<!ENTITY make.valid.html SYSTEM "../params/make.valid.html.xml">
<!ENTITY index.method SYSTEM "../params/index.method.xml">
<!ENTITY reference.autolabel SYSTEM "../params/reference.autolabel.xml">
<!ENTITY glossary.sort SYSTEM "../params/glossary.sort.xml">
-<!ENTITY javahelp.encoding SYSTEM "../params/javahelp.encoding.xml">
\ No newline at end of file
+<!ENTITY javahelp.encoding SYSTEM "../params/javahelp.encoding.xml">
&use.embed.for.svg;
&make.graphic.viewport;
&preferred.mediaobject.role;
+&link.to.self.for.mediaobject;
&use.role.for.mediaobject;
&ignore.image.scaling;
</reference>