|
From: Adam C. <ad...@ch...> - 2002-07-05 23:50:40
|
On Fri, 05 Jul 2002 19:08:29 -0400 David Goodger
<go...@us...> wrote:
> > I would like to implement a transform/filter with which you can
> > select a single section (by name or ordering) to be processed
> > further, filtering all the other ones out. This can be used for
> > extracting the abstract of a document, for example, so you can put
> > it on a separate page (with a link to the full document perhaps).
[...]
> Can you give us some background on what you're trying to accomplish?
> I'm not sure that a transform is what you want. A transform modifies
> a document tree; perhaps you just want to extract part of an existing
> document tree? Are you writing a custom Writer, such as to generate a
> multi-page web site? Perhaps a subclass of the html4css1.py Writer?
I (will) have several little larger reST documents on a website and I want to
construct an index page with short descriptions and a link to the full
document. So I thought I'd simply extract the abstract / introduction section
of those documents for the short description on the index page to avoid
duplication and ease maintanence.
The idea is to churn through the documents twice: the first pass creates the
HTMl documents in full, while the second pass applies this filter/transform to
get the abstract and adds it to the index page.
Another thing I would like to do is to either add templating support to the
HTML writer, or write a "fragment" HTML writer (which would only write out the
body of the document, so you can wrap it in your own header/footer for layout
(navigation bar etc)). But that's a different topic. :)
> > Also, I noticed that there seems to be some provision for language
> > localization. Is this in a usable state and is the current API
> > reasonable stable? If so, I can contribute some code to support
> > swedish.
>
> Usable: yes, in English. No other language is installed yet, so I
> couldn't say. Also, the code itself is not localized, just some
> strings for the parser to recognize and for use in generating output.
Yes, that's basically what I need (to have the generated string in the output
documents localized, like "Table of Contents"). I don't really care if the
docutils programs are localized themselves.
> Stable API: that depends on whether or not it works. It hasn't really
> been tested properly; just my first stab. I imagine it will need some
> work, but that can only be determined through real-life use.
The --language option is supposed to be used for this? Anyway, I'll have a
stab at implementing and testing it for swedish. Easy little task to start
with. ;-)
> I was wondering -- Chodorowski -- a good Swedish name that.
Hehehe.. :) The name is Polish. I have Polish parents, but I live (and have
always done so) in Sweden. I could probably translate it to Polish also, but
it would be a little harder for me (not to mention that I don't have a Polish
keyboard layout nor the right character set :)).
---
Adam Chodorowski <ad...@ch...>
Chapter 1
The story so far:
In the beginning the Universe was created. This has made a lot of
people very angry and been widely regarded as a bad move.
|