source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/params/custom.css.source.xml@ 64a2cd5

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 64a2cd5 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 4.2 KB
Line 
1<refentry xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="5.0" xml:id="custom.css.source">
7 <refmeta>
8 <refentrytitle>custom.css.source</refentrytitle>
9 <refmiscinfo class="other" otherclass="datatype">string</refmiscinfo>
10 </refmeta>
11 <refnamediv>
12 <refname>custom.css.source</refname>
13 <refpurpose>Name of a custom CSS input file</refpurpose>
14 </refnamediv>
15
16 <refsynopsisdiv>
17 <src:fragment xml:id="custom.css.source.frag"><xsl:param name="custom.css.source"></xsl:param></src:fragment>
18 </refsynopsisdiv>
19
20 <refsection><info><title>Description</title></info>
21
22<para>The <parameter>custom.css.source</parameter>
23parameter enables you to add CSS styles to DocBook's
24HTML output.</para>
25
26<para>The parameter
27specifies the name of a file containing custom
28CSS styles. The file must be a well-formed XML file that
29consists of a single <tag>style</tag> root
30element that contains CSS styles as its text content.
31For example:</para>
32<programlisting><![CDATA[<?xml version="1.0"?>
33<style>
34h2 {
35 font-weight: bold;
36 color: blue;
37}
38...
39</style>
40]]></programlisting>
41
42<para>The filename specified by the parameter
43should have a <literal>.xml</literal>
44filename suffix, although that is not required.
45The default value of this parameter is blank.</para>
46
47<para>If <parameter>custom.css.source</parameter> is not blank, then
48the stylesheet takes the following actions.
49These actions take place regardless of the value of
50the <parameter>make.clean.html</parameter> parameter.</para>
51
52<orderedlist>
53 <listitem>
54 <para>The stylesheet uses the XSLT <literal>document()</literal>
55 function to open the file specified by the parameter and
56 load it into a variable.</para>
57 </listitem>
58 <listitem>
59 <para>The stylesheet forms an output pathname consisting of the
60 value of the <parameter>base.dir</parameter> parameter (if it is set)
61 and the value of <parameter>custom.css.source</parameter>,
62 with the <literal>.xml</literal> suffix stripped off.
63 </para>
64 </listitem>
65 <listitem>
66 <para>The stylesheet removes the <tag>style</tag>
67 wrapper element and writes just the CSS text content to the output file.</para>
68 </listitem>
69 <listitem>
70 <para>The stylesheet adds a <tag>link</tag> element to the
71 HTML <tag>HEAD</tag> element to reference this external CSS stylesheet.
72 For example:
73 <programlisting>&lt;link rel="stylesheet" href="custom.css" type="text/css"&gt;
74 </programlisting>
75 </para>
76 </listitem>
77</orderedlist>
78
79
80
81<para>If the <parameter>make.clean.html</parameter> parameter is nonzero
82(the default is zero),
83and if the <parameter>docbook.css.source</parameter> parameter
84is not blank (the default is not blank),
85then the stylesheet will also generate a default CSS file
86and add a <tag>link</tag> tag to reference it.
87The <tag>link</tag> to the custom CSS comes after the
88<tag>link</tag> to the default, so it should cascade properly
89in most browsers.
90If you do not want two <tag>link</tag> tags, and
91instead want your custom CSS to import the default generated
92CSS file, then do the following:
93</para>
94
95<orderedlist>
96 <listitem>
97 <para>Add a line like the following to your custom CSS source file:</para>
98 <programlisting>@import url("docbook.css")
99 </programlisting>
100 </listitem>
101 <listitem>
102 <para>Set the <parameter>docbook.css.link</parameter> parameter
103 to zero. This will omit the <tag>link</tag> tag
104 that references the default CSS file.</para>
105 </listitem>
106</orderedlist>
107
108<para>If you set <parameter>make.clean.html</parameter> to nonzero but
109you do not want the default CSS generated, then also set
110the <parameter>docbook.css.source</parameter> parameter to blank.
111Then no default CSS will be generated, and so
112all CSS styles must come from your custom CSS file.</para>
113
114<para>You can use the <parameter>generate.css.header</parameter>
115parameter to instead write the CSS to each HTML <tag>HEAD</tag>
116element in a <tag>style</tag> tag instead of an external CSS file.</para>
117
118 </refsection>
119</refentry>
Note: See TracBrowser for help on using the repository browser.