Site lists in the Handbook
Simon L. Nielsen
simon at FreeBSD.org
Sun Nov 16 14:54:53 UTC 2003
On 2003.11.16 22:14:10 +0900, Hiroki Sato wrote:
> I think I'll commit a patch[*], which is for moving lists of FreeBSD
> mirror sites into doc/share/sgml/mirrors.xml, and generating lists
> used in index.html and handbook from the file dynamically. This should
> make maintenance easier for the maintainers and the translation teams.
>
> Any objections or comments?
I think it's a great idea, but it does mean that doc/ is now always
required to build www/. I think there should be an explicit dependency
from index.html to the mirror xml file, like the attached patch so
make(1) will fail instead of generating an empty mirror dropdown.
I don't think it is a big problem that www/ depend on doc/, since most
people will have doc/ checked out anyway to build the documentation as
part of the web build. This also allows us to reduce the amount of
duplicate meta information in doc/ and www/, at some later point.
Should't it be in share/xml or something like that, since it's not
really sgml? (It's not something I feel strongly about)
A few very minor things, there are some end-of-line whitespace and some
spaces that IMO should be tabs. Should be simple to see in the attached
patches.
Nice work!
--
Simon L. Nielsen
FreeBSD Documentation Team
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/ncvs/www/en/Makefile,v
retrieving revision 1.99
diff -u -r1.99 Makefile
--- Makefile 29 Oct 2003 20:42:50 -0000 1.99
+++ Makefile 16 Nov 2003 14:11:44 -0000
@@ -91,7 +91,7 @@
DATA+= index.html
CLEANFILES+= index.html
-index.html: index.xsl news/news.xml news/press.xml includes.xsl news/includes.xsl security/advisories.xml
+index.html: index.xsl news/news.xml news/press.xml includes.xsl news/includes.xsl security/advisories.xml ../../doc/share/sgml/mirrors.xml
${XSLTPROC} ${XSLTPROCOPTS} -o ${.TARGET} \
${.CURDIR}/index.xsl ${.CURDIR}/news/news.xml
.if !defined(NO_TIDY)
-------------- next part --------------
--- index.xsl.orig Sun Nov 16 15:42:56 2003
+++ index.xsl Sun Nov 16 15:43:09 2003
@@ -50,35 +50,35 @@
which are not mirrored should be listed in
support.sgml. -->
- <xsl:for-each select="document($mirrors)/mirrors/entry[url[contains(@proto, 'httpv6')]]">
- <xsl:for-each select="url[contains(@proto, 'httpv6') and contains(@type, 'www')]">
+ <xsl:for-each select="document($mirrors)/mirrors/entry[url[contains(@proto, 'httpv6')]]">
+ <xsl:for-each select="url[contains(@proto, 'httpv6') and contains(@type, 'www')]">
<option><xsl:attribute name="value"><xsl:value-of select="." /></xsl:attribute>
- <xsl:choose>
- <xsl:when test="last() = 1">
- <xsl:value-of select="concat('IPv6 ', ../country)" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('IPv6 ', ../country, '/', position())" />
- </xsl:otherwise>
- </xsl:choose>
- </option>
- </xsl:for-each>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="last() = 1">
+ <xsl:value-of select="concat('IPv6 ', ../country)" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('IPv6 ', ../country, '/', position())" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </option>
+ </xsl:for-each>
+ </xsl:for-each>
- <xsl:for-each select="document($mirrors)/mirrors/entry[url[contains(@proto, 'http')]]">
- <xsl:for-each select="url[contains(@proto, 'http') and contains(@type, 'www')]">
+ <xsl:for-each select="document($mirrors)/mirrors/entry[url[contains(@proto, 'http')]]">
+ <xsl:for-each select="url[contains(@proto, 'http') and contains(@type, 'www')]">
<option><xsl:attribute name="value"><xsl:value-of select="." /></xsl:attribute>
- <xsl:choose>
- <xsl:when test="last() = 1">
- <xsl:value-of select="../country" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(../country, '/', position())" />
- </xsl:otherwise>
- </xsl:choose>
- </option>
- </xsl:for-each>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="last() = 1">
+ <xsl:value-of select="../country" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(../country, '/', position())" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </option>
+ </xsl:for-each>
+ </xsl:for-each>
</select>
<input type="submit" value=" Go "/>
-------------- next part --------------
--- mirrors.xml.orig Sun Nov 16 15:40:22 2003
+++ mirrors.xml Sun Nov 16 15:41:52 2003
@@ -554,9 +554,9 @@
<entry id="mirrors-ua">
<country>Ukraine</country>
<url proto="http" type="www">http://www.ua.FreeBSD.org/</url>
- <url proto="http" type="www">http://www2.ua.FreeBSD.org/</url>
- <url proto="http" type="www">http://www5.ua.FreeBSD.org/</url>
- <url proto="http" type="www">http://www4.ua.FreeBSD.org/</url>
+ <url proto="http" type="www">http://www2.ua.FreeBSD.org/</url>
+ <url proto="http" type="www">http://www5.ua.FreeBSD.org/</url>
+ <url proto="http" type="www">http://www4.ua.FreeBSD.org/</url>
<url proto="ftp,http">ftp://ftp.ua.FreeBSD.org/pub/FreeBSD/</url>
<url proto="ftp,http">ftp://ftp2.ua.FreeBSD.org/pub/FreeBSD/</url>
<url proto="ftp">ftp://ftp3.ua.FreeBSD.org/pub/FreeBSD/</url>
-------------- next part --------------
--- mirrors.xsl.orig Sun Nov 16 15:40:27 2003
+++ mirrors.xsl Sun Nov 16 15:44:29 2003
@@ -2,54 +2,54 @@
<!-- $FreeBSD$ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
+
<xsl:output type="xml" encoding="iso-8859-1"
- omit-xml-declaration="yes"
- indent="yes"/>
+ omit-xml-declaration="yes"
+ indent="yes"/>
<xsl:template match="/mirrors">
<para>
<xsl:for-each select="entry[url[contains(@proto, $proto)] or host[contains(@proto, $proto)]]">
<link><xsl:attribute name="linkend"><xsl:value-of select="concat(@id, '-', $proto)" /></xsl:attribute>
- <xsl:value-of select="country" /></link>
+ <xsl:value-of select="country" /></link>
<xsl:choose>
- <xsl:when test='position() = last()'><xsl:text>.</xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
+ <xsl:when test='position() = last()'><xsl:text>.</xsl:text></xsl:when>
+ <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</para>
<variablelist>
<xsl:for-each select="entry[url[contains(@proto, $proto)] or host[contains(@proto, $proto)]]">
- <varlistentry>
- <term><anchor><xsl:attribute name="id"><xsl:value-of select="concat(@id, '-', $proto)" /></xsl:attribute>
- </anchor><xsl:value-of select="country" /></term>
+ <varlistentry>
+ <term><anchor><xsl:attribute name="id"><xsl:value-of select="concat(@id, '-', $proto)" /></xsl:attribute>
+ </anchor><xsl:value-of select="country" /></term>
<listitem>
- <xsl:if test="$proto = 'ftp' and email">
- <para>In case of problems, please contact the hostmaster
- <email><xsl:value-of select="email" /></email> for this domain.</para>
- </xsl:if>
-
- <itemizedlist>
- <xsl:for-each select="child::*[contains(@proto, $proto)]">
- <listitem>
- <para>
- <xsl:choose>
- <xsl:when test="self::url">
- <ulink><xsl:attribute name="url"><xsl:value-of select="." /></xsl:attribute>
- </ulink>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="." />
- </xsl:otherwise>
- </xsl:choose>
- </para>
- </listitem>
- </xsl:for-each>
- </itemizedlist>
+ <xsl:if test="$proto = 'ftp' and email">
+ <para>In case of problems, please contact the hostmaster
+ <email><xsl:value-of select="email" /></email> for this domain.</para>
+ </xsl:if>
+
+ <itemizedlist>
+ <xsl:for-each select="child::*[contains(@proto, $proto)]">
+ <listitem>
+ <para>
+ <xsl:choose>
+ <xsl:when test="self::url">
+ <ulink><xsl:attribute name="url"><xsl:value-of select="." /></xsl:attribute>
+ </ulink>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="." />
+ </xsl:otherwise>
+ </xsl:choose>
+ </para>
+ </listitem>
+ </xsl:for-each>
+ </itemizedlist>
</listitem>
- </varlistentry>
+ </varlistentry>
</xsl:for-each>
</variablelist>
</xsl:template>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-doc/attachments/20031116/6e94d0f3/attachment.sig>
More information about the freebsd-doc
mailing list