diff options
author | dakkar <dakkar@luxion> | 2007-08-13 15:50:17 +0000 |
---|---|---|
committer | dakkar <dakkar@luxion> | 2007-08-13 15:50:17 +0000 |
commit | c765786984a7966b29eeb0477b3599d266f63836 (patch) | |
tree | 1350eaf55c8d4dc82e59306419a06748d09407a4 | |
parent | argh! Cwd::abs_path fa già tutto... (diff) | |
download | WebCoso-c765786984a7966b29eeb0477b3599d266f63836.tar.gz WebCoso-c765786984a7966b29eeb0477b3599d266f63836.tar.bz2 WebCoso-c765786984a7966b29eeb0477b3599d266f63836.zip |
non andrà mai in questo modo...
git-svn-id: svn://luxion/repos/WebCoso/trunk@274 fcb26f47-9200-0410-b104-b98ab5b095f3
-rw-r--r-- | stest.pl | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -4,6 +4,34 @@ use warnings; use Slay::Maker; use File::Next; use Path::Class; +use Template; +use File::Cache::Parsed; +use Cwd 'abs_path'; +use Text::Restructured; +use Text::Restructured::Writer::LibXML; + +my $stash={}; +my $template=Template->new(); +my $rest=Text::Restructured->new({},'WebCoso'); + +my $fc=File::Cache::Parsed->new(); +$fc->add_parser(qr{\.rest\.tt2?$} => + sub { + my ($name,$content)=@_; + my $real_name=abs_path($name); + my $output; + $template->process($real_name, + {%$stash,name=>$name}, + \$output); + return $output; + }); +$fc->add_parser(qr{\.rest\.txt$} => + sub { + my ($name,$content)=@_; + my $dudom=$rest->Parse($content,$name); + return Text::Restructured::Writer::LibXML + ->new->ProcessDOM($dudom); + }); sub expandTT { my ($maker,$target,$deps,$matches)=@_; |