mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-09 23:13:58 +00:00
Support the alt tag in headername and macroname. Also make headername
and macroname valid. Refs #1977 [SVN r51389]
This commit is contained in:
parent
9f3c6f9243
commit
9d06dbbaae
@ -160,8 +160,8 @@
|
|||||||
<entity name="local.tech.char.class"
|
<entity name="local.tech.char.class"
|
||||||
type="param"
|
type="param"
|
||||||
>
|
>
|
||||||
<text-expanded>|functionname|libraryname|enumname|code</text-expanded>
|
<text-expanded>|functionname|libraryname|enumname|headername|macroname|code</text-expanded>
|
||||||
<text>|functionname|libraryname|enumname|code</text>
|
<text>|functionname|libraryname|enumname|headername|macroname|code</text>
|
||||||
</entity>
|
</entity>
|
||||||
|
|
||||||
<entity name="function.module"
|
<entity name="function.module"
|
||||||
@ -1064,11 +1064,17 @@
|
|||||||
</element>
|
</element>
|
||||||
|
|
||||||
<attlist name="macroname">
|
<attlist name="macroname">
|
||||||
<attdecl> %boost.common.attrib;</attdecl>
|
<attdecl>
|
||||||
|
alt CDATA #IMPLIED
|
||||||
|
%boost.common.attrib;</attdecl>
|
||||||
<attribute name="last-revision"
|
<attribute name="last-revision"
|
||||||
type="#IMPLIED"
|
type="#IMPLIED"
|
||||||
value="CDATA"
|
value="CDATA"
|
||||||
default=""/>
|
default=""/>
|
||||||
|
<attribute name="alt"
|
||||||
|
type="#IMPLIED"
|
||||||
|
value="CDATA"
|
||||||
|
default=""/>
|
||||||
<attribute name="id"
|
<attribute name="id"
|
||||||
type="#IMPLIED"
|
type="#IMPLIED"
|
||||||
value="CDATA"
|
value="CDATA"
|
||||||
@ -1389,11 +1395,17 @@
|
|||||||
</element>
|
</element>
|
||||||
|
|
||||||
<attlist name="headername">
|
<attlist name="headername">
|
||||||
<attdecl> %boost.common.attrib;</attdecl>
|
<attdecl>
|
||||||
|
alt CDATA #IMPLIED
|
||||||
|
%boost.common.attrib;</attdecl>
|
||||||
<attribute name="last-revision"
|
<attribute name="last-revision"
|
||||||
type="#IMPLIED"
|
type="#IMPLIED"
|
||||||
value="CDATA"
|
value="CDATA"
|
||||||
default=""/>
|
default=""/>
|
||||||
|
<attribute name="alt"
|
||||||
|
type="#IMPLIED"
|
||||||
|
value="CDATA"
|
||||||
|
default=""/>
|
||||||
<attribute name="id"
|
<attribute name="id"
|
||||||
type="#IMPLIED"
|
type="#IMPLIED"
|
||||||
value="CDATA"
|
value="CDATA"
|
||||||
|
@ -748,6 +748,7 @@
|
|||||||
<tbody>
|
<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>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>
|
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@ -1043,6 +1044,7 @@
|
|||||||
<tbody>
|
<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>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>
|
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
|
@ -313,10 +313,14 @@
|
|||||||
%boost.common.attrib;>
|
%boost.common.attrib;>
|
||||||
|
|
||||||
<!ELEMENT macroname (#PCDATA)>
|
<!ELEMENT macroname (#PCDATA)>
|
||||||
<!ATTLIST macroname %boost.common.attrib;>
|
<!ATTLIST macroname
|
||||||
|
alt CDATA #IMPLIED
|
||||||
|
%boost.common.attrib;>
|
||||||
|
|
||||||
<!ELEMENT headername (#PCDATA)>
|
<!ELEMENT headername (#PCDATA)>
|
||||||
<!ATTLIST headername %boost.common.attrib;>
|
<!ATTLIST headername
|
||||||
|
alt CDATA #IMPLIED
|
||||||
|
%boost.common.attrib;>
|
||||||
|
|
||||||
<!ELEMENT globalname (#PCDATA)>
|
<!ELEMENT globalname (#PCDATA)>
|
||||||
<!ATTLIST globalname
|
<!ATTLIST globalname
|
||||||
@ -415,7 +419,7 @@
|
|||||||
name CDATA #IMPLIED>
|
name CDATA #IMPLIED>
|
||||||
|
|
||||||
<!--========== Customize the DocBook DTD ==========-->
|
<!--========== 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
|
<!ENTITY % local.para.class
|
||||||
"|using-namespace|using-class|librarylist|librarycategorylist">
|
"|using-namespace|using-class|librarylist|librarycategorylist">
|
||||||
<!ENTITY % local.descobj.class "|libraryinfo">
|
<!ENTITY % local.descobj.class "|libraryinfo">
|
||||||
|
16
test/Jamfile.v2
Normal file
16
test/Jamfile.v2
Normal 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
40
test/alt.xml
Normal 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>
|
@ -271,7 +271,16 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="macroname" mode="annotation">
|
<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:variable name="node" select="key('macros', $name)"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
@ -291,7 +300,7 @@
|
|||||||
<xsl:with-param name="node" select="$node"/>
|
<xsl:with-param name="node" select="$node"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
<xsl:with-param name="text" select="$name"/>
|
<xsl:with-param name="text" select="string(.)"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
|
||||||
@ -307,7 +316,16 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="headername" mode="annotation">
|
<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:variable name="node" select="key('headers', $name)"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
@ -327,7 +345,7 @@
|
|||||||
<xsl:with-param name="node" select="$node"/>
|
<xsl:with-param name="node" select="$node"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
<xsl:with-param name="text" select="$name"/>
|
<xsl:with-param name="text" select="string(.)"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user