From 6d4c19707ef95942e323cbdc89fbbfdbe45e7cc5 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Mon, 8 Jan 2007 23:52:01 +0000 Subject: Splitting out www git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11952 a1c6a512-1295-4272-9138-f99709370657 --- www/faq2html.pl | 101 -------------------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100755 www/faq2html.pl (limited to 'www/faq2html.pl') diff --git a/www/faq2html.pl b/www/faq2html.pl deleted file mode 100755 index 3417128ab9..0000000000 --- a/www/faq2html.pl +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/perl - -# this is really a faq2html and should only be used for this purpose - -sub fixline { - $_ =~ s/\/>/g; - - $_ =~ s/(http:\/\/([a-zA-Z0-9_.\#\/-]*)[^\) .\n])/\$1\<\/a\>/g; - - $_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line -} - -sub show { - if(@q) { - print @q; - undef @q; - } - if(@a) { - print @a; - undef @a; - } - if(@p) { - print "
\n";
-        print @p;
-        print "
\n"; - undef @p; - } -} - -while() { - - fixline($_); - - # detect and mark Q-sections - if( $_ =~ /^(Q(\d*)[.:] )(.*)/) { - - show(); - - # collect the full Q - push @q, "

"; - push @q, "$2. $3"; - my $line; - - $indent = length($1); - $first = " " x $indent; - - #print "$indent|$first|$1|\n"; - - while() { - - fixline($_); - - $line = $_; - - if($_ !~ /^A/) { - push @q, "$_"; - } - else { - last; - } - } - # first line of A - $line =~ s/^A(\d*)[.:] *//g; # cut off the "A[num]." - push @a, "

"; - push @a, $line; - - $prev='a'; - next; - } - # print "$_ matches '$first'?\n"; - - if($_ =~ /^$first(\S)/) { - - - if($prev ne 'a') { - show(); - push @a, "

"; - } - - push @a, $_; - $prev='a'; - } - else { - if($prev ne 'p') { - show(); - } - if(@p) { - # if we have data, we fix blank lines - $_ =~ s/^\s*$/\ \n/g; # empty lines are nbsp - push @p, $_; # add it - } - elsif($_ !~ /^\s*$/) { - # this is not a blank line, add it - push @p, $_; - } - $prev = 'p'; - } -} -show(); - -- cgit v1.2.3