
k.rudnik at gmail
Dec 7, 2009, 1:30 PM
Post #5 of 7
(850 views)
Permalink
|
|
Re: How to reach output_buffer in cleanup section of root autohandler
[In reply to]
|
|
thanks, sorry I am still asking but I am afraid I was not precise enough. The right solution is !very! important for me because I am refactoring/optimizing the core tex layer of my working TeX driven bricolage instance and I would't like to get optimized="not working" one. [ I probably will, anyway;)] Here is the screenshot of a typical story preview screen my bric produces (5 min example with "random" colors) http://www.mimuw.edu.pl/delta/tex-bric-example.png and the corresponding bulkedit story screen http://www.mimuw.edu.pl/delta/tex-bric-example1-bulkedit.png You can compare the bric result with an example from mathworld http://mathworld.wolfram.com/EulerFormula.html I think bricolage can do math better! Back to the problem. I' d like my /autohandler look something like that <%init> ..... </%init> % $burner->chain_next <%cleanup> #1. my $output= get output buffer # (ie complete Html of the processed page in the form it will be written to disk) # $output=$m->{'request_buffer'} works in my tests #2. TeX::do_some_magic($output); # heavy job with tex in background #3. now I'am ready to filter output my $new_output=TeX::do_some_substitutions($output); # $m->clear_buffer; $m->print($new_output); </%cleanup> Using <%filter> to make substitutions does't seem (to me) to be the right solution because I had no chance to TeX::do_some_magic() before. thanks in advance -Krzysztof On Mon, Dec 7, 2009 at 6:50 PM, David E. Wheeler <david [at] kineticode> wrote: > On Dec 7, 2009, at 8:24 AM, Krzysztof Rudnik wrote: > >> To be more precise I want to modify page content after it's been >> completed and before it is written to a file >> >> my substitution is going to do very hard job >> >> <%filter> >> s/foo(.*?)bar/modify($1,$args)/ge; >> </%filter> >> >> where modifiy() is a subroutine defined somewhere and it uses some >> external modules >> Do you think that using filters is the right way to go? > > Yes. Use one one in your root-level category template (/autohandler). > > Best, > > David >
|