From: <eng...@ss...> - 2004-06-22 06:11:18
|
On Mon, 21 Jun 2004, David Abrahams wrote: > Aahz <aa...@py...> writes: > > > On Mon, Jun 21, 2004, David Abrahams wrote: > >> Aahz <aa...@py...> writes: > >>> > >>> What I did was invent my own little ``include-output`` directive for > >>> external code -- I think code inside reST files should be kept to a > >>> minimum, so that the code is run every time the document is generated. > >>> See my sandbox if you're interested. > >> > >> What I'm worried about with adding a directive is that it will trip up > >> ordinary writers unless I go out of my way to make them aware of it. > >> My litre tool uses raw becase that directive is ignored unless the > >> format (litre) is recognized by the writer. I wish I was missing > >> something here; please tell me I am! I'd like to make litre's > >> intrusion on my ReST as minimal as possible. > > > > If that's your goal, make sure that the ``litre`` directive emits only > > elements found in nodes.py. IOW, make the ``litre`` directive a > > subclass of the ``literal`` directive. > > Aaaaahz! > Very cute trick. > > But then, how will my writer recognize my litre-generated literal > nodes? couldnt you check for an attribute in literal nodes (class ?). this way the code parts would be printed literal, and not ignored by other writers. a feature not a bug ? -- BINGO: objects, objects, objects (r.racko) --- Engelbert Gruber -------+ SSG Fintl,Gruber,Lassnig / A6170 Zirl Innweg 5b / Tel. ++43-5238-93535 ---+ |