- Use more human-friendly pubdate and releaseinfo renderings

- Merge copyright years into intervals
- Try to produce cleaner XHTML
This commit is contained in:
Gabor Kovesdan 2013-04-05 13:11:11 +00:00
parent 1ed4fc6cb7
commit d518220b58
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/projects/xml-tools/; revision=41372
5 changed files with 149 additions and 70 deletions

View file

@ -19,7 +19,7 @@
<corpauthor>The FreeBSD Documentation Project</corpauthor>
<pubdate>February 1999</pubdate>
<pubdate>$FreeBSD$</pubdate>
<releaseinfo>$FreeBSD$</releaseinfo>

View file

@ -12,7 +12,13 @@
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
<xsl:template match="pubdate"/>
<xsl:template name="svnweb.link">
<xsl:param name="repo" select="'base'"/>
<xsl:param name="rev"/>
<xsl:value-of select="concat('http://svnweb.freebsd.org/', $repo,
'?view=revision&amp;revision=', $rev)"/>
</xsl:template>
<xsl:param name="toc.section.depth" select="1"/>
<xsl:param name="section.autolabel" select="1"/>

View file

@ -5,6 +5,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'
xmlns="http://www.w3.org/TR/xhtml1/transitional"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str"
exclude-result-prefixes="#default">
<!-- Include the common customizations -->
@ -21,6 +23,11 @@
<xsl:param name="callout.graphics.path" select="'./imagelib/callouts/'"/>
<xsl:param name="citerefentry.link" select="1"/>
<xsl:param name="admon.style"/>
<xsl:param name="make.year.ranges" select="1"/>
<xsl:param name="make.single.year.ranges" select="1"/>
<xsl:param name="make.valid.html" select="1"/>
<xsl:param name="html.cleanup" select="1"/>
<xsl:template name="user.footer.navigation">
<p align="center"><small>This, and other documents, can be downloaded
@ -32,19 +39,28 @@
For questions about this documentation, e-mail &lt;<a href="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&gt;.</small></p>
</xsl:template>
<xsl:template match="svnref">
<xsl:template name="svnref.genlink">
<xsl:param name="rev" select="."/>
<xsl:param name="repo" select="'base'"/>
<a>
<xsl:attribute name="href">
<xsl:text>http://svnweb.freebsd.org/base?view=revision&amp;revision=</xsl:text>
<xsl:value-of select="."/>
<xsl:call-template name="svnweb.link">
<xsl:with-param name="repo" select="$repo"/>
<xsl:with-param name="rev" select="$rev"/>
</xsl:call-template>
</xsl:attribute>
<span class="svnref">
<xsl:value-of select="."/>
<xsl:value-of select="$rev"/>
</span>
</a>
</xsl:template>
<xsl:template match="svnref">
<xsl:call-template name="svnref.genlink"/>
</xsl:template>
<xsl:template name="generate.citerefentry.link">
<xsl:text>http://www.FreeBSD.org/cgi/man.cgi?query=</xsl:text>
<xsl:value-of select="refentrytitle"/>
@ -131,4 +147,29 @@
<xsl:template name="section.author">
<xsl:call-template name="freebsd.author"/>
</xsl:template>
<xsl:template name="titlepage.releaseinfo">
<xsl:variable name="rev" select="str:split(., ' ')[3]"/>
Current Revision:
<xsl:call-template name="svnref.genlink">
<xsl:with-param name="repo" select="'doc'"/>
<xsl:with-param name="rev" select="$rev"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="titlepage.pubdate">
<xsl:variable name="pubdate">
<xsl:choose>
<xsl:when test="contains(., '$FreeBSD')">
<xsl:value-of select="str:split(., ' ')[4]"/> by <xsl:value-of select="str:split(., ' ')[6]"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Last modified on <xsl:value-of select="$pubdate"/>.
</xsl:template>
</xsl:stylesheet>

View file

@ -168,7 +168,8 @@
<xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -186,7 +187,8 @@
<xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -355,7 +357,8 @@
<xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -373,7 +376,8 @@
<xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -542,7 +546,8 @@
<xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -560,7 +565,8 @@
<xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -729,7 +735,8 @@
<xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -747,7 +754,8 @@
<xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -933,7 +941,8 @@
<xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -951,7 +960,8 @@
<xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -1137,7 +1147,8 @@
<xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -1155,7 +1166,8 @@
<xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -1580,7 +1592,8 @@
<xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -1598,7 +1611,8 @@
<xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -1786,7 +1800,8 @@
<xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -1804,7 +1819,8 @@
<xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -1990,7 +2006,8 @@
<xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -2008,7 +2025,8 @@
<xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -2179,7 +2197,8 @@
<xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -2197,7 +2216,8 @@
<xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -2368,7 +2388,8 @@
<xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -2386,7 +2407,8 @@
<xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -2557,7 +2579,8 @@
<xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -2575,7 +2598,8 @@
<xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -2746,7 +2770,8 @@
<xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -2764,7 +2789,8 @@
<xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -2935,7 +2961,8 @@
<xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -2953,7 +2980,8 @@
<xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -3124,7 +3152,8 @@
<xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -3142,7 +3171,8 @@
<xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>
@ -3330,7 +3360,8 @@
<xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.releaseinfo">
</xsl:call-template>
</div>
</xsl:template>
@ -3348,7 +3379,8 @@
<xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
<xsl:call-template name="titlepage.pubdate">
</xsl:call-template>
</div>
</xsl:template>

View file

@ -22,10 +22,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -55,10 +55,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -88,10 +88,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -124,10 +124,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -154,10 +154,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -186,10 +186,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -290,10 +290,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -322,10 +322,10 @@
<authorgroup t:named-template="chapter.authorgroup"/>
<author t:named-template="chapter.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -354,10 +354,10 @@
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -386,10 +386,10 @@
<authorgroup t:named-template="section.authorgroup"/>
<author t:named-template="section.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -417,10 +417,10 @@
<authorgroup t:named-template="section.authorgroup"/>
<author t:named-template="section.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -448,10 +448,10 @@
<authorgroup t:named-template="section.authorgroup"/>
<author t:named-template="section.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -479,10 +479,10 @@
<authorgroup t:named-template="section.authorgroup"/>
<author t:named-template="section.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -510,10 +510,10 @@
<authorgroup t:named-template="section.authorgroup"/>
<author t:named-template="section.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -541,10 +541,10 @@
<authorgroup t:named-template="section.authorgroup"/>
<author t:named-template="section.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>
@ -572,10 +572,10 @@
<authorgroup t:named-template="section.authorgroup"/>
<author t:named-template="section.author"/>
<othercredit/>
<releaseinfo/>
<releaseinfo t:named-template="titlepage.releaseinfo"/>
<copyright/>
<legalnotice/>
<pubdate/>
<pubdate t:named-template="titlepage.pubdate"/>
<revision/>
<revhistory/>
<abstract/>