You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/09/04 22:05:14 UTC
[tomcat-connectors] 01/03: Align with Tomcat 11 stylesheet
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-connectors.git
commit 2bc02d3c72775a26d780fcde4fae49fbbfd92a9a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Sep 4 22:57:50 2023 +0100
Align with Tomcat 11 stylesheet
Add PR support
Format clean-up
---
xdocs/tomcat-docs.xsl | 167 ++++++++++++++++++++++++--------------------------
1 file changed, 81 insertions(+), 86 deletions(-)
diff --git a/xdocs/tomcat-docs.xsl b/xdocs/tomcat-docs.xsl
index 8f517def9..5ea103d69 100644
--- a/xdocs/tomcat-docs.xsl
+++ b/xdocs/tomcat-docs.xsl
@@ -20,7 +20,6 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0">
-
<!-- Output method -->
<xsl:output method="html"
html-version="5.0"
@@ -28,8 +27,7 @@
indent="no"
doctype-system="about:legacy-compat"/>
-
- <!-- Defined parameters (overrideable) -->
+ <!-- Defined parameters (overridable) -->
<xsl:param name="home-name" select="'The Tomcat Project'"/>
<xsl:param name="home-href" select="'https://tomcat.apache.org/'"/>
<xsl:param name="home-logo" select="'/images/tomcat.png'"/>
@@ -44,6 +42,7 @@
<xsl:param name="build-date-iso-8601" select="'yyyy-MM-dd'"/>
<xsl:param name="year" select="'yyyy'"/>
<xsl:param name="buglink" select="'https://bz.apache.org/bugzilla/show_bug.cgi?id='"/>
+ <xsl:param name="prlink" select="'https://github.com/apache/tomcat-connectors/pull/'"/>
<xsl:param name="revlink" select="'https://svn.apache.org/viewvc?view=rev&rev='"/>
<xsl:param name="doclink" select="'https://tomcat.apache.org/connectors-doc'"/>
<xsl:param name="sylink" select="'https://tomcat.apache.org/security-jk.html'"/>
@@ -54,13 +53,13 @@
<!-- Defined variables (non-overrideable) -->
<xsl:variable name="project-xml-filename"><xsl:value-of select="$subdir"/>project.xml</xsl:variable>
<xsl:variable name="project"
- select="document($project-xml-filename)/project"/>
+ select="document($project-xml-filename)/project"/>
<!-- Process an entire document into an HTML page -->
<xsl:template match="document">
<html lang="en">
<head>
- <!-- Note: XLST seems to always output a
+ <!-- Note: XSLT seems to always output a
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
when method="html",
therefore we can't use
@@ -87,41 +86,42 @@
-->
<meta name="author" content="{$name}"/>
</xsl:for-each>
+</head>
- </head>
-
- <body>
+<body>
<div id="wrapper">
<!-- Header -->
- <header><div id="header">
- <div>
+ <header>
+ <div id="header">
<div>
- <xsl:if test="$project/logo">
+ <div>
+ <xsl:if test="$project/logo">
+ <xsl:variable name="src">
+ <xsl:value-of select="$relative-path"/><xsl:value-of select="$home-logo"/>
+ </xsl:variable>
+ <div class="logo noPrint">
+ <a href="{$project/@href}"><img alt="Tomcat Home" src="{$src}"/></a>
+ </div>
+ </xsl:if>
+
+ <div style="height: 1px;"/>
<xsl:variable name="src">
- <xsl:value-of select="$relative-path"/><xsl:value-of select="$home-logo"/>
+ <xsl:value-of select="$relative-path"/><xsl:value-of select="$apache-logo"/>
</xsl:variable>
- <div class="logo noPrint">
- <a href="{$project/@href}"><img alt="Tomcat Home" src="{$src}"/></a>
+ <div class="asfLogo noPrint">
+ <a href="https://www.apache.org/" target="_blank"><img src="{$src}" alt="The Apache Software Foundation" style="width: 266px; height: 83px;"/></a>
</div>
- </xsl:if>
-
- <div style="height: 1px;"/>
- <xsl:variable name="src">
- <xsl:value-of select="$relative-path"/><xsl:value-of select="$apache-logo"/>
- </xsl:variable>
- <div class="asfLogo noPrint">
- <a href="https://www.apache.org/" target="_blank"><img src="{$src}" alt="The Apache Software Foundation" style="width: 266px; height: 83px;"/></a>
- </div>
- <h1><xsl:value-of select="$project/title"/></h1>
- <div class="versionInfo">
- Version <xsl:value-of select="$version"/>,
- <time datetime="{$build-date-iso-8601}"><xsl:value-of select="$build-date"/></time>
+ <h1><xsl:value-of select="$project/title"/></h1>
+ <div class="versionInfo">
+ Version <xsl:value-of select="$version"/>,
+ <time datetime="{$build-date-iso-8601}"><xsl:value-of select="$build-date"/></time>
+ </div>
+ <div style="height: 1px;"/>
+ <div style="clear: left;"/>
</div>
- <div style="height: 1px;"/>
- <div style="clear: left;"/>
</div>
</div>
- </div></header>
+ </header>
<div id="middle">
<div>
@@ -136,36 +136,34 @@
<div id="mainRight">
<div id="content">
<!-- Main Part -->
- <h2><xsl:value-of select="properties/title"/></h2>
- <xsl:apply-templates select="body/section"/>
+ <h2><xsl:value-of select="properties/title"/></h2>
+ <xsl:apply-templates select="body/section"/>
</div>
</div>
</div>
</div>
<!-- Footer -->
- <footer><div id="footer">
+ <footer>
+ <div id="footer">
Copyright © 1999-<xsl:value-of select="$year"/>, The Apache Software Foundation
- </div></footer>
-</div>
+ </div>
+ </footer>
+ </div>
</body>
</html>
-
-
</xsl:template>
-
<!-- Process a menu for the navigation bar -->
<xsl:template match="menu">
- <div>
- <h2><xsl:value-of select="@name"/></h2>
- <ul>
- <xsl:apply-templates select="item"/>
- </ul>
- </div>
+ <div>
+ <h2><xsl:value-of select="@name"/></h2>
+ <ul>
+ <xsl:apply-templates select="item"/>
+ </ul>
+ </div>
</xsl:template>
-
<!-- Process a menu item for the navigation bar -->
<xsl:template match="item">
<xsl:variable name="href">
@@ -174,7 +172,6 @@
<li><a href="{$href}"><xsl:value-of select="@name"/></a></li>
</xsl:template>
-
<!-- Process a documentation section -->
<xsl:template match="section">
<xsl:variable name="name2">
@@ -191,7 +188,6 @@
<xsl:value-of select="translate($name2, ' #', '__')"/>
</xsl:variable>
-
<!-- Section heading -->
<h3 id="{$name}">
<xsl:if test="@rtext">
@@ -206,10 +202,8 @@
<div class="text">
<xsl:apply-templates/>
</div>
-
</xsl:template>
-
<!-- Process a documentation subsection -->
<xsl:template match="subsection">
<xsl:variable name="name2">
@@ -219,8 +213,7 @@
</xsl:when>
<xsl:otherwise>
<xsl:if test="
- count(//*[self::section or self::subsection][@name=current()/@name]) > 1
- ">
+ count(//*[self::section or self::subsection][@name=current()/@name]) > 1">
<xsl:value-of select="concat(parent::*[self::section or self::subsection]/@name, '/')"/>
</xsl:if>
<xsl:value-of select="@name"/>
@@ -243,10 +236,8 @@
<xsl:apply-templates/>
</div>
</div>
-
</xsl:template>
-
<!-- Generate table of contents -->
<xsl:template match="toc">
<ul><xsl:apply-templates mode="toc" select="following::section"/></ul>
@@ -260,8 +251,7 @@
</xsl:when>
<xsl:otherwise>
<xsl:if test="local-name()='subsection' and
- count(//*[self::section or self::subsection][@name=current()/@name]) > 1
- ">
+ count(//*[self::section or self::subsection][@name=current()/@name]) > 1">
<xsl:value-of select="concat(parent::*[self::section or self::subsection]/@name, '/')"/>
</xsl:if>
<xsl:value-of select="@name"/>
@@ -278,17 +268,16 @@
</li>
</xsl:template>
-
<!-- Process a source code example -->
<xsl:template match="source">
- <div class="codeBox">
- <pre>
- <xsl:if test="@wrapped='true'">
- <xsl:attribute name="class">wrap</xsl:attribute>
- </xsl:if>
- <code><xsl:apply-templates/></code>
- </pre>
- </div>
+ <div class="codeBox">
+ <pre>
+ <xsl:if test="@wrapped='true'">
+ <xsl:attribute name="class">wrap</xsl:attribute>
+ </xsl:if>
+ <code><xsl:apply-templates/></code>
+ </pre>
+ </div>
</xsl:template>
<!-- Process an attributes list with nested attribute elements -->
@@ -511,73 +500,79 @@
<xsl:template match="changelog/add">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/add.gif</xsl:variable>
<li>
- <img alt="Add: " class="icon" src="{$src}"/><xsl:apply-templates/>
- </li>
+ <img alt="Add: " class="icon" src="{$src}"/><xsl:apply-templates/>
+ </li>
</xsl:template>
<xsl:template match="changelog/update">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/update.gif</xsl:variable>
<li>
- <img alt="Update: " class="icon" src="{$src}"/><xsl:apply-templates/>
- </li>
+ <img alt="Update: " class="icon" src="{$src}"/><xsl:apply-templates/>
+ </li>
</xsl:template>
<xsl:template match="changelog/design">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/design.gif</xsl:variable>
<li>
- <img alt="Design: " class="icon" src="{$src}"/><xsl:apply-templates/>
- </li>
+ <img alt="Design: " class="icon" src="{$src}"/><xsl:apply-templates/>
+ </li>
</xsl:template>
<xsl:template match="changelog/docs">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/docs.gif</xsl:variable>
<li>
- <img alt="Docs: " class="icon" src="{$src}"/><xsl:apply-templates/>
- </li>
+ <img alt="Docs: " class="icon" src="{$src}"/><xsl:apply-templates/>
+ </li>
</xsl:template>
<xsl:template match="changelog/fix">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/fix.gif</xsl:variable>
<li>
- <img alt="Fix: " class="icon" src="{$src}"/><xsl:apply-templates/>
- </li>
+ <img alt="Fix: " class="icon" src="{$src}"/><xsl:apply-templates/>
+ </li>
</xsl:template>
<xsl:template match="changelog/scode">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/code.gif</xsl:variable>
<li>
- <img alt="Code: " class="icon" src="{$src}"/><xsl:apply-templates/>
- </li>
+ <img alt="Code: " class="icon" src="{$src}"/><xsl:apply-templates/>
+ </li>
</xsl:template>
<!-- Link to a bug report -->
<xsl:template match="bug">
- <xsl:variable name="link"><xsl:value-of select="$buglink"/><xsl:value-of select="text()"/></xsl:variable>
- <a href="{$link}"><xsl:apply-templates/></a>
+ <xsl:variable name="link"><xsl:value-of select="$buglink"/><xsl:value-of select="text()"/></xsl:variable>
+ <a href="{$link}"><xsl:apply-templates/></a>
+ </xsl:template>
+
+ <!-- Link to a pull request -->
+ <xsl:template match="pr">
+ <xsl:variable name="link"><xsl:value-of select="$prlink"/><xsl:value-of select="text()"/></xsl:variable>
+ <a href="{$link}">#<xsl:apply-templates/></a>
</xsl:template>
<!-- Link to a SVN revision report -->
<xsl:template match="rev">
- <xsl:variable name="link"><xsl:value-of select="$revlink"/><xsl:value-of select="text()"/></xsl:variable>
- <a href="{$link}">r<xsl:apply-templates/></a>
+ <xsl:variable name="link"><xsl:value-of select="$revlink"/><xsl:value-of select="text()"/></xsl:variable>
+ <a href="{$link}">r<xsl:apply-templates/></a>
</xsl:template>
<!-- Link to online docs -->
<xsl:template match="doc">
- <xsl:variable name="link"><xsl:value-of select="$doclink"/><xsl:value-of select="@path"/></xsl:variable>
- <a href="{$link}"><xsl:apply-templates/></a>
+ <xsl:variable name="link"><xsl:value-of select="$doclink"/><xsl:value-of select="@path"/></xsl:variable>
+ <a href="{$link}"><xsl:apply-templates/></a>
</xsl:template>
<!-- Link to security page -->
<xsl:template match="security">
- <xsl:variable name="link"><xsl:value-of select="$sylink"/></xsl:variable>
- <a href="{$link}"><xsl:apply-templates/></a>
+ <xsl:variable name="link"><xsl:value-of select="$sylink"/></xsl:variable>
+ <a href="{$link}"><xsl:apply-templates/></a>
</xsl:template>
<!-- Link to download page -->
<xsl:template match="download">
- <xsl:variable name="link"><xsl:value-of select="$dllink"/></xsl:variable>
- <a href="{$link}"><xsl:apply-templates/></a>
+ <xsl:variable name="link"><xsl:value-of select="$dllink"/></xsl:variable>
+ <a href="{$link}"><xsl:apply-templates/></a>
</xsl:template>
<!-- Version numbers -->
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org