Index of /sandbox/html4strict

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -
[DIR]data/29-Sep-2008 16:04 -
[DIR]docs/29-Sep-2008 16:04 -
[TXT]html4strict.py29-Sep-2008 16:04 4.0K
[DIR]tools/29-Sep-2008 16:04 -

HTML Writer producing strict HTML 4 relying on CSS 2.

HTML Writer producing strict HTML 4 relying on CSS 2.

Motivation

The HTML Writer module, docutils.writers.html4css1 generates XHTML compatible with the XHTML 1.0 specification.

However, generated documents do not conform to the "strict" variant, as they contain some deprecated structures in order to ensure correct display with deficient browsers.

Solution

A HTML writer, producing XHTML that strictly conforms to the XHTML 1.0 specification.

The html4strict writer module subclasses the html4css1.HTMLTranslator and modifies it to remove deprecated HTML constructs. The output conforms to the XHTML version 1.0 Strict DTD.

A html4css2.css stylesheet provides the standard layout for CSS2-conforming Html browsers (e.g. Firefox or Opera). Alternative style sheets are in the data subdir.

Advantages

  • Standards compliance in the strictest sense.
  • Clear distinction of content and layout. The HTML output contains no "hard-coded" visual markup.
  • CSS style sheets can style almost every aspect of the visual appearance
  • Field lists are written as definition lists and styled with CSS. This
    • improves the CSS-configurability as well as
    • reduces the loading time of a document with long field lists.

Files

Installation

Place rst2html_strict.py in the binary PATH and html4strict.py in the PYTHONPATH or in the working directory (from where you start rst2html_strict.py).

Usage

Similar to the standard rst2html front end:

rst2html_strict.py [options] [<source> [<destination>]]

The full usage text can be obtained with the --help option.

Some of the described options are special to html4css1 and have no effect in the html4strict version of the HTML writer.