summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/docs/notfinished4
-rw-r--r--lib/VNDB/Handler/Misc.pm37
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm2
-rw-r--r--static/f/style.css17
4 files changed, 57 insertions, 3 deletions
diff --git a/data/docs/notfinished b/data/docs/notfinished
index 8fc2669a..8b6b379f 100644
--- a/data/docs/notfinished
+++ b/data/docs/notfinished
@@ -1,4 +1,4 @@
-<span class="warning">
+<div class="warning">
This page is not yet finished!<br />
If you are interested in helping us finish it off, please join us on <a href="irc://irc.synirc.net/vndb">IRC</a>.
-</span>
+</div>
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index 78c828db..bd3939e3 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -11,6 +11,7 @@ use VNDB::Func;
YAWF::register(
qr{}, \&homepage,
qr{(?:([upvr])([1-9]\d*)/)?hist}, \&history,
+ qr{d([1-9]\d*)}, \&docpage,
qr{nospam}, \&nospam,
qr{([vrp])([1-9]\d*)/(lock|hide)}, \&itemmod,
@@ -23,6 +24,8 @@ YAWF::register(
sub { $_[0]->resRedirect("/v$_[1]", 'perm') },
qr{u/list(/[a-z0]|/all)?},
sub { my $l = defined $_[1] ? $_[1] : '/all'; $_[0]->resRedirect("/u$l", 'perm') },
+ qr{d([1-9]\d*)\.([1-9]\d*)},
+ sub { $_[0]->resRedirect("/d$_[1]#$_[2]", 'perm') },
);
@@ -164,6 +167,40 @@ sub history {
}
+sub docpage {
+ my($self, $did) = @_;
+
+ open my $F, '<', sprintf('%s/data/docs/%d', $VNDB::ROOT, $did) or return 404;
+ my @c = <$F>;
+ close $F;
+
+ (my $title = shift @c) =~ s/^:TITLE://;
+ chomp $title;
+
+ my $sec = 0;
+ for (@c) {
+ s{^:SUB:(.+)\r?\n$}{
+ $sec++;
+ qq|<h3><a href="#$sec" name="$sec">$sec. $1</a></h3>\n|
+ }eg;
+ s{^:INC:(.+)\r?\n$}{
+ open $F, '<', sprintf('%s/data/docs/%s', $VNDB::ROOT, $1) or die $!;
+ my $ii = join('', <$F>);
+ close $F;
+ $ii;
+ }eg;
+ }
+
+ $self->htmlHeader(title => $title);
+ div class => 'mainbox';
+ h1 $title;
+ div class => 'docs';
+ lit join '', @c;
+ end;
+ end;
+}
+
+
sub nospam {
my $self = shift;
$self->htmlHeader(title => 'Could not send form', noindex => 1);
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm
index d5da83a1..061c4b16 100644
--- a/lib/VNDB/Util/LayoutHTML.pm
+++ b/lib/VNDB/Util/LayoutHTML.pm
@@ -54,7 +54,7 @@ sub _menu {
a href => '/u/all', 'Users'; br;
a href => '/hist', 'Recent changes'; br;
a href => '/t', 'Discussion board'; br;
- a href => '#', 'FAQ'; br;
+ a href => '/d6', 'FAQ'; br;
a href => 'irc://irc.synirc.net/vndb', '#vndb';
lit ' (<a href="http://cgiirc.synirc.net/?chan=%23vndb">webchat</a>)';
end;
diff --git a/static/f/style.css b/static/f/style.css
index 1f018126..22514961 100644
--- a/static/f/style.css
+++ b/static/f/style.css
@@ -793,6 +793,23 @@ ul#catselect li li.exc { background-position: 0px -33px; color: #c00; }
+
+/***** Documentation pages *****/
+
+.docs { padding: 0 15% 20px 15%; }
+.docs h3 { margin-top: 25px; }
+.docs dd { padding-bottom: 5px; margin-left: 120px; }
+.docs dt { float: left }
+.docs ul.index { display: block; float: right; width: 150px; padding: 2px; margin: 0 0 10px 5px; background: url(/f/boxbg.png) repeat; border: 1px solid #258; }
+.docs ul.index li { list-style-type: none; }
+.docs ul.index li a { margin: 0 0 0 10px; }
+.docs .retired { text-decoration: line-through; }
+.docs dt b { color: #258; font-weight: normal; font-style: normal; font-size: 12px; }
+
+
+
+
+
/***** Warning/Notice Box *****/
div.warning, div.notice {