Permalink
Browse files

add a small util that converts ASCII art tables to PseudoPod tables

  • Loading branch information...
moritz committed Nov 13, 2009
1 parent 0705978 commit 6bd20a4ecb128ee98e3cf766bc00f31cc2ed1ccf
Showing with 26 additions and 0 deletions.
  1. +26 −0 bin/ascii-to-pod.pl
View
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+use 5.010;
+use utf8;
+use open IO => ':encoding(utf8)';;
+
+use Data::Dumper;
+$Data::Dumper::Useqq = 1;
+
+say "=begin table\n";
+while (<>) {
+ chomp;
+ s/^\s+//;
+ next unless length $_;
+ my @row = split /\s{2,}/, $_;
+ say "=headrow\n" if $. == 1;
+
+ say "=row\n";
+
+ for my $c (@row) {
+ say "=cell $c\n";
+ }
+
+ say "=bodyrows\n" if $. == 1;
+}
+say "=end table";

0 comments on commit 6bd20a4

Please sign in to comment.