Add podToHtml.pl script
New rules to use this for .pod and .pm conversions Replace use of pod2html in ca/client/perl
This commit is contained in:
committed by
Ralph Lange
co-authored by
Ralph Lange
parent
b27439ce7b
commit
97c6d1a903
@@ -49,6 +49,7 @@ PERL_SCRIPTS += dbdToMenuH.pl
|
||||
PERL_SCRIPTS += dbdToRecordtypeH.pl
|
||||
PERL_SCRIPTS += dbdExpand.pl
|
||||
PERL_SCRIPTS += dbdToHtml.pl
|
||||
PERL_SCRIPTS += podToHtml.pl
|
||||
PERL_SCRIPTS += registerRecordDeviceDriver.pl
|
||||
|
||||
HTMLS = style.css
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env perl
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Getopt::Std;
|
||||
use Pod::Simple::HTML;
|
||||
|
||||
our ($opt_o);
|
||||
|
||||
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
|
||||
&HELP_MESSAGE if !getopts('o:') || @ARGV != 1;
|
||||
|
||||
my $infile = shift @ARGV;
|
||||
|
||||
if (!$opt_o) {
|
||||
($opt_o = $infile) =~ s/\. \w+ $/.html/x;
|
||||
$opt_o =~ s/^.*\///;
|
||||
}
|
||||
|
||||
open my $out, '>', $opt_o or
|
||||
die "Can't create $opt_o: $!\n";
|
||||
|
||||
my $podHtml = Pod::Simple::HTML->new();
|
||||
|
||||
$podHtml->html_css('style.css');
|
||||
$podHtml->perldoc_url_prefix('');
|
||||
$podHtml->perldoc_url_postfix('.html');
|
||||
$podHtml->set_source($infile);
|
||||
$podHtml->output_string(\my $html);
|
||||
$podHtml->run;
|
||||
|
||||
print $out $html;
|
||||
close $out;
|
||||
|
||||
sub HELP_MESSAGE {
|
||||
print STDERR "Usage: podToHtml.pl [-o file.html] file.pod\n";
|
||||
exit 2;
|
||||
}
|
||||
@@ -80,6 +80,7 @@ DIV {
|
||||
|
||||
DT {
|
||||
margin-top: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.credits TD {
|
||||
|
||||
Reference in New Issue
Block a user