3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-30 07:59:42 +01:00

Add table of contents to factoids html export

This commit is contained in:
Pragmatic Software 2013-10-12 13:52:12 +00:00
parent 37dca64465
commit 02ebf106a8
2 changed files with 10 additions and 3 deletions

View File

@ -119,13 +119,20 @@ sub export_factoids {
print FILE '<script type="text/javascript" src="js/jquery-latest.js"></script>' . "\n"; print FILE '<script type="text/javascript" src="js/jquery-latest.js"></script>' . "\n";
print FILE '<script type="text/javascript" src="js/jquery.tablesorter.js"></script>' . "\n"; print FILE '<script type="text/javascript" src="js/jquery.tablesorter.js"></script>' . "\n";
print FILE "</head>\n<body><i>Last updated at $time</i>\n"; print FILE "</head>\n<body><i>Last updated at $time</i>\n";
print FILE "<hr><h2>Candide's factoids</h2>\n"; print FILE "<hr><h2>Candide's factoids</h2>\n<hr>\n";
my $i = 0; my $i = 0;
my $table_id = 1; my $table_id = 1;
foreach my $channel (sort keys %{ $self->factoids->hash }) { foreach my $channel (sort keys %{ $self->factoids->hash }) {
my $chan = $channel eq '.*' ? 'Global channel' : "Channel $channel"; my $chan = $channel eq '.*' ? 'global' : $channel;
print FILE "<a href='#" . $chan . "'>$chan</a><br>\n";
}
foreach my $channel (sort keys %{ $self->factoids->hash }) {
my $chan = $channel eq '.*' ? 'global' : $channel;
print FILE "<a name='$chan'></a>\n";
print FILE "<hr>\n<h3>$chan</h3>\n<hr>\n"; print FILE "<hr>\n<h3>$chan</h3>\n<hr>\n";
print FILE "<table border=\"0\" id=\"table$table_id\" class=\"tablesorter\">\n"; print FILE "<table border=\"0\" id=\"table$table_id\" class=\"tablesorter\">\n";
print FILE "<thead>\n<tr>\n"; print FILE "<thead>\n<tr>\n";

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 444, BUILD_REVISION => 445,
BUILD_DATE => "2013-10-12", BUILD_DATE => "2013-10-12",
}; };