perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject RE: Text to HTML recipe making
Date Tue, 20 Dec 2005 20:48:15 GMT
> 
> What I want to be able to do, is for Embperl to be able to 
> read in plain text files and convert them to HTML.  But I 
> don't want to reinvent the wheel, since there are perfectly 
> good perl modules which have already been written to do that 
> (such as HTML::TextToHTML).
> 

Unfortunately there are a few lines of C code missing to get this done. It
was always my intention to make such a usage possible, but I didn't got
around until now to implement the last piece :-(

So one possiblilty is that somebody writes this C code.

The other one is to create a syntax module, which uses HTML::TextToHTML for
the actual work.

To do so, just make a copy of Embperl/Syntax/Perl.pm, then in the call to
AddInitCode you would pass some code like:

q{

 use HTML::TextToHTML ;

 {
 local $/ = undef ;
 my $text = <DATA> ;
 
 my $html =  HTML::TextToHTML::<whatever you want to do> ($text) ;
 print OUT $html ;
 }

 __DATA__

}

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message