From 3f6b081865d551ada1cff8ad2029dbc0ea3152a9 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sun, 5 Sep 2010 19:42:46 +0100 Subject: added some requests for help notes to the index page --- docs/General/Signals.pod | 6 +++--- docs/buildpod.pl | 6 ++++++ docs/buildsignals.pl | 51 ++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 58 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/General/Signals.pod b/docs/General/Signals.pod index f12dd7f..4720bee 100644 --- a/docs/General/Signals.pod +++ b/docs/General/Signals.pod @@ -131,7 +131,7 @@ Arguments are passed to signal handlers in the usual way, via C<@_>. =over -=item C, +=item string C<$command>, =item L C<$server>, @@ -2089,8 +2089,8 @@ B =back -B =item C<"window changed automatic"> diff --git a/docs/buildpod.pl b/docs/buildpod.pl index 050ea8e..dfddf54 100755 --- a/docs/buildpod.pl +++ b/docs/buildpod.pl @@ -28,6 +28,12 @@ sub new { "Irssi Scripting Documentation\n", "\n", "

Irssi Scripting Documentation

\n", + q(

This is a work in progress. If you ), + q(find something obviously wrong, or have requests ), + q(for further documentation on topics not yet ), + q(filled out, please ), + q(create an issue), + " on my Github page, and I'll see what I can do.

", ); $obj->contents_page_start(join("", @index_header)); diff --git a/docs/buildsignals.pl b/docs/buildsignals.pl index 5409ae2..b2afc2a 100755 --- a/docs/buildsignals.pl +++ b/docs/buildsignals.pl @@ -4,8 +4,10 @@ use strict; use warnings; #use Pod::Simple::Debug (3); use Data::Dumper; +$|++; package Pod::Simple::IrssiSignalParser; +$|++; use base qw/Pod::Simple::PullParser/; use Carp qw/cluck/; @@ -91,7 +93,8 @@ sub validate_token { my ($self, $token, $expected, $type) = @_; unless ($token->type eq $type && $token->is_tag($expected)) { - cluck "Eeek. Expected $expected: $type, got $token->type"; + cluck "Eeek. Expected $expected: $type, got " + . $token->dump(); # cluck("Invalid token. " # on line " . $token->attr('start_line') # . "expected $expected $type, got " . $token->tag @@ -174,8 +177,52 @@ sub process_def_entry { my $token; print "Processing definition entry\n"; while ($token = $self->get_token()) { + print "Token is ", $token->dump, "\n"; last if $token->is_end && $token->tag eq 'item-text'; + + $self->validate_token($token, 'item-text', 'start'); + $token = $self->get_token(); + $self->validate_token($token, 'C', 'start'); + $token = $self->get_token(); + + if ($token->is_text) { + my $sig_name = $token->text; + print "Signal: $sig_name\n"; + } + + $token = $self->get_token(); + + $self->validate_token($token, 'C', 'end'); + $token = $self->get_token(); + print "matched end of code\n"; + + $self->validate_token($token, 'item-text', 'end'); + $token = $self->get_token(); + + print "matched end of header list\n"; + + $self->validate_token($token, 'over-text', 'start'); + $token = $self->get_token(); + + print "matched start of args list\n"; + + $self->validate_token($token, 'item-text', 'start'); + $token = $self->get_token(); + + # consume argument list. + until ($token->is_end && $token->tag eq 'over-text') { + $token = $self->get_token(); + print "waiting for arglist Token: " . $token->dump() . "\n"; + } + print "Token now: ", $token->dump(), $/; + + print "consumed arg list\n"; + $token = $self->get_token(); + print "Token now: ", $token->dump(), $/; + $self->validate_token($token, 'item-text', 'end'); + $token = $self->get_token(); + } #$self->unget_token($token); print "Done Processing definition entry\n"; @@ -184,7 +231,7 @@ sub process_def_entry { package main; -my $input_file = $ARGV[0] // 'Signals.pm'; +my $input_file = $ARGV[0] // 'General/Signals.pod'; my $parser = Pod::Simple::IrssiSignalParser->new; $parser->accept_targets('irssi_signal_defs', 'irssi_signal_types'); -- cgit v1.2.3