From 97c6d1a90315f5772bb2d50e9b53304ca557be4e Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 5 Apr 2013 13:13:52 -0500 Subject: [PATCH] Add podToHtml.pl script New rules to use this for .pod and .pm conversions Replace use of pod2html in ca/client/perl --- configure/RULES.Db | 11 +++++++++ src/ca/client/perl/Makefile | 4 ---- src/tools/Makefile | 1 + src/tools/podToHtml.pl | 47 +++++++++++++++++++++++++++++++++++++ src/tools/style.css | 1 + 5 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 src/tools/podToHtml.pl diff --git a/configure/RULES.Db b/configure/RULES.Db index 0cf703e5f..e1b981851 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -13,6 +13,7 @@ SUBST_SUFFIX ?= .substitutions ##################################################### vpath +vpath %.pm $(USR_VPATH) $(SRC_DIRS) $(dir $(DBD)) vpath %.pod $(USR_VPATH) $(SRC_DIRS) $(dir $(DBD)) vpath %.dbd $(USR_VPATH) $(SRC_DIRS) $(dir $(DBD)) vpath %.db $(USR_VPATH) $(SRC_DIRS) $(dir $(DB)) @@ -407,6 +408,16 @@ $(COMMON_DIR)/%.html: %.dbd.pod $(TOOLS)/dbdToHtml.pl $(PERL) $(TOOLS)/dbdToHtml.pl $(DBDFLAGS) -o $(notdir $@) $< @$(MV) $(notdir $@) $@ +$(COMMON_DIR)/%.html: %.pod $(TOOLS)/podToHtml.pl + @$(RM) $(notdir $@) + $(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $< + @$(MV) $(notdir $@) $@ + +$(COMMON_DIR)/%.html: %.pm $(TOOLS)/podToHtml.pl + @$(RM) $(notdir $@) + $(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $< + @$(MV) $(notdir $@) $@ + .PRECIOUS: $(COMMON_DIR)/%.html ##################################################### DB files diff --git a/src/ca/client/perl/Makefile b/src/ca/client/perl/Makefile index b3fe549c7..1fb8627fc 100644 --- a/src/ca/client/perl/Makefile +++ b/src/ca/client/perl/Makefile @@ -61,10 +61,6 @@ ifdef T_A $(RM) $@ $@_new $(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap $< > $@_new && $(MV) $@_new $@ - %.html: ../%.pm - $(RM) $@ - podchecker $< && pod2html --infile=$< --outfile=$@ - $(INSTALL_PERL_MODULES)/$(PERL_ARCHPATH)/%: % $(ECHO) "Installing loadable shared library $@" @$(INSTALL_LIBRARY) -d -m $(LIB_PERMISSIONS) $< $(INSTALL_PERL_MODULES)/$(PERL_ARCHPATH) diff --git a/src/tools/Makefile b/src/tools/Makefile index d62e4bba1..60320b054 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -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 diff --git a/src/tools/podToHtml.pl b/src/tools/podToHtml.pl new file mode 100644 index 000000000..2baf9e80f --- /dev/null +++ b/src/tools/podToHtml.pl @@ -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; +} diff --git a/src/tools/style.css b/src/tools/style.css index fe0ad441c..905162a98 100644 --- a/src/tools/style.css +++ b/src/tools/style.css @@ -80,6 +80,7 @@ DIV { DT { margin-top: 1em; + font-weight: bold; } .credits TD {