package main;
require "html/quote.pl";
require "pages/listfiles.pl";
package prep;
require "html/util.pl";
# even i cannot avoid having dedicated google code
$YOUTUBE = 'https://youtube.com/v/';
$CATCH_TEXT=1;
$NUMBERS=0;
$SECTION=0;
$POINT=0;
$FN=0;
undef %fn;
sub do_verbatim_on { $CATCH_TEXT=0; }
sub do_verbatim_off { $CATCH_TEXT=1; }
sub do_numbers_on { $NUMBERS=1; }
sub do_numbers_off { $NUMBERS=0; }
sub text {
$_ = shift;
# print STDERR "doing: $_\n" if
s/^\s*$/\n
/g;
s/--/—/g;
# allow for a simple list syntax
s/^- (.*)$/&do_item($1)/ge;
# support for super sick discourse syntax. at least it is unique:
s:\[(.+?)\]\(http(.+?)\):$1:g;
# support for simplified mediawiki/lqfb linking syntax
s:\[(http\S+) (.+?)\]:$2:g;
return $_;
}
my $titel;
my $charset;
sub do_title { return do_kopf(shift, 'UTF-8'); }
sub do_kopf {
$titel = shift;
$charset = shift || "iso-8859-15";
my $lang = $VAR{lang} || "en";
# fits tab-blue.jpg:
# .co { width: 500; margin: 262; font-size: 120% }
# .s { background-color: #ccc; color: #000000; font-size: 120%;
# .sc { background-color: #ffffff; color: #000000; border: 1px solid #000000; padding: 7px; }
# border: 1px solid #000000; padding: 7px; }
my $x = <my.pages - $titel
X
## .outer,blockquote { background-image: url(/img/azzurro.png); padding:12px; }
## Content-Type: firefox on mac kriegt es nicht von alleine hin. merkwürdig eigentlich.
##
X
return $x;
}
sub do_datum {
my $datum = shift;
return <$datum
X
}
sub do_header {
my $anchor = shift;
my $text = shift;
my $ref = shift;
$text = do_ref($ref, $text) if $ref;
return <
$text
X
}
sub do_headline {
my $t = shift;
return <$t
X
}
sub do_scream {
die "Encountered old #scream";
}
sub do_footnotes {
my $t = <
X
for (my $i=1; $i<=$FN; $i++) {
$t .= <$i. $fn[$i]
X
}
return $t . <
X
}
sub do_fn {
my $t = shift;
# this hack isn't actually needed:
# $t =~ tr:[]:(): if $VAR{LQFB};
$fn[++$FN] = $t;
# using () instead of [] so that i can mousepaste it into LQFB
return "($FN)";
}
sub do_ref {
my ($url, $name) = @_;
$name = $url unless $name;
die "You forgot a comma in the $url ref!" if $url =~ / /;
return ''. $name .'';
}
sub do_tag {
($_) = @_;
$_ = "#".$_ unless /^#/;
return "". $_ .'';
}
sub do_deftag {
($_) = @_;
$_ = "#".$_ unless /^#/;
return "". $_ .'';
}
sub do_pic {
my ($file, $w, $h, $tit) = @_;
$tit = $file unless $tit;
return <
X
}
sub do_youtube {
my ($f, $x, $y, $o) = @_;
$f = "aydle3MuPKk" unless $f;
my $p = $f;
$p .= $o || "&color1=0x000000&color2=0x000000";
$x = 600 unless $x;
$y = $x*3.21/4 unless $y;
return <
X
sub do_youtube2 {
my $v = shift;
return <
X
}
sub do_quote_start { return <
“
X
sub do_quote_end { return <
”
X
sub do_quote { return do_quote_start. shift() .do_quote_end; }
sub do_unterschrift {
my $link = shift;
# $link = "http://wiki.piratenpartei.de/User:lynX" unless $link;
$link = "http://my.pages.de/me" unless $link;
return <—lynX
X
}
sub do_repost {
my ($seite, $quicklink) = @_;
$seite = '' unless $seite;
my $tit = $titel? "&title=$titel": '';
$quicklink = "http://my.pages.de/$seite" unless $quicklink;
##Discuss this topic on
##Billy Idle.
return <