mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 21:52:28 -05:00
convert the faq more
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1807 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
02cab124c3
commit
4d52ba710a
1 changed files with 20 additions and 1 deletions
|
|
@ -1,15 +1,34 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
# this is really a faq2html and should only be used for this purpose
|
||||||
|
|
||||||
while(<STDIN>) {
|
while(<STDIN>) {
|
||||||
|
|
||||||
$_ =~ s/\</</g;
|
$_ =~ s/\</</g;
|
||||||
$_ =~ s/\>/>/g;
|
$_ =~ s/\>/>/g;
|
||||||
|
|
||||||
$_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^).])/\<a href=\"$1\"\>$1\<\/a\>/g;
|
$_ =~ s/(http:\/\/([a-zA-Z0-9_.\/-]*)[^\).])/\<a href=\"$1\"\>$1\<\/a\>/g;
|
||||||
|
|
||||||
$_ =~ s/^$/\ /g; # empty lines are nbsp
|
$_ =~ s/^$/\ /g; # empty lines are nbsp
|
||||||
$_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line
|
$_ =~ s/(\\|\/)$/$1 /g; # clobber backslash on end of line
|
||||||
|
|
||||||
|
|
||||||
|
# detect and mark Q-sections
|
||||||
|
if( $_ =~ /^Q(\d*)/) {
|
||||||
|
print "</pre>\n<a name=\"$1\"></a><p class=\"faqq\">$_";
|
||||||
|
my $line;
|
||||||
|
while(<STDIN>) {
|
||||||
|
$line = $_;
|
||||||
|
if($_ !~ /^A/) {
|
||||||
|
print "$_";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</p>\n<pre class=\"faqa\">\n$line";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
print $_;
|
print $_;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue