Misc. minor fixes, improvements and updates
This commit is contained in:
parent
2e29709225
commit
94ae88d4b9
10 changed files with 89 additions and 34 deletions
32
index.cgi
32
index.cgi
|
|
@ -82,6 +82,9 @@ TUWF::register(
|
|||
qr{ncdc/changes} => sub { changelog(shift, 'ncdc-changelog', 'ncdc', 'ncdc', 'changes', 'Ncdc Changelog') },
|
||||
qr{globster} => sub { podpage(shift, 'globster', 'globster', '', 'The Globster Direct Connect Client') },
|
||||
qr{globster/api} => sub { podpage(shift, 'globster-api', 'globster', 'api', 'The Globster D-Bus API', 1) },
|
||||
qr{globster/daemon} => sub { podpage(shift, 'globster-daemon', 'globster', 'daemon', 'The globster(1) Man Page', 1) },
|
||||
qr{globster/launch} => sub { podpage(shift, 'globster-launch', 'globster', 'launch', 'The globster-launch(1) Man Page', 1) },
|
||||
qr{globster/ctl} => sub { podpage(shift, 'globster-ctl', 'globster', 'ctl', 'The globsterctl(1) Man Page', 1) },
|
||||
qr{tuwf} => sub { podpage(shift, 'tuwf', 'tuwf', '', 'The Ultimate Website Framework') },
|
||||
qr{tuwf/man(?:/(db|misc|request|response|xml))?} => \&tuwfmanual,
|
||||
qr{tuwf/changes} => sub { changelog(shift, 'tuwf-changelog', 'TUWF', 'tuwf', 'changes', 'TUWF Changelog') },
|
||||
|
|
@ -301,7 +304,7 @@ sub bug_item {
|
|||
$s->htmlHeader(title => "\u$p: $last->{summary}", page => $p, sec => 'bug');
|
||||
br; a href => "/$p/bug", 'Back to the bug index'; br; br;
|
||||
$is->htmlItem($item);
|
||||
$is->htmlForm($last, "/$p/bug/post") if !$last->{closed};
|
||||
$is->htmlForm($last, "/$p/bug/post");
|
||||
br; a href => "/$p/bug", 'Back to the bug index'; br; br;
|
||||
$s->htmlFooter;
|
||||
}
|
||||
|
|
@ -322,8 +325,8 @@ sub htmlPOD {
|
|||
my($s, $file, $toc) = @_;
|
||||
require Pod::Simple::HTML;
|
||||
|
||||
# The usual output escaping function is terribly stupid
|
||||
{
|
||||
# The usual output escaping function is terribly stupid
|
||||
no warnings 'redefine', 'once';
|
||||
*Pod::Simple::HTML::esc = sub {
|
||||
return map TUWF::XML::html_escape($_), @_ if wantarray;
|
||||
|
|
@ -331,6 +334,18 @@ sub htmlPOD {
|
|||
$_ = TUWF::XML::html_escape($_) for(@_);
|
||||
return @_;
|
||||
};
|
||||
|
||||
# Let's override the manual page links
|
||||
*Pod::Simple::HTML::do_man_link = sub {
|
||||
my $l = $_[1]->attr('to');
|
||||
my %l = qw|
|
||||
globsterctl(1) /globster/ctl
|
||||
globster-launch(1) /globster/launch
|
||||
globster(1) /globster/daemon
|
||||
globster-api(7) /globster/api
|
||||
|;
|
||||
return $l{$l} || ($l =~ /(.+)\((.)\)/ and "http://manned.org/$1.$2");
|
||||
};
|
||||
}
|
||||
|
||||
my $p = Pod::Simple::HTML->new();
|
||||
|
|
@ -355,6 +370,9 @@ sub htmlPOD {
|
|||
$html =~ s/\[img ([^ ]+) ([^ ]+) ([^\]]*)\]/<img src="\/img\/$2" class="$1" alt="$3" \/>/g;
|
||||
$html =~ s{\[html\](.*)É}{(my $h = $1) =~ s/\>/>/g; $h =~ s/\</</g; $h =~ s/\&/\&/g; $h =~ s/\"/"/g; $h}egs;
|
||||
$html =~ s/\[yh-changes\]/$s->genChanges()/e;
|
||||
$html =~ s/<pre>( +(?:method|signal|property)) /<pre class="interface">$1 /g;
|
||||
#$html =~ s/ (method|signal|property [a-z]) ([a-zA-Z0-9]+)/ $1 <b>$2<\/b>/g;
|
||||
#$html =~ s/ (method|signal|property) / <b>$1<\/b> /g;
|
||||
lit $html;
|
||||
}
|
||||
|
||||
|
|
@ -440,7 +458,8 @@ sub htmlMenu {
|
|||
my $m = sub {
|
||||
li;
|
||||
my $s = $_[0] =~ m{^/([^/]+)} && $o{spec}{$1} && $o{page} ne $1;
|
||||
a href => $_[0], $s?(class=>'special'):$_[2]?(class=>'menusel'):(), $_[1];
|
||||
my @c = ($s?'special':(), $_[2]?'menusel':(), $_[4]?'tiny':());
|
||||
a href => $_[0], @c?(class => join ' ',@c):(), $_[1];
|
||||
if($_[3]) {
|
||||
ul;
|
||||
$_[3]->();
|
||||
|
|
@ -467,7 +486,12 @@ sub htmlMenu {
|
|||
$m->('/ncdc/bug', 'Bug tracker', $o{sec} eq 'bug');
|
||||
} elsif($o{page} eq 'globster') {
|
||||
$m->('/globster', 'Info', !$o{sec});
|
||||
$m->('/globster/api', 'API Docs', $o{sec} eq 'api');
|
||||
$m->('/globster/daemon', 'Commands', (scalar $o{sec} =~ /(daemon|ctl|launch)/), sub {
|
||||
$m->('/globster/daemon', 'globster', $o{sec} eq 'daemon', undef, 1);
|
||||
$m->('/globster/ctl', 'globsterctl', $o{sec} eq 'ctl', undef, 1);
|
||||
$m->('/globster/launch', 'globster-launch', $o{sec} eq 'launch', undef, 1);
|
||||
});
|
||||
$m->('/globster/api', 'API Doc', $o{sec} eq 'api');
|
||||
} elsif($o{page} eq 'tuwf') {
|
||||
$m->('/tuwf', 'Info', !$o{sec});
|
||||
$m->('/tuwf/man', 'Manual', $o{sec} eq 'man', sub {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue