From: David G. <go...@py...> - 2002-11-13 01:28:49
|
[Mikhail] >>> nor it's possible to get rid of use stylesheets at all. [David] >> I'm not sure what you mean by this or what you want. Please >> elaborate. [Mikhail] > The current code does produce HTML elements with classes referencing > to a stylesheet. Actually, it's the other way around. The HTML file does reference a stylesheet in its <link rel="stylesheet" ... /> element, but it's the styles (in the stylesheet) which reference the "class" attributes on elements in the HTML files. So if there's no stylesheet referenced, the "class" attributes have no effect. > I'd say that the rendering without a stylesheet seems to be OK for > me, so I'd like to specify None as the stylesheet name, I've altered the HTML Writer so that if both settings.stylesheet (--stylesheet) and settings.stylesheet_path (--stylesheet-path) are None or "", there will be no <link rel="stylesheet" ... /> added to the output. Note that if you use the standard config file in tools/docutils.conf, it does set settings.stylesheet_path, so you'll have to override explicitly. > and in this case I'd expect to get html text without class > references in html elements. ... > Such a behaviour does not seem to be very complicated, so maybe it > could be possible to add this functionality in the current code? If that's what you want, you'll have to supply the code. There's no harm having ``class="whatever"`` attributes on HTML elements when there's no stylesheet. It would be easy to add as a setting/option, but I'll leave it to you because I don't think it's useful. I'll be happy to accept a patch. > Hmm. The current code does not seem to follow the quoted RFC 2396 > then. I did specify > > <http://www.example.com/an url with spaces> > > (which seems to be correct according to this RFC) and as result got > > <<a href="http://www.example.com/an" > >http://www.example.com/an</a> url with spaces> > > which seems to be incorrect, right? Note that according to the RFC, your example should be interpreted as: http://www.example.com/anurlwithspaces Which is *not* what you asked for. I wrote: >> The reStructuredText parser also joins long multi-line URLs in >> targets. This applies to the "target" construct only:: .. _target: http://www.example.com/a/very/long/ path/broken/across/lines My comment does not apply to standalone URLs in text, with or without angle brackets (which have no special meaning now). As for "The current code does not seem to follow the quoted RFC 2396", that's true. However, please realize that the quoted text comes from Appendix E, "Recommendations for Delimiting URI in Context". A recommendation, not a specification. The first sentence reads: URI are often transmitted through formats that do not provide a clear context for their interpretation. reStructuredText *does* provide a clear context for the interpretation of URIs, via the "target" construct. The appendix goes on to say: For robustness, software that accepts user-typed URI should attempt to recognize and strip both delimiters and embedded whitespace. And I wrote: >> I wouldn't mind adding the ability to join broken URLs in free text >> as well, if surrounded by brackets. This is the first time this issue has come up. If this feature is important to you, I would be pleased to accept a patch that implements it. But the patch should implement the behavior described in the RFC, *not* the ad-hoc behavior witnessed in MS Outlook. The ambiguous and non-standard MS Outlook behavior will *not* be supported. -- David Goodger <go...@py...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |