mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-09 23:13:58 +00:00
Fully merge boostbook from trunk.
- Optionally use section ids as a class name for CSS styling, by using the `boost.section.class.add.id` parameter. - Add the `role` attribute to the class for `section` and `simplesect`. - Update the single html template to be closer to the chunked html. - Fix the encoding for single page html. - Add option to permit single depth TOC at chapter level, while maintaining multi-depth TOC at subsequent levels. Use the `boost.noexpand.chapter.toc` parameter. - Add some C++11 keywords to the syntax highlighter. - Support the fixed-length `$Date:: $` subversion keyword in last-revision library attributes. [SVN r85047]
This commit is contained in:
parent
cfe6f00c51
commit
dfe3b4dfe5
@ -10,11 +10,16 @@
|
||||
<xsl:stylesheet version = "1.0"
|
||||
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
|
||||
>
|
||||
|
||||
<!-- needed for calsTable template -->
|
||||
|
||||
<xsl:import
|
||||
href="http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl"/>
|
||||
|
||||
<!-- Optionally add the section id to each section's class.
|
||||
This is useful if you want to style individual sections differently. -->
|
||||
<xsl:param name="boost.section.class.add.id" select="0"/>
|
||||
|
||||
<!--
|
||||
Override the behaviour of some DocBook elements for better
|
||||
integration with the new look & feel.
|
||||
@ -208,4 +213,50 @@
|
||||
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Adds role class for section element resulting div. So that
|
||||
we can style them in the resulting HTML.
|
||||
Also, add the section id, if boost.section.class.add.id = 1.
|
||||
This can be used to style individual sections differently. -->
|
||||
<xsl:template match="section" mode="class.value">
|
||||
<xsl:param name="class" select="local-name(.)"/>
|
||||
<xsl:param name="node" select="."/>
|
||||
<xsl:variable name="id">
|
||||
<xsl:if test="$boost.section.class.add.id">
|
||||
<xsl:call-template name="object.id">
|
||||
<xsl:with-param name="object" select="$node"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="normalize-space(concat($class, ' ',
|
||||
@role, ' ', translate($id, '.', '_')))"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Adds role class for simplesect element resulting div. So that
|
||||
we can style them in the resulting HTML. -->
|
||||
<xsl:template match="simplesect" mode="class.value">
|
||||
<xsl:param name="class" select="local-name(.)"/>
|
||||
<xsl:param name="node" select="."/>
|
||||
<xsl:value-of select="normalize-space(concat($class,' ',@role))"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Allow for specifying that a section should not include the parents
|
||||
labeling. This allows us to start clean numering of a sub-section. -->
|
||||
<xsl:template match="section[@label-style='no-parent']" mode="label.markup">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@label">
|
||||
<xsl:value-of select="@label"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$label != 0">
|
||||
<xsl:variable name="format">
|
||||
<xsl:call-template name="autolabel.format">
|
||||
<xsl:with-param name="format" select="$section.autolabel"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:number format="{$format}" count="section"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -35,6 +35,8 @@
|
||||
<xsl:param name="boost.mathjax" select="0"/>
|
||||
<xsl:param name="boost.mathjax.script"
|
||||
select="'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'"/>
|
||||
<!--See usage below for explanation of this param-->
|
||||
<xsl:param name="boost.noexpand.chapter.toc" select="0"/>
|
||||
|
||||
<xsl:param name="admon.style"/>
|
||||
<xsl:param name="admon.graphics">1</xsl:param>
|
||||
@ -138,9 +140,9 @@ set toc,title
|
||||
<xsl:template name="format.svn.revision">
|
||||
<xsl:param name="text"/>
|
||||
|
||||
<!-- Remove the "$Date: " -->
|
||||
<!-- Remove the "$Date: " or "$Date:: " -->
|
||||
<xsl:variable name="text.noprefix"
|
||||
select="substring-after($text, '$Date: ')"/>
|
||||
select="substring-after($text, ': ')"/>
|
||||
|
||||
<!-- Grab the year -->
|
||||
<xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
|
||||
@ -182,8 +184,10 @@ set toc,title
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
|
||||
$time, ' ', $timezone)"/>
|
||||
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year)"/>
|
||||
<xsl:if test="$time != ''">
|
||||
<xsl:value-of select="concat(' at ', $time, ' ', $timezone)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Footer Copyright -->
|
||||
@ -380,4 +384,33 @@ set toc,title
|
||||
<xsl:value-of select="'index'"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="preface|chapter|appendix|article" mode="toc">
|
||||
<xsl:param name="toc-context" select="."/>
|
||||
|
||||
<!--
|
||||
When boost.noexpand.chapter.toc is set to 1, then the TOC for
|
||||
chapters is only one level deep (ie toc.max.depth has no effect)
|
||||
and nested sections within chapters are not shown. TOC's and LOC's
|
||||
at other levels are not effected and respond to toc.max.depth as normal.
|
||||
-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="local-name($toc-context) = 'book' and $boost.noexpand.chapter.toc = 1">
|
||||
<xsl:call-template name="subtoc">
|
||||
<xsl:with-param name="toc-context" select="$toc-context"/>
|
||||
<xsl:with-param name="nodes" select="foo"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="subtoc">
|
||||
<xsl:with-param name="toc-context" select="$toc-context"/>
|
||||
<xsl:with-param name="nodes"
|
||||
select="section|sect1|glossary|bibliography|index
|
||||
|bridgehead[$bridgehead.in.toc != 0]"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
|
@ -78,9 +78,9 @@
|
||||
<xsl:template name="format.svn.revision">
|
||||
<xsl:param name="text"/>
|
||||
|
||||
<!-- Remove the "$Date: " -->
|
||||
<!-- Remove the "$Date: " or "$Date:: " -->
|
||||
<xsl:variable name="text.noprefix"
|
||||
select="substring-after($text, '$Date: ')"/>
|
||||
select="substring-after($text, ': ')"/>
|
||||
|
||||
<!-- Grab the year -->
|
||||
<xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
|
||||
@ -122,8 +122,10 @@
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
|
||||
$time, ' ', $timezone)"/>
|
||||
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year)"/>
|
||||
<xsl:if test="$time != ''">
|
||||
<xsl:value-of select="concat(' at ', $time, ' ', $timezone)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- We don't want refentry's to show up in the TOC because they
|
||||
|
@ -13,8 +13,20 @@
|
||||
<!-- Import the HTML stylesheet -->
|
||||
<xsl:import
|
||||
href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
|
||||
<xsl:import href="admon.xsl"/>
|
||||
<xsl:import href="relative-href.xsl"/>
|
||||
<xsl:import
|
||||
href="http://docbook.sourceforge.net/release/xsl/current/html/math.xsl"/>
|
||||
|
||||
<xsl:output method="html" encoding="US-ASCII" indent="no"/>
|
||||
|
||||
<!-- We have to make sure that our templates override all
|
||||
docbook templates. Therefore, we include our own templates
|
||||
instead of importing them. In order for this to work,
|
||||
the stylesheets included here cannot also include each other -->
|
||||
<xsl:include href="docbook-layout.xsl"/>
|
||||
<xsl:include href="admon.xsl"/>
|
||||
<xsl:include href="xref.xsl"/>
|
||||
<xsl:include href="relative-href.xsl"/>
|
||||
<xsl:include href="callout.xsl"/>
|
||||
|
||||
<xsl:param name="admon.style"/>
|
||||
<xsl:param name="admon.graphics">1</xsl:param>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<xsl:variable name="digits" select="'1234567890'"/>
|
||||
<xsl:variable name="number-chars" select="'1234567890abcdefABCDEFxX.'"/>
|
||||
<xsl:variable name="keywords"
|
||||
select="' asm auto bool break case catch char class const const_cast continue default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new operator private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while '"/>
|
||||
select="' alignas ailgnof asm auto bool break case catch char char16_t char32_t class const const_cast constexpr continue decltype default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new noexcept nullptr operator private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this thread_local throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while '"/>
|
||||
<xsl:variable name="operators4" select="'%:%:'"/>
|
||||
<xsl:variable name="operators3" select="'>>= <<= ->* ...'"/>
|
||||
<xsl:variable name="operators2" select="'.* :: ## <: :> <% %> %: += -= *= /= %= ^= &= |= << >> == != <= >= && || ++ -- ->'"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user