Support the alt tag in headername and macroname. Also make headername

and macroname valid. Refs #1977

[SVN r51389]
This commit is contained in:
Daniel James 2009-02-22 11:54:18 +00:00
parent 9f3c6f9243
commit 9d06dbbaae
6 changed files with 103 additions and 11 deletions

View File

@ -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"

View File

@ -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>

View File

@ -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">

16
test/Jamfile.v2 Normal file
View File

@ -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
;

40
test/alt.xml Normal file
View File

@ -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>

View File

@ -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>