]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Gwiki.pm
upgraded write_fixedstep
[biopieces.git] / code_perl / Maasha / Gwiki.pm
index cd658680a8b6efd9f338ed2752610a867697fe5d..f9321c80148f7bf33e86d5643d7e2495cb5e477d 100644 (file)
@@ -28,10 +28,12 @@ package Maasha::Gwiki;
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
+use warnings;
 use strict;
 use Data::Dumper;
 use Term::ANSIColor;
 use Maasha::Common;
+use Maasha::Filesys;
 use vars qw ( @ISA @EXPORT );
 
 @ISA = qw( Exporter );
@@ -75,7 +77,7 @@ sub gwiki2ascii
         }
         elsif ( $block->[ 0 ]->{ 'FORMAT' } eq "verbatim" )
         {
-            map { push @lines, "   $_->{ 'TEXT' }" } @{ $block };
+            map { push @lines, text_white( "   $_->{ 'TEXT' }" ) } @{ $block };
         }
         elsif ( $block->[ 0 ]->{ 'FORMAT' } eq "itemize" )
         {
@@ -135,7 +137,7 @@ sub gwiki_read
 
     my ( $fh, @lines, $i, $c, $section, $paragraph, @block, @output );
 
-    $fh = Maasha::Common::read_open( $file );
+    $fh = Maasha::Filesys::file_read_open( $file );
 
     @lines = <$fh>;
     
@@ -150,7 +152,7 @@ sub gwiki_read
     {
         undef @block;
 
-        if ( $lines[ $i ] =~ /^(#summary.+)/ )
+        if ( $lines[ $i ] =~ /(#summary.+)/ ) # TODO: unsolved problem with anchor!
         {
             $section = $1;
 
@@ -243,7 +245,7 @@ sub gwiki_read
 
             $c = $i;
 
-            while ( $lines[ $c ] !~ /^\s*$/ )
+            while ( defined $lines[ $c ] and $lines[ $c ] !~ /^\s*$/ )
             {
                 $paragraph .= " $lines[ $c ]";
 
@@ -283,7 +285,7 @@ sub text_bold
     my ( $txt,
        ) = @_;
 
-    return colored ( $txt, "bold" );
+    return colored( $txt, "bold" );
 }
 
 
@@ -292,7 +294,15 @@ sub text_underline
     my ( $txt,
        ) = @_;
 
-    return colored ( $txt, "underline" );
+    return colored( $txt, "underline" );
+}
+
+sub text_white
+{
+    my ( $txt,
+       ) = @_;
+
+    return colored( $txt, "white" );
 }