Mail-LMLM

 view release on metacpan or  search on metacpan

lib/Mail/LMLM/Render/HTML.pm  view on Meta::CPAN

    }

    print { *{$o} } "<h2${id_attr}>";
    if ( exists( $options->{'title_url'} ) )
    {
        print { *{$o} } "<a href=\"" . $options->{'title_url'} . "\">";
    }
    $self->text($title);
    if ( exists( $options->{'title_url'} ) )
    {
        print { *{$o} } "</a>";
    }
    print { *{$o} } "</h2>";
    print { *{$o} } "\n\n";

    return 0;
}

sub start_para
{
    my $self = shift;

    print { *{ $self->{'out'} } } ("<p>\n");

    return 0;
}

sub end_para
{
    my $self = shift;

    print { *{ $self->{'out'} } } ("\n</p>\n");

    return 0;
}

sub end_section
{
    my $self = shift;

    print { *{ $self->{'out'} } } ("\n\n");

    return 0;
}

sub start_document
{
    my $self = shift;

    my $head_title = shift;

    my $body_title = shift;

    $head_title = _htmlize($head_title);

    my $o = $self->{'out'};

    print { *{$o} } <<"EOF" ;
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>$head_title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="./style.css" type="text/css" />
</head>
<body>
EOF

    print { *{$o} } ("<h1>");

    $self->text($body_title);

    print { *{$o} } ("</h1>\n\n");

    return 0;
}

sub end_document
{
    my $self = shift;

    print { *{ $self->{'out'} } } ( "\n" . "</body>\n" . "</html>\n" );

    return 0;
}

sub horizontal_line
{
    my $self = shift;

    print { *{ $self->{'out'} } } ("\n\n<hr />\n\n");

    return 0;
}

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

Mail::LMLM::Render::HTML - backend for rendering HTML.

=head1 VERSION

version 0.6807

=head1 SYNOPSIS

    use Mail::LMLM::Render::HTML;

    open O, ">out.html";
    my $r = Mail::LMLM::Render::HTML->new(\*O);



( run in 1.084 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )