NAME
HTML::Object::DOM::Element::${class} - HTML Object DOM ${class} Class
SYNOPSIS
use HTML::Object::DOM::Element::${class};
my \$\L$class\E = HTML::Object::DOM::Element::${class}->new ||
die( HTML::Object::DOM::Element::${class}->error, "\\n" );
VERSION
v0.1.0
DESCRIPTION
$desc
PROPERTIES
Inherits properties from its parent HTML::Object::DOM::Element
EOT
foreach my $prop ( sort( keys( %$props ) ) )
{
my $def = $props->{ $prop };
$mod_file->print( "=head2 $prop\n\n" );
if( $def->{is_readonly} )
{
$mod_file->print( "Read-only.\n\n" );
}
$mod_file->print( $def->{description}, "\n\n" ) if( $def->{description} );
my $codes = $def->{codes};
# print( "# \$codes is '$codes'\n" );
if( $codes && !$codes->is_empty )
{
$mod_file->print( "Example:\n\n" );
$codes->for(sub
{
my( $i, $ref ) = @_;
my $formatted = " " . join( "\n ", split( /\n/, $ref->{perl} ) );
# Remove empty space, because perl pod would produce warnings
$formatted =~ s/\n[[:blank:]\h]+\n/\n\n/gs;
$mod_file->print( $formatted, "\n\n" );
if( $i > 0 && $i != $codes->size )
{
$mod_file->print( "Another example:\n\n" );
}
});
}
if( $def->{link} )
{
$mod_file->printf( "See also L<Mozilla documentation|%s>\n\n", $def->{link} );
}
}
$mod_file->print( "=head1 METHODS\n\n" );
$mod_file->print( "Inherits methods from its parent L<HTML::Object::DOM::Element>\n\n" );
foreach my $meth ( sort( keys( %$methods ) ) )
{
my $def = $methods->{ $meth };
$mod_file->print( "=head2 $meth\n\n" );
$mod_file->print( $def->{description}, "\n\n" ) if( $def->{description} );
my $codes = $def->{codes};
if( $codes && !$codes->is_empty )
{
$mod_file->print( "Example:\n\n" );
$codes->for(sub
{
my( $i, $ref ) = @_;
my $formatted = " " . join( "\n ", split( /\n/, $ref->{perl} ) );
# Remove empty space, because perl pod would produce warnings
$formatted =~ s/\n[[:blank:]\h]+\n/\n\n/gs;
$mod_file->print( $formatted, "\n\n" );
if( $i > 0 && $i != $codes->size )
{
$mod_file->print( "Another example:\n\n" );
}
});
}
if( $def->{link} )
{
$mod_file->printf( "See also L<Mozilla documentation|%s>\n\n", $def->{link} );
}
}
if( scalar( keys( %$events ) ) )
{
$mod_file->print( <<EOT );
=head1 EVENTS
Event listeners for those events can also be found by prepending on before the event type:
click event listeners can be set also with onclick method:
\$e->onclick(sub{ # do something });
# or as an lvalue method
\$e->onclick = sub{ # do something };
EOT foreach my $event ( sort( keys( %$events ) ) ) { my $def = $events->{ $event }; $mod_file->print( "=head2 $event\n\n" ); $mod_file->print( $def->{description}, "\n\n" ) if( $def->{description} ); my $codes = $def->{codes}; if( $codes && !$codes->is_empty ) { $mod_file->print( "Example:\n\n" ); $codes->for(sub { my( $i, $ref ) = @_; my $formatted = " " . join( "\n ", split( /\n/, $ref->{perl} ) ); # Remove empty space, because perl pod would produce warnings $formatted =~ s/\n[[:blank:]\h]+\n/\n\n/gs; $mod_file->print( $formatted, "\n\n" ); if( $i > 0 && $i != $codes->size ) { $mod_file->print( "Another example:\n\n" ); } }); } if( $def->{link} ) { $mod_file->printf( "See also Mozilla documentation\n\n", $def->{link} ); } } }
if( scalar( keys( %$handlers ) ) )
{
$mod_file->print( "=head1 EVENT HANDLERS\n\n" );
foreach my $handler ( sort( keys( %$handlers ) ) )
{
my $def = $handlers->{ $handler };
$mod_file->print( "=head2 $handler\n\n" );
$mod_file->print( $def->{description}, "\n\n" ) if( $def->{description} );
my $codes = $def->{codes};
if( $codes && !$codes->is_empty )
{
$mod_file->print( "Example:\n\n" );
$codes->for(sub
{
my( $i, $ref ) = @_;
my $formatted = " " . join( "\n ", split( /\n/, $ref->{perl} ) );
# Remove empty space, because perl pod would produce warnings
$formatted =~ s/\n[[:blank:]\h]+\n/\n\n/gs;
$mod_file->print( $formatted, "\n\n" );
if( $i > 0 && $i != $codes->size )
{
$mod_file->print( "Another example:\n\n" );
}
});
}
if( $def->{link} )
{
$mod_file->printf( "See also L<Mozilla documentation|%s>\n\n", $def->{link} );
}
}
}
$mod_file->print( <<EOT );
=head1 AUTHOR
Jacques Deguest <jack\@deguest.jp>
SEE ALSO
Mozila documentation, Mozilla documentation on \L${class}\E element
COPYRIGHT & LICENSE
Copyright(c) ${year} DEGUEST Pte. Ltd.
All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.