',
LICENSE => 'gpl_3',
SIGN => 1,
META_MERGE =>
{ 'meta-spec' => { version => 2 },
no_index => { directory=>['devel','xt'] },
resources =>
{ homepage => 'http://user42.tuxfamily.org/html-formatexternal/index.html',
license => 'http://www.gnu.org/licenses/gpl.html',
},
prereqs =>
{ test =>
{ suggests =>
{ 'HTML::TreeBuilder' => 0,
'Taint::Util' => 0,
},
},
},
},
);
HTML-FormatExternal-26/examples/ 0002755 0001750 0001750 00000000000 12570233261 014375 5 ustar gg gg HTML-FormatExternal-26/examples/demo.pl 0000755 0001750 0001750 00000002323 12153223307 015654 0 ustar gg gg #!/usr/bin/perl -w
# Copyright 2008, 2010, 2013 Kevin Ryde
# HTML-FormatExternal is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3, or (at your option) any
# later version.
#
# HTML-FormatExternal is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with HTML-FormatExternal. If not, see .
use strict;
use warnings;
use HTML::FormatText::Lynx;
my $html = <<'HERE';
A Page
Hello this is some sample html input, with
a link to your local host's
toplevel index file.
HERE
my $str = HTML::FormatText::Lynx->format_string ($html,
leftmargin => 5,
rightmargin => 40);
print $str;
exit 0;
HTML-FormatExternal-26/inc/ 0002755 0001750 0001750 00000000000 12570233261 013330 5 ustar gg gg HTML-FormatExternal-26/inc/my_pod2html 0000755 0001750 0001750 00000007507 12175610062 015522 0 ustar gg gg #!/usr/bin/perl
# my_pod2html -- convert POD to HTML, with some mangling
# Copyright 2009, 2010, 2011, 2013 Kevin Ryde
# my_pod2html is shared by several distributions.
#
# my_pod2html is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3, or (at your option) any later
# version.
#
# my_pod2html is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this file. If not, see .
use strict;
use warnings;
#use Smart::Comments;
my $pod2html = MyPod2HTML->new;
# and both too big, in mozilla at least
$pod2html->html_h_level(3);
$pod2html->parse_from_file(@ARGV);
exit 0;
package MyPod2HTML;
use base 'Pod::Simple::HTML';
our $VERSION = 1;
use constant DEBUG => 0;
my %table =
('apt-file' => 'http://packages.debian.org/apt-file',
'apt-cache' => 'http://packages.debian.org/apt',
'apt-rdepends' => 'http://packages.debian.org/apt-rdepends',
'gtk-options' => 'http://manpages.ubuntu.com/manpages/jaunty/man7/gtk-options.7.html',
'xsetroot' => 'http://www.x.org/archive/X1'.'1R7.5/doc/man/man1/xsetroot.1.html',
'leafnode' => 'http://leafnode.sourceforge.net',
'lynx' => 'http://lynx.isc.org/',
'feed2imap' => 'http://home.gna.org/feed2imap',
# disguise from grep
'rss'.'2email' => 'http://rss'.'2email.infogami.com',
'rssdrop' => 'http://search.cpan.org/dist/rssdrop/',
'toursst' => 'http://packages.debian.org/etch/toursst',
'netrc' => 'http://linux.die.net/man/5/netrc',
# no online man pages apparently at http://man-db.nongnu.org/
'man' => 'http://ftp.parisc-linux.org/cgi-bin/man/man2html?man+1',
'lexgrog' => 'http://ftp.parisc-linux.org/cgi-bin/man/man2html?lexgrog+1',
'apropos' => 'http://ftp.parisc-linux.org/cgi-bin/man/man2html?apropos+1',
);
sub resolve_man_page_link {
my ($self, $to, $frag) = @_;
$to = "$to"; # Pod::Simple::LinkSection object
### $to
if (my ($page, $section) = ($to =~ /(.*)\(\d+\)$/)) {
### $page
if (my $url = $table{$page}) {
return $url;
}
}
return shift->SUPER::resolve_man_page_link (@_);
}
sub resolve_pod_link_by_table {
my ($self, $to, $section) = @_;
my $url;
if (defined $to) {
if ($to eq 'AptPkg') {
$url = 'http://packages.debian.org/libapt-pkg-perl';
}
if ($to =~ /^Glib::Ex::(SourceIds|SignalIds|FreezeNotify|TieProperties)/) {
$url = "http://user42.tuxfamily.org/glib-ex-ob"."jectbits/$1.html";
}
if ($to eq 'Gtk2::Ex::Widget'.'Cursor') {
$url = 'http://user42.tuxfamily.org/gtk2-ex-widget'.'cursor/Widget'.'Cursor.html';
}
if ($to eq 'Ti'.'e:'.':TZ') {
$url = 'http://user42.tuxfamily.org/ti'.'e-'.'tz/TZ.html';
}
if ($to eq 'Time:'.':TZ') {
$url = 'http://user42.tuxfamily.org/ti'.'e-'.'tz/Time-'.'TZ.html';
}
if ($to =~ /^(Glib|Gtk2)($|::(?!Ex::))/) {
$to =~ s{::}{/};
$url = "http://gtk2-perl.sourceforge.net/doc/pod/$to.html"
}
if (defined $url) {
return ($url . (defined $section && $section ne '' ? "#$section" : ''));
}
}
return $self->SUPER::resolve_pod_link_by_table($to, $section);
}
# sub do_pod_link {
# my($self, $link) = @_;
# if (DEBUG) {
# print "\nlink tag=",$link->tagname," type=",$link->attr('type'),"\n";
# print " to=",$link->attr('to')||'[none]',"\n";
# print " section=",$link->attr('section')||'[none]',"\n";
# }
#
# my $to = $link->attr('to') || ''; # undef if internal link
#
# return $self->SUPER::do_pod_link($link);
# }
HTML-FormatExternal-26/devel/ 0002755 0001750 0001750 00000000000 12570233261 013656 5 ustar gg gg HTML-FormatExternal-26/devel/element-format.pl 0000644 0001750 0001750 00000005451 12103121371 017123 0 ustar gg gg #!/usr/bin/perl -w
# Copyright 2013 Kevin Ryde
# HTML-FormatExternal is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3, or (at your option) any
# later version.
#
# HTML-FormatExternal is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with HTML-FormatExternal. If not, see .
use strict;
use warnings;
use Module::Load;
use HTML::TreeBuilder;
use Data::Dumper;
$Data::Dumper::Useqq = 1;
use FindBin qw($Bin);
my $class;
$class = 'HTML::FormatText::WithLinks';
$class = 'HTML::FormatText::WithLinks::AndTables';
$class = 'HTML::FormatText::W3m';
$class = 'HTML::FormatText';
$class = 'HTML::FormatText::Netrik';
$class = 'HTML::FormatText::Links';
$class = 'HTML::FormatText::Html2text';
$class = 'HTML::FormatText::Elinks';
$class = 'HTML::FormatText::Lynx';
Module::Load::load ($class);
#
{
# output_charset => 'ascii',
# output_charset => 'ANSI_X3.4-1968',
# output_charset => 'utf-8'
my $output_charset = 'utf-8';
# input_charset => 'shift-jis',
# input_charset => 'iso-8859-1',
# input_charset => 'utf-8',
my $input_charset;
$input_charset = 'utf16le';
$input_charset = 'ascii';
my $formatter = $class->new (
input_charset => $input_charset,
output_charset => $output_charset,
rightmargin => 60,
# leftmargin => 20,
justify => 1,
base => "http://foo.org/\x{2022}/foo.html",
# lynx_options => [ '-underscore',
# '-underline_links',
# '-with_backspaces',
# ],
justify => 1,
);
# {
# my $filename = "$FindBin::Bin/base.html";
# # my $filename = "/tmp/rsquo.html";
# my $tree = HTML::TreeBuilder->new;
# $tree->parse_file($filename);
# }
my $tree = HTML::Element->new('a', href => 'http://www.perl.com/');
$tree->push_content("The Perl Homepage");
print "$tree\n";
print $tree->as_HTML;
my $str = $tree->format($formatter);
$Data::Dumper::Purity = 1;
print $str;
print Data::Dumper->new([\$str],['output'])->Useqq(0)->Dump;
print "utf8 flag ",(utf8::is_utf8($str) ? 'yes' : 'no'), "\n";
exit 0;
}
HTML-FormatExternal-26/devel/wide.pl 0000644 0001750 0001750 00000001705 12510414274 015143 0 ustar gg gg #!/usr/bin/perl -w
# Copyright 2015 Kevin Ryde
# HTML-FormatExternal is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3, or (at your option) any
# later version.
#
# HTML-FormatExternal is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with HTML-FormatExternal. If not, see .
use strict;
use warnings;
use Data::Dumper;
use HTML::FormatText;
use charnames ':full';
$Data::Dumper::Useqq=1;
my $html = "\x{263A}";
my $formatter = HTML::FormatText->new;
my $str = $formatter->format_string($html);
print Dumper(\$str);
exit 0;
HTML-FormatExternal-26/devel/base-utf16.html 0000644 0001750 0001750 00000003270 11343641066 016424 0 ustar gg gg ÿþ<