summaryrefslogtreecommitdiff
path: root/web/mkdemos.pl
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-10 02:33:33 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-10 02:33:33 +0000
commite7dabc9dd0ed0bb2578677e893d7479ddbd2d1c6 (patch)
tree349d2ba50ebaa15e9a0f88847195d6756b626faf /web/mkdemos.pl
parent8d4a1ed0395116f9503d1058c36bdbc1cd61bbc5 (diff)
More Changes to website target. Moved to a templating system
for the examples page. git-svn-id: https://pandoc.googlecode.com/svn/trunk@487 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'web/mkdemos.pl')
-rwxr-xr-xweb/mkdemos.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/web/mkdemos.pl b/web/mkdemos.pl
new file mode 100755
index 000000000..02e5da2f6
--- /dev/null
+++ b/web/mkdemos.pl
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+# first argument is input filename - a demo template.
+# second argument is output filename.
+
+my $infile=$ARGV[0];
+my $outfile=$ARGV[1];
+
+open( IN, "< $infile" );
+open( OUT, "> $outfile" );
+
+while (<IN>) {
+
+ my $line = $_;
+ my $firstchar = substr ($line,0,1);
+ if ( $firstchar eq '@' ) {
+ my $command = substr ($line,4);
+ print STDERR "$command";
+ system "$command";
+ $line = $command;
+ $line =~ s/-/\-/;
+ $line =~ s/ ([A-Za-z0-9_:\/]+(\.|\/)[a-zA-Z0-9.\/]*|README|S5DEMO)/ <a href="$1">$1<\/a>/g;
+ $line =~ s/-/\\-/g;
+ $line =~ s/^(.*)$/ <code>$1<\/code>/g;
+ }
+ print OUT $line;
+
+}