support in bld for XML; proper settings for text filter (defaults)

This commit is contained in:
gferg 2000-11-13 20:51:53 +00:00
parent 9e74686f9e
commit 0d0d951bb9
1 changed files with 28 additions and 6 deletions

View File

@ -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 <stylesheet> -txt <txt_filter> -no_index <file>.sgml\n\n";
"-style <stylesheet> -txt <txt_filter> -no_index <file>.sgml\n\n",
" where:\n",
" <stylesheet> - fullpath to a DSSSL stylesheet\n",
" <txt_filter> - one of the following: lynx, w3m, html2text\n";