aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@luxion>2007-08-13 15:50:17 +0000
committerdakkar <dakkar@luxion>2007-08-13 15:50:17 +0000
commitc765786984a7966b29eeb0477b3599d266f63836 (patch)
tree1350eaf55c8d4dc82e59306419a06748d09407a4
parentargh! Cwd::abs_path fa già tutto... (diff)
downloadWebCoso-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.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/stest.pl b/stest.pl
index c468c87..5480f8f 100644
--- a/stest.pl
+++ b/stest.pl
@@ -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)=@_;