Comment 17 for bug 914221

Revision history for this message
Lewis Neal (lewisneal) wrote :

Günter has replied again on 20 Jan 10:50 - see http://permalink.gmane.org/gmane.text.docutils.user/6565

For convenience here is a copy of the text:
Re: No such file or directory: html4css1.css - system exit
Guenter Milde <milde <at> users.sf.net>
2012-01-20 09:50:34 GMT

On 2012-01-12, Lewis wrote:

> You are most likely aware that the Leo-editor project makes use of Docutils.

I added Leo to the Docutils link list.

> To summarise - docutils performs a system exit when it fails to find the
> html4css1.css1 file.

For style files, this is fixed in SVN.

For the generic behaviour of `docutils.io.FileInput`, I'll respond to the
old request you pointed to (join docutils-users or watch the list via gmane
or another archive if you want to follow the discussion).

> I hope the leo bug link is sufficient for you but please ask if you
> need any more information or want me to try and reproduce the
> traceback.

I Leo calling docutils programatically?

I found a possible reason of the failure to find the html4css1 file:

Leos tutorial
http://webpages.charter.net/edreamleo/rstplugin3.html#step-1-create-the-rst-node

suggests:

  Here are the recommended options when using docutils:

  @ @rst-options
  call_docutils=True
  code_mode=False
  stylesheet_path=..\doc
  write_intermediate_file=True
  @c

However, unless a user is using custom style sheets, it is better to keep the
Docutils stylesheet options at the default value.

A very confusing point is that

* for Docutils, `stylesheet_path` is a path (or a list of paths) to a
  stylesheet *file*:

  --stylesheet=<URL> Specify comma separated list of stylesheet URLs.
                        Overrides previous --stylesheet and --stylesheet-path
                        settings.
  --stylesheet-path=<file>
                        Specify comma separated list of stylesheet paths. With
                        --link-stylesheet, the path is rewritten relative to
                        the output file. Default:
                        "/<docutils-package-dir>/docutils/writers/html4css1/html4css1.css"

* for Leo, `stylesheet_path` points to a *directory* of stylesheets:

  stylesheet_name (default: ‘default.css’)

      The name of the stylesheet passed to docutils.

  stylesheet_path (default: ‘’)

      The directory containing the stylesheet passed to docutils.

      Note: If the stylesheet_embed option is True, specify a path
      relative to the location of the Leo file. If the stylesheet_embed
      option is False, specify a path relative to the location of the
      HTML file.

Also:

* `default.css` is outdated and specific to HTML.
  Using Docutils' default value for (Docutils) stylesheet_path option
  ensures an up-to-date style sheet in a location Docutils can find
  out-of-the-box.

* Leo's "stylesheet_path" option would not need to depend on the
  stylesheet_embed setting, with the translation:

     Leo Docutils

     stylesheet_path+stylesheet_name --> stylesheet_path

  instead of

     stylesheet_path+stylesheet_name --> stylesheet

Thanks,

Günter