Fixed minor bug with TOC feature when the cursor is in the last section of the file.
[docutils.git] / docs / howto / html-stylesheets.txt
blob1f61bab5d4350b0f88c3d45a8ce91ade018640a1
1 ==============================================
2  Writing HTML (CSS) Stylesheets for Docutils_
3 ==============================================
5 :Author: Felix Wiemann
6 :Contact: Felix.Wiemann@ososo.de
7 :Date: $Date$
8 :Revision: $Revision$
9 :Copyright: This document has been placed in the public domain.
11 .. _Docutils: http://docutils.sourceforge.net/
14 The look of Docutils' HTML output is customizable via a CSS
15 stylesheet.  The default stylesheet is called ``html4css1.css`` and
16 can be found in the ``writers/support/`` directory of the Docutils
17 installation.  Use the command ``rst2html.py --help`` and look at the
18 description of the ``--stylesheet-path`` command-line option for the
19 exact machine-specific location.
21 To customize the stylesheet, first copy ``html4css1.css`` to the same
22 place as your output HTML files will go.  Next, place a new file
23 (e.g. called ``my-docutils.css``) in the same directory and use the
24 following template::
26     /*
27     :Author: Your Name
28     :Contact: Your Email Address
29     :Copyright: This stylesheet has been placed in the public domain.
31     Stylesheet for use with Docutils.  [Optionally place a more
32     detailed description here.]
33     */
35     @import url(html4css1.css);
37     /* Your customizations go here.  For example: */
39     h1, h2, h3, h4, h5, h6, p.topic-title {
40       font-family: sans-serif }    
42 For help on the CSS syntax, please see `the WDG's guide to Cascading
43 Style Sheets`__ and, in particular, their `list of CSS1 properties`__.
45 __ http://www.htmlhelp.com/reference/css/
46 __ http://www.htmlhelp.com/reference/css/all-properties.html
48 It is important that you do not edit a copy of ``html4css1.css``
49 directly because ``html4css1.css`` is frequently updated with each new
50 release of Docutils.
52 Also make sure that you import ``html4css1.css`` (using "``@import
53 url(html4css1.css);``") because the definitions contained in the
54 default stylesheet are required for correct rendering (margins,
55 alignment, etc.).
57 If you think your stylesheet is fancy and you would like to let others
58 benefit from your efforts, you are encouraged to post the stylesheet
59 to the Docutils-users_ mailing list.  We can upload it to the
60 `Docutils repository`__ if you would like us to do so.
62 If you decide to share you stylesheet with other users of Docutils,
63 please keep website-specific customizations not applicable to
64 Docutils' HTML code in a separate stylesheet.
66 .. _Docutils-users: ../user/mailing-lists.html#docutils-users
67 __ http://docutils.sourceforge.net/sandbox/stylesheets/
71    Local Variables:
72    mode: indented-text
73    indent-tabs-mode: nil
74    sentence-end-double-space: t
75    fill-column: 70
76    End: