|
From: <gr...@us...> - 2002-05-22 06:00:55
|
On Wed, 22 May 2002, David Goodger wrote: > > i recognized a new function supports in the writer: > > means the parser could ask the writer if it supports a certain > > construct and if not might use some other ? > > No, writers should support all elements defined in docutils.nodes. everything derived from Element ? how should i know :-) does anyone know the automatic way to get the list ?not important now, but for completeness checks it might be valid. should but might not do always, as new elements are added not all writers will support immediatly and we should have a way to get documents out anyway. (your modification os NodeVisitor should enable fallback elements in writers). > There's no communication between parser and writer at parse time. The > fully parsed document instance may contain "pending" elements, which > are a form of delayed communication, and that's what the "supports" > method can be used for. > > ``docutils.Component.supports()`` (defined in docutils/__init__.py) is > used by transforms to ask the component (reader or writer) controlling > the transform if that component supports a certain input context or > output format. Specifically, it's used by the "meta" directive, which > uses the ``docutils.transforms.components.Filter`` transform; only > writers supporting HTML will include the meta tag, others will discard > it. (See the docstring of ``docutils.transforms.components.Filter`` > for a detailed explanation.) should this be the meta information in a pdf file and maybe a comment in latex or pdf metainformation in pdflatex ? -- BINGO: synergy end to end --- Engelbert Gruber -------+ SSG Fintl,Gruber,Lassnig / A6410 Telfs Untermarkt 9 / Tel. ++43-5262-64727 ----+ |