Thread POD als HTML ausgeben - wie auf search.cpan.org (4 answers)
Opened by pktm at 2012-07-18 16:54

pktm
 2012-07-18 21:22
#160036 #160036
User since
2003-08-07
2921 Artikel
BenutzerIn
[Homepage]
user image
Was macht denn das erste Argument von pod2html? Auf der Manpage sind irgendwie nur die Parametr erklärt.

Mein Ansatz bis jetzt:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!perl

use strict;
use warnings;
use utf8;
use Pod::Html;
use Tk;
use Tk::LabEntry;
use FindBin qw/$Bin/;

my $mw = tkinit();

my $selection_frame = $mw->Frame()->pack(-fill => 'x');
my $e = $selection_frame->LabEntry(
-label => 'POD file:',
-labelPack => [-side => 'left'],
-bg => 'white',
)->pack(-side => 'left', -fill => 'x', -expand => 1);

my $selbtn = $selection_frame->Button(
-text => '...',
-command => sub{
my @valid_types = (
['Perl modules', '.pm'],
['POD files', '.pod'],
['All files', '*.*'],
);
my $file = $mw->getOpenFile(
-filetypes => \@valid_types,
-initialdir => $Bin,
);
if( $file ) {
# a file has been chosen
$e->delete(0, 'end');
$e->insert(0, $file);
}
},
)->pack();

my $convert_btn = $mw->Button(
-text => 'convert',
-command => sub{
my $infile = $e->get();
my $outfile = $infile . '.html';
Pod::Html::pod2html("pod2html",
"--infile=\"$infile\"",
"--outfile=\"$outfile\""
);
},
)->pack(-fill => 'x',);

$mw->MainLoop();
exit(0); # exit normally (0)
http://www.intergastro-service.de (mein erstes CMS :) )

View full thread POD als HTML ausgeben - wie auf search.cpan.org