From 0d0d951bb9be902f84b34e5112aac5c0462803e5 Mon Sep 17 00:00:00 2001 From: gferg <> Date: Mon, 13 Nov 2000 20:51:53 +0000 Subject: [PATCH] support in bld for XML; proper settings for text filter (defaults) --- LDP/builder/ldp_mk | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/LDP/builder/ldp_mk b/LDP/builder/ldp_mk index 083e023f..f49da1ec 100644 --- a/LDP/builder/ldp_mk +++ b/LDP/builder/ldp_mk @@ -56,13 +56,11 @@ if( !(-e "$fname") ) { exit(0); } -if( $txt_filter eq '' ) { - $txt_filter = 'lynx'; -} if( $style eq '' ) { $style = "$_toolroot/dsssl/docbook/html/ldp.dsl#html"; } + # determine DTD # open(FP_IN, "head -20 $fname | grep -i '\!doctype' |") || @@ -81,6 +79,10 @@ if( $s =~ /linuxdoc/i ) { $linuxdoc = 1; print "\nldp_mk: $fname is LinuxDoc SGML\n"; + if( $txt_filter eq '' ) { + $txt_filter = 'lynx'; + } + } else { # determine docbook version @@ -109,6 +111,10 @@ if( $s =~ /linuxdoc/i ) { $linuxdoc = 0; print "\nldp_mk: $fname is DocBook (vers. $db_v) $dtd\n"; + + if( $txt_filter eq '' ) { + $txt_filter = 'w3m'; + } } @@ -230,16 +236,32 @@ if( -e "$fname_wo_ext.txt" ) { # print "\nldp_mk: creating PDF from $fname...\n"; +my($print_str) = ''; + if( $linuxdoc == 1 ) { + + # patch the linuxdoc-source single HTML file + # system("$_toolroot/sgml_ld_1html $fname"); + $print_str = "00_${fname_wo_ext}.html"; + +} else { + + # create new files from DocBook-source single HTML file to use for print + # + require "$_toolroot/lib/fix_print_html.lib"; + &fix_print_html("00_${fname_wo_ext}.html", 'body.html', 'title.html'); + + $print_str = "--titlefile title.html body.html"; } + if( -e "00_$fname_wo_ext.html" ) { $cmd = "$_toolroot/htmldoc/bin/htmldoc --size universal -t pdf -f " . - "$fname_wo_ext.pdf 00_" . "$fname_wo_ext.html; " . + "$fname_wo_ext.pdf $print_str; " . "$_toolroot/htmldoc/bin/htmldoc --size universal -t ps -f " . - "$fname_wo_ext.ps 00_" . "$fname_wo_ext.html"; + "$fname_wo_ext.ps $print_str"; system($cmd); if( !(-e "$fname_wo_ext.pdf") ) { @@ -321,7 +343,7 @@ sub usage { print "\n\n", "usage: ldp_mk ", - "-style -txt -no_index .sgml\n\n"; + "-style -txt -no_index .sgml\n\n", " where:\n", " - fullpath to a DSSSL stylesheet\n", " - one of the following: lynx, w3m, html2text\n";