|
From: David G. <go...@us...> - 2002-08-15 00:16:25
|
Adam Chodorowski wrote:
> I'm experiencing some strange handling of the --stylesheet option of the HTML
> writer, which I use like the following::
>
> stylesheet=aros.css
>
> But the generated HTML contains::
>
> <link rel="stylesheet" href="../../docs/aros.css" type="text/css" />
>
> And that is not at all what I specified! It should be noted that the source
> file is in a different directory from the destination file, and that the
> current directory is the source one. I think this is the problem: for some
> reason the --stylesheet option is not taken verbatim, but is looked up
> relative to the current directory and "corrected".
Yes, this is intentional. All references to files (stylesheet, source file
[in footer], PEP template) are interpreted relative to the current working
directory, and adjusted relative to the destination directory. For
example::
cd /work
html.py -s --stylesheet=default.css /src/test.txt /dst/text.html
This will interpret the stylesheet as "work/default.css", so the stylesheet
link in the HTML (which is in the /dst dir) will read "../work/default.css",
and the source link (-s option) will read "../src/test.txt".
> This is totally useless for me, as I have separate build and source
> directories. If this is a intended feature (I do see the usefullness of it
> when building in a single directory), perhaps another option would be
> apropriate. Something like --absolute-stylesheet perhaps?
Understood. Perhaps the current behavior should be optional
("--relative-paths" or something). The default should probably be not to
process paths at all, just use them verbatim. This will help with Richard's
troubles as well.
> Actually, I just figured out a way to make it work anyway so you can ignore
> that mail. It's getting a little to late, it seems... :)
So, how did you do it? Please do tell!
--
David Goodger <go...@us...> 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/
|