Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51389 - in trunk/tools/boostbook: doc dtd test xsl
From: daniel_james_at_[hidden]
Date: 2009-02-22 06:54:19


Author: danieljames
Date: 2009-02-22 06:54:18 EST (Sun, 22 Feb 2009)
New Revision: 51389
URL: http://svn.boost.org/trac/boost/changeset/51389

Log:
Support the alt tag in headername and macroname. Also make headername
and macroname valid. Refs #1977
Added:
   trunk/tools/boostbook/test/
   trunk/tools/boostbook/test/Jamfile.v2 (contents, props changed)
   trunk/tools/boostbook/test/alt.xml (contents, props changed)
Text files modified:
   trunk/tools/boostbook/doc/reference.dtdxml | 20 ++++++++++++++++----
   trunk/tools/boostbook/doc/reference.xml | 2 ++
   trunk/tools/boostbook/dtd/boostbook.dtd | 10 +++++++---
   trunk/tools/boostbook/xsl/annotation.xsl | 26 ++++++++++++++++++++++----
   4 files changed, 47 insertions(+), 11 deletions(-)

Modified: trunk/tools/boostbook/doc/reference.dtdxml
==============================================================================
--- trunk/tools/boostbook/doc/reference.dtdxml (original)
+++ trunk/tools/boostbook/doc/reference.dtdxml 2009-02-22 06:54:18 EST (Sun, 22 Feb 2009)
@@ -160,8 +160,8 @@
 <entity name="local.tech.char.class"
         type="param"
>
-<text-expanded>|functionname|libraryname|enumname|code</text-expanded>
-<text>|functionname|libraryname|enumname|code</text>
+<text-expanded>|functionname|libraryname|enumname|headername|macroname|code</text-expanded>
+<text>|functionname|libraryname|enumname|headername|macroname|code</text>
 </entity>
 
 <entity name="function.module"
@@ -1064,11 +1064,17 @@
 </element>
 
 <attlist name="macroname">
-<attdecl> %boost.common.attrib;</attdecl>
+<attdecl>
+ alt CDATA #IMPLIED
+ %boost.common.attrib;</attdecl>
 <attribute name="last-revision"
            type="#IMPLIED"
            value="CDATA"
            default=""/>
+<attribute name="alt"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
 <attribute name="id"
            type="#IMPLIED"
            value="CDATA"
@@ -1389,11 +1395,17 @@
 </element>
 
 <attlist name="headername">
-<attdecl> %boost.common.attrib;</attdecl>
+<attdecl>
+ alt CDATA #IMPLIED
+ %boost.common.attrib;</attdecl>
 <attribute name="last-revision"
            type="#IMPLIED"
            value="CDATA"
            default=""/>
+<attribute name="alt"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
 <attribute name="id"
            type="#IMPLIED"
            value="CDATA"

Modified: trunk/tools/boostbook/doc/reference.xml
==============================================================================
--- trunk/tools/boostbook/doc/reference.xml (original)
+++ trunk/tools/boostbook/doc/reference.xml 2009-02-22 06:54:18 EST (Sun, 22 Feb 2009)
@@ -748,6 +748,7 @@
           <tbody>
 
 <row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
+<row><entry>alt</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry/></row>
 <row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
 </tbody>
         </tgroup>
@@ -1043,6 +1044,7 @@
           <tbody>
 
 <row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
+<row><entry>alt</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry/></row>
 <row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
 </tbody>
         </tgroup>

Modified: trunk/tools/boostbook/dtd/boostbook.dtd
==============================================================================
--- trunk/tools/boostbook/dtd/boostbook.dtd (original)
+++ trunk/tools/boostbook/dtd/boostbook.dtd 2009-02-22 06:54:18 EST (Sun, 22 Feb 2009)
@@ -313,10 +313,14 @@
     %boost.common.attrib;>
 
 <!ELEMENT macroname (#PCDATA)>
-<!ATTLIST macroname %boost.common.attrib;>
+<!ATTLIST macroname
+ alt CDATA #IMPLIED
+ %boost.common.attrib;>
 
 <!ELEMENT headername (#PCDATA)>
-<!ATTLIST headername %boost.common.attrib;>
+<!ATTLIST headername
+ alt CDATA #IMPLIED
+ %boost.common.attrib;>
 
 <!ELEMENT globalname (#PCDATA)>
 <!ATTLIST globalname
@@ -415,7 +419,7 @@
      name CDATA #IMPLIED>
 
 <!--========== Customize the DocBook DTD ==========-->
-<!ENTITY % local.tech.char.class "|functionname|libraryname|enumname|code">
+<!ENTITY % local.tech.char.class "|functionname|libraryname|enumname|headername|macroname|code">
 <!ENTITY % local.para.class
         "|using-namespace|using-class|librarylist|librarycategorylist">
 <!ENTITY % local.descobj.class "|libraryinfo">

Added: trunk/tools/boostbook/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/tools/boostbook/test/Jamfile.v2 2009-02-22 06:54:18 EST (Sun, 22 Feb 2009)
@@ -0,0 +1,16 @@
+# Copyright (c) 2009 Daniel James
+#
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+project boost/test ;
+import boostbook : boostbook ;
+
+boostbook alt : alt.xml :
+ <xsl:param>html.stylesheet=../../../../doc/html/boostbook.css
+ <xsl:param>boost.root=../../../..
+ <xsl:param>boost.libraries=../../../../libs/libraries.htm
+ <xsl:param>navig.graphics=1
+ ;
+

Added: trunk/tools/boostbook/test/alt.xml
==============================================================================
--- (empty file)
+++ trunk/tools/boostbook/test/alt.xml 2009-02-22 06:54:18 EST (Sun, 22 Feb 2009)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML//EN"
+ "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+
+<!--
+ xmllint:
+
+ XML_CATALOG_FILES=../../../bin.v2/boostbook_catalog.xml xmllint -noout -valid alt.xml
+
+-->
+
+<library name="Example" id="test.alt" dirname="test/alt">
+ <libraryinfo>
+ <author>
+ <firstname>Daniel</firstname>
+ <surname>James</surname>
+ </author>
+ <librarypurpose>Fictional example</librarypurpose>
+ </libraryinfo>
+
+ <title>Fictional example library, for testing</title>
+
+ <section id="test.alt.tests">
+ <title>Alt Tests</title>
+
+ <para><headername alt="example.hpp">Example header</headername></para>
+ <para>Example header: <headername>example.hpp</headername></para>
+
+ <para><macroname alt="EXAMPLE">Example macro</macroname></para>
+ <para>Example macro: <macroname>EXAMPLE</macroname></para>
+ </section>
+
+ <library-reference>
+ <header name="example.hpp">
+ <macro name="EXAMPLE" kind="functionlike">
+ <purpose>Example macro</purpose>
+ </macro>
+ </header>
+ </library-reference>
+</library>
\ No newline at end of file

Modified: trunk/tools/boostbook/xsl/annotation.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/annotation.xsl (original)
+++ trunk/tools/boostbook/xsl/annotation.xsl 2009-02-22 06:54:18 EST (Sun, 22 Feb 2009)
@@ -271,7 +271,16 @@
   </xsl:template>
 
   <xsl:template match="macroname" mode="annotation">
- <xsl:param name="name" select="text()"/>
+ <xsl:param name="name">
+ <xsl:choose>
+ <xsl:when test="@alt">
+ <xsl:value-of select="@alt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
 
     <xsl:variable name="node" select="key('macros', $name)"/>
     <xsl:choose>
@@ -291,7 +300,7 @@
               <xsl:with-param name="node" select="$node"/>
             </xsl:call-template>
           </xsl:with-param>
- <xsl:with-param name="text" select="$name"/>
+ <xsl:with-param name="text" select="string(.)"/>
         </xsl:call-template>
       </xsl:when>
 
@@ -307,7 +316,16 @@
   </xsl:template>
 
   <xsl:template match="headername" mode="annotation">
- <xsl:param name="name" select="text()"/>
+ <xsl:variable name="name">
+ <xsl:choose>
+ <xsl:when test="@alt">
+ <xsl:value-of select="@alt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
 
     <xsl:variable name="node" select="key('headers', $name)"/>
     <xsl:choose>
@@ -327,7 +345,7 @@
               <xsl:with-param name="node" select="$node"/>
             </xsl:call-template>
           </xsl:with-param>
- <xsl:with-param name="text" select="$name"/>
+ <xsl:with-param name="text" select="string(.)"/>
         </xsl:call-template>
       </xsl:when>
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk