Hi Kirill

sorry for answering so late

I'm afraid I don't get the picture because in your example the parsed
document is returned and stored into 'data'. So what exactly you are
suggesting? Something like having the code parsed then executed but the
output stored in the channel buffer returned to the caller?

 -- Massimo

On 07/05/2013 01:19 PM, Kirill Shtumf wrote:
> For example, I use templates for email-newsletters.
> 
> At the moment I use for this the parser implementation on Tcl.
> 
> register.html looks like this: <p>Hello <? append output $vars(username)
> ?>!</p> ...
> 
> package require tclrivetparser
> set text_for_parse [read_file [file join $::conf(template) {mail}
> {register.html}]]
> set output ""
> ::tclrivetparser::setoutputcmd {append output }
> set data [::tclrivetparser::parserivetdata $text_for_parse]
> eval $data
> functions-> mail $vars(email) $vars(from) $vars(subj) $output
> 
> 05.07.2013 14:57, Massimo Manghi wrote:
>> Something that would work like this?
>>
>>   set fragment "<?= [::rivet::xml \"a small template\" b] ?>"
>>   puts [::rivet::parse_template $fragment]
>> <== puts -nonewline "<b>a small template</b>"
>>
>> while
>>
>>   eval [::rivet::parse_template $fragment]
>>
>> would actually evaluate the script and print to the browser the string
>>
>> "<b>a small template</b>"
>>
>> It implies some Tcl level interface to librivetparser. In don't know but
>> it could go into the rivetlib library rather than the core.
>>
>>   -- Massimo
>>
>> On 07/04/2013 05:44 PM, Kirill Shtumf wrote:
>>> One problem of the parser implementation is inability to add parsed text
>>> into another variable. Command does not return a result and immediately
>>> sends it to the stdout. Can we somehow change it?
>>>
> 
> 


-- 
-- Massimo Manghi

Dipartimento di Neuroscienze
Unità di Biofisica e Fisica Sanitaria
via Volturno 39
43125 Parma

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to