Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > 9f452694b2d23dacae7f9cc757f9be50 > files > 509

docbook-style-xsl-1.78.1-1.fc17.noarch.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>custom.css.source</title><link rel="stylesheet" type="text/css" href="../reference.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="../index.html" title="DocBook XSL Stylesheets: Reference Documentation"><link rel="up" href="html.html" title="HTML"><link rel="prev" href="docbook.css.link.html" title="docbook.css.link"><link rel="next" href="generate.css.header.html" title="generate.css.header"><link rel="copyright" href="copyright.html" title="License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">custom.css.source</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="docbook.css.link.html">Prev</a> </td><th width="60%" align="center">HTML</th><td width="20%" align="right"> <a accesskey="n" href="generate.css.header.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="custom.css.source"></a><div class="titlepage"></div>
  
  <div class="refnamediv"><h2><span class="refentrytitle">custom.css.source</span></h2><p>
    custom.css.source
     &#8212; Name of a custom CSS input file
  </p></div>

  <div class="refsynopsisdiv"><h2>Synopsis</h2>
    <a name="custom.css.source.frag"></a><pre class="programlisting">&lt;xsl:param name="custom.css.source"&gt;&lt;/xsl:param&gt;</pre>
  </div>

  <div class="refsection"><a name="idp937088"></a><h2>Description</h2>

<p>The <a href="../html/custom.css.source.html"><em class="parameter"><code>custom.css.source</code></em></a>
parameter enables you to add CSS styles to DocBook's
HTML output.</p>

<p>The parameter
specifies the name of a file containing custom
CSS styles.  The file must be a well-formed XML file that
consists of a single <code class="sgmltag-element">style</code> root
element that contains CSS styles as its text content.
For example:</p>
<pre class="programlisting">&lt;?xml version="1.0"?&gt;
&lt;style&gt;
h2 {
  font-weight: bold;
  color: blue;
}
...
&lt;/style&gt;
</pre>

<p>The filename specified by the parameter
should have a <code class="literal">.xml</code>
filename suffix, although that is not required.
The default value of this parameter is blank.</p>

<p>If <a href="../html/custom.css.source.html"><em class="parameter"><code>custom.css.source</code></em></a> is not blank, then
the stylesheet takes the following actions.
These actions take place regardless of the value of
the <a href="../html/make.clean.html.html"><em class="parameter"><code>make.clean.html</code></em></a> parameter.</p>

<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
    <p>The stylesheet uses the XSLT <code class="literal">document()</code>
    function to open the file specified by the parameter and
    load it into a variable.</p>
  </li><li class="listitem">
    <p>The stylesheet forms an output pathname consisting of the
    value of the <a href="../html/base.dir.html"><em class="parameter"><code>base.dir</code></em></a> parameter (if it is set)
    and the value of <a href="../html/custom.css.source.html"><em class="parameter"><code>custom.css.source</code></em></a>,
    with the <code class="literal">.xml</code> suffix stripped off.
    </p>
  </li><li class="listitem">
    <p>The stylesheet removes the <code class="sgmltag-element">style</code>
    wrapper element and writes just the CSS text content to the output file.</p>
  </li><li class="listitem">
    <p>The stylesheet adds a <a href="http://docbook.org/tdg5/en/html/link.html"><code class="sgmltag-element">link</code></a> element to the
    HTML <code class="sgmltag-element">HEAD</code> element to reference this external CSS stylesheet.
    For example:
    </p><pre class="programlisting">&lt;link rel="stylesheet" href="custom.css" type="text/css"&gt;
    </pre><p>
    </p>
  </li></ol></div>



<p>If the <a href="../html/make.clean.html.html"><em class="parameter"><code>make.clean.html</code></em></a> parameter is nonzero
(the default is zero),
and if the <a href="../html/docbook.css.source.html"><em class="parameter"><code>docbook.css.source</code></em></a> parameter
is not blank (the default is not blank),
then the stylesheet will also generate a default CSS file
and add a <a href="http://docbook.org/tdg5/en/html/link.html"><code class="sgmltag-element">link</code></a> tag to reference it.
The <a href="http://docbook.org/tdg5/en/html/link.html"><code class="sgmltag-element">link</code></a> to the custom CSS comes after the 
<a href="http://docbook.org/tdg5/en/html/link.html"><code class="sgmltag-element">link</code></a> to the default, so it should cascade properly
in most browsers.
If you do not want two <a href="http://docbook.org/tdg5/en/html/link.html"><code class="sgmltag-element">link</code></a> tags, and
instead want your custom CSS to import the default generated
CSS file, then do the following:
</p>

<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
    <p>Add a line like the following to your custom CSS source file:</p>
    <pre class="programlisting">@import url("docbook.css")
    </pre>
  </li><li class="listitem">
    <p>Set the <a href="../html/docbook.css.link.html"><em class="parameter"><code>docbook.css.link</code></em></a> parameter 
    to zero. This will omit the <a href="http://docbook.org/tdg5/en/html/link.html"><code class="sgmltag-element">link</code></a> tag
    that references the default CSS file.</p>
  </li></ol></div>

<p>If you set <a href="../html/make.clean.html.html"><em class="parameter"><code>make.clean.html</code></em></a> to nonzero but
you do not want the default CSS generated, then also set
the <a href="../html/docbook.css.source.html"><em class="parameter"><code>docbook.css.source</code></em></a> parameter to blank.
Then no default CSS will be generated, and so
all CSS styles must come from your custom CSS file.</p>

<p>You can use the <a href="../html/generate.css.header.html"><em class="parameter"><code>generate.css.header</code></em></a>
parameter to instead write the CSS to each HTML <code class="sgmltag-element">HEAD</code>
element in a <code class="sgmltag-element">style</code> tag instead of an external CSS file.</p>

  </div>
</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="docbook.css.link.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="html.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="generate.css.header.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">docbook.css.link </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> generate.css.header</td></tr></table></div></body></html>