13
0
livetrax/manual/xsl/html.xsl
Tim Mayberry 9d548f998b Added the BSD licensed xmlformat utility for keeping the xml pretty
and consistant aswell as a configuration file. When I converted the manual
to docbook I was using an old version that I'd modified to insert 
tabs rather than spaces so using it on the existing documentation will 
appear to reformat the whole file. I don't think that matters at this 
stage and I'm tempted to reformat everything now while it isn't an issue.

Rewrote the Makefile that builds the docs so that:
- building the html only depends on having xsltproc installed.
- the xsl and xml files aren't copied to the build directory.
- make test does not remove an existing build of the docs.

Changed the glossary so that the acronym/abbreviations are the 
glossary terms, which I've discovered is how it is generally done.
It makes total sense now that I actually think about it because
you need to find the terms based on their use in the manual.

Added a bit of xsl to add the status attribute as a class attribute 
in the html so that the css can use a draft watermark(or any other 
watermark). DocBook supports the draft status without the xsl 
but it has problems, which I've described in the xsl file.

Minor tweak to the css to make the glossary terms and any other 
definition lists bold(that includes the index).


git-svn-id: svn://localhost/ardour2/trunk@1457 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-02-14 11:23:38 +00:00

129 lines
3.3 KiB
XML

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
version="1.0"
exclude-result-prefixes="exsl">
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl"/>
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunk-common.xsl"/>
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunk-code.xsl"/>
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/xhtml/manifest.xsl"/>
<xsl:param name="html.stylesheet" select="'ardour_manual.css'"/>
<xsl:param name="html.stylesheet.type" select="'text/css'"/>
<xsl:param name="html.cleanup" select="1"/>
<xsl:param name="html.ext" select="'.html'"/>
<xsl:output method="html" indent="yes"/>
<!--
I'm not using draft mode because with at least the version
of the stylesheets I have it inserts inline css. I'm not aware
of a non-hacky way around that so until I find a better
solution I'm using custom status fields:
ardour-draft
ardour-beta?
ardour-rc (release candidate)?
-->
<!-- Add css class for status -->
<xsl:template name="body.attributes">
<xsl:if test="(ancestor-or-self::*[@status][1]/@status != '')">
<xsl:attribute name="class">
<xsl:value-of select="ancestor-or-self::*[@status][1]/@status"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<!-- titles after all elements -->
<xsl:param name="formal.title.placement">
figure after
example after
equation after
table after
procedure before
</xsl:param>
<!-- This sets the filename based on the ID. -->
<xsl:param name="use.id.as.filename" select="'1'"/>
<xsl:template match="command">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
<xsl:template match="application">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guibutton">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guiicon">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guilabel">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guimenu">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guimenuitem">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guisubmenu">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="mousebutton">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="filename">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
<!-- TOC -->
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<xsl:param name="generate.legalnotice.link" select="1"/>
<xsl:param name="generate.revhistory.link" select="1"/>
<xsl:param name="generate.toc">
set toc
book toc
article toc
chapter toc
qandadiv toc
qandaset toc
sect1 nop
sect2 nop
sect3 nop
sect4 nop
sect5 nop
section toc
part toc
</xsl:param>
<!-- Limit TOC depth to 1 level -->
<xsl:param name="toc.section.depth">1</xsl:param>
<xsl:template name="nongraphical.admonition">
<div class="{name(.)}">
<h2 class="title">
<xsl:call-template name="anchor"/>
<xsl:if test="$admon.textlabel != 0 or title">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:if>
</h2>
<xsl:apply-templates/>
</div>
</xsl:template>
</xsl:stylesheet>