Lines 1192-1198
Link Here
|
1192 |
<xsl:choose> |
1192 |
<xsl:choose> |
1193 |
<xsl:when test="($TTOP = 'book') and ($full = 0) and (starts-with(@link, '?'))"> |
1193 |
<xsl:when test="($TTOP = 'book') and ($full = 0) and (starts-with(@link, '?'))"> |
1194 |
<!-- Handbook link pointing to another part/chapter, normal case --> |
1194 |
<!-- Handbook link pointing to another part/chapter, normal case --> |
1195 |
<a href="{$LINK}{@link}"><xsl:apply-templates/></a> |
1195 |
<xsl:choose> |
|
|
1196 |
<xsl:when test="$style != 'printable'"> |
1197 |
<a href="{$LINK}{@link}"><xsl:apply-templates/></a> |
1198 |
</xsl:when> |
1199 |
<xsl:otherwise> |
1200 |
<a href="{$LINK}{@link}&style=printable"><xsl:apply-templates/></a> |
1201 |
</xsl:otherwise> |
1202 |
</xsl:choose> |
1196 |
</xsl:when> |
1203 |
</xsl:when> |
1197 |
<xsl:when test="($TTOP = 'book') and ($full = 1) and (starts-with(@link, '?'))"> |
1204 |
<xsl:when test="($TTOP = 'book') and ($full = 1) and (starts-with(@link, '?'))"> |
1198 |
<!-- Handbook link pointing to another part/chapter |
1205 |
<!-- Handbook link pointing to another part/chapter |
Lines 1240-1246
Link Here
|
1240 |
</xsl:choose> |
1247 |
</xsl:choose> |
1241 |
</xsl:when> |
1248 |
</xsl:when> |
1242 |
<xsl:otherwise> |
1249 |
<xsl:otherwise> |
1243 |
<a href="{@link}"><xsl:apply-templates/></a> |
1250 |
<!-- Strip http://www.gentoo.org from links but leave links to viewcvs intact |
|
|
1251 |
Has no effect on actual www.g.o but helps when surfing on a local copy --> |
1252 |
<xsl:variable name="llink"> |
1253 |
<xsl:choose> |
1254 |
<xsl:when test="starts-with(@link, 'http://www.gentoo.org/cgi-bin/')"><xsl:value-of select="@link" /></xsl:when> |
1255 |
<xsl:when test="starts-with(@link, 'http://www.gentoo.org/')"><xsl:value-of select="substring-after(@link, 'http://www.gentoo.org')" /></xsl:when> |
1256 |
<xsl:otherwise><xsl:value-of select="@link" /></xsl:otherwise> |
1257 |
</xsl:choose> |
1258 |
</xsl:variable> |
1259 |
|
1260 |
<!-- Now, insert style=printable in the URL if necessary --> |
1261 |
<xsl:variable name="alink"> |
1262 |
<xsl:choose> |
1263 |
<xsl:when test="$style != 'printable' or contains($llink, 'style=printable')"> |
1264 |
<!-- Not printable style or style=printable already in URL, copy link --> |
1265 |
<xsl:value-of select="$llink" /> |
1266 |
</xsl:when> |
1267 |
<xsl:when test="contains($llink, '://')"> |
1268 |
<!-- External link, copy link --> |
1269 |
<xsl:value-of select="$llink" /> |
1270 |
</xsl:when> |
1271 |
<xsl:when test="starts-with($llink, '#')"> |
1272 |
<!-- Anchor, copy link --> |
1273 |
<xsl:value-of select="$llink" /> |
1274 |
</xsl:when> |
1275 |
<xsl:otherwise> |
1276 |
<!-- We should have eliminated all other cases, |
1277 |
style printable, local link, then insert ?style=printable --> |
1278 |
<xsl:choose> |
1279 |
<xsl:when test="starts-with($llink, '?')"> |
1280 |
<xsl:value-of select="concat( '?style=printable&', substring-after($llink, '?'))" /> |
1281 |
</xsl:when> |
1282 |
<xsl:when test="contains($llink, '.xml?')"> |
1283 |
<xsl:value-of select="concat(substring-before($llink, '.xml?'), '.xml?style=printable&', substring-after($llink, '.xml?'))" /> |
1284 |
</xsl:when> |
1285 |
<xsl:when test="contains($llink, '.xml#')"> |
1286 |
<xsl:value-of select="concat(substring-before($llink, '.xml#'), '.xml?style=printable#', substring-after($llink, '.xml#'))" /> |
1287 |
</xsl:when> |
1288 |
<xsl:when test="substring-after($llink, '.xml') = ''"> |
1289 |
<xsl:value-of select="concat($llink, '?style=printable')" /> |
1290 |
</xsl:when> |
1291 |
<xsl:otherwise> |
1292 |
<!-- Have I forgotten anything? |
1293 |
Copy link --> |
1294 |
<xsl:value-of select="$llink" /> |
1295 |
</xsl:otherwise> |
1296 |
</xsl:choose> |
1297 |
</xsl:otherwise> |
1298 |
</xsl:choose> |
1299 |
</xsl:variable> |
1300 |
<a href="{$alink}"><xsl:apply-templates/></a> |
1244 |
</xsl:otherwise> |
1301 |
</xsl:otherwise> |
1245 |
</xsl:choose> |
1302 |
</xsl:choose> |
1246 |
</xsl:when> |
1303 |
</xsl:when> |