1
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
xmlns:yelp="http://www.gnome.org/yelp/ns"
5
xmlns="http://www.w3.org/1999/xhtml"
6
extension-element-prefixes="yelp"
9
<xsl:import href="@XSL_GETTEXT@"/>
10
<xsl:import href="@XSL_COLOR@"/>
11
<xsl:import href="@XSL_ICONS@"/>
12
<xsl:import href="@XSL_HTML@"/>
13
<xsl:include href="yelp-common.xsl"/>
15
<xsl:param name="html.basename" select="'//index'"/>
17
<xsl:param name="linktrail" select="''"/>
19
<xsl:template mode="html.title.mode" match="Man">
20
<xsl:value-of select="header/title"/>
23
<xsl:template mode="html.body.mode" match="Man">
24
<!-- Invisible div that we use to calculate the indent width. -->
25
<xsl:element name="div">
26
<xsl:attribute name="id">invisible-char</xsl:attribute>
27
<xsl:attribute name="style">
29
font-family: monospace;
34
<xsl:text>X</xsl:text>
36
<xsl:apply-templates select="header"/>
37
<xsl:apply-templates select="section"/>
40
<!-- ======================================================================= -->
42
<xsl:template match="header">
45
<xsl:value-of select="title"/>
46
<xsl:text> (</xsl:text>
47
<xsl:value-of select="section"/>
48
<xsl:text>)</xsl:text>
50
<h3 style="text-align: right;">
51
<xsl:value-of select="collection"/>
53
<xsl:if test="@version or @date">
54
<p style="text-align: right">
55
<xsl:if test="@version">
56
Version: <xsl:value-of select="@version"/>
58
<xsl:if test="@version and @date"><br/></xsl:if>
60
Date: <xsl:value-of select="@date"/>
67
<xsl:template match="br">
71
<xsl:template match="section">
72
<div class="section" style="padding-top: 1em;">
74
<xsl:value-of select="title"/>
77
<div class="section-contents" style="font-family: monospace;">
78
<xsl:apply-templates select="sheet"/>
83
<xsl:template match="sheet">
84
<xsl:element name="div">
85
<xsl:attribute name="style">
87
margin-top: <xsl:value-of select="@jump"/>em;
88
margin-left: <xsl:value-of select="@indent"/>ex;
90
<xsl:attribute name="class">sheet</xsl:attribute>
91
<p><xsl:apply-templates select="span|br|a"/></p>
95
<xsl:template match="span">
96
<xsl:element name="span">
98
<xsl:when test="@class = 'B'">
99
<xsl:attribute name="style">
103
<xsl:when test="@class = 'I'">
104
<xsl:attribute name="style">
110
<xsl:value-of select="."/>
114
<xsl:template match="a">
115
<xsl:element name="a">
116
<xsl:attribute name="href">
117
<xsl:value-of select="@href"/>
120
<xsl:apply-templates select="span|br"/>
124
<xsl:template name="html.head.custom">
126
The following javascript function fixes up the indent of sheets
127
correctly. The indent should be some number of character widths, but
128
you can't do that in CSS, so we have something like "7ex" as a
129
stand-in (but ex is too thin here). There's an invisible div with
130
the correct styling and a single character which we measure the
131
width of and update each sheet as required.
133
<script type="text/javascript" language="javascript">
135
$(document).ready (function () {
136
var div = document.getElementById("invisible-char");
137
var width = div.clientWidth;
139
var all_divs = document.getElementsByTagName("div");
140
for (var i=0; i < all_divs.length; i++) {
141
var elt = all_divs[i];
142
if (elt.getAttribute("class") == "sheet") {
143
var indent_str = elt.style.marginLeft;
144
var indent = indent_str.substr (0, indent_str.length - 2);
146
elt.style.marginLeft = width * indent + "px";