package WebCoso::ReST; use strict; use warnings; use WebCoso::Common; use Path::Class; use Text::Restructured; use Text::Restructured::Writer::LibXML; sub new { my ($class,%opts)=@_; my $self={%opts}; $self->{rest}=Text::Restructured->new( { D=>{ 'file-insertion-enabled'=>0, # we use TT generator=>0, date=>0, 'time'=>0, 'source-link'=>0, 'section-subtitles'=>1, }, }, 'WebCoso'); $self->{fc}->add_parser(qr{\.rest\.txt$} => sub { my $dudom=$self->{rest}->Parse($_[1],$_[0]); return Text::Restructured::Writer::LibXML ->new->ProcessDOM($dudom); }); bless $self,$class; } 1;