#!/bin/sh #----------------------------------------------------------------------------- # sgml2html # # Inputs: # ------- # $1 SGML file name # $2 directory name of the generated HTML files # $3 collection name # # Generated Files: # ---------------- # chap*.htm {preface*.htm, appx*.htm} HTML files for chapters, sections ... # toc*.htm files of TOC at chapter and sections levels # .log Log file #----------------------------------------------------------------------------- # (c) Copyright 1996 Novell, Inc. # All rights reserved. # # This program is an unpublished copyrighted work which is proprietary # to Novell, Inc. and contains confidential information that is not to # be reproduced or disclosed to any other person or entity without # prior written consent from Novell, Inc. in each and every instance. # # No part of this file may be duplicated, revised, translated, # localized or modified in any manner or compiled, linked or uploaded # or downloaded to or from any computer system without prior written # consent of Novell, Inc. # # WARNING: Unauthorized reproduction of this program as well as # unauthorized preparation of derivative works based upon the program # or distribution of copies by sale, rental, lease or lending are # violations of federal copyright laws and state trade secret laws, # punishable by civic and criminal penalties. #----------------------------------------------------------------------------- ####### Fix ######################################################### # Ensure arguments are on command line # Fix by David Thorpe July 1998 progname=`basename $0` help() { echo "Usage: $progname " } case $# in 0|1|2) help >&2 exit 1 ;; esac ####### End of fix ################################################## # Variable settings SRC1=/export/home/cpsdoc/bin/sgml2htmlpre.xom SRC2=/export/home/cpsdoc/bin/sgml2html.xom LIB=/export/home/cpsdoc/work/sgml2html-library DCL=/apps/adept/novell/entities/docbook.dcl # SGML file name SGM="$1" HTM="$2.htm" LOG="$2.log" BKNAME="$2" COLL="$3" TMP="$SGM.tmp" echo "Docbook SGML to HTML conversion." >"$LOG" echo "" >>"$LOG" echo "(c)Copyright 1996. Novell, Inc." >>"$LOG" echo "All Rights Reserved." >>"$LOG" echo "" >>"$LOG" echo " "`date`>>"$LOG" echo " Docbook SGML file: $SGM">>"$LOG" echo " HTML file: $HTM">>"$LOG" echo " ">>"$LOG" mkdir "$BKNAME" 2>"/dev/null" mkdir "$COLL" 2>"/dev/null" rm "$TMP" 2>"/dev/null" #create collection level start file omnimark -brief -s "$SRC1" -library "$LIB" "$DCL" "$SGM" >"$TMP" 2>>"$LOG" omnimark -brief -s "$SRC2" -d BKNAME "$BKNAME" -d COLL "$COLL" -library "$LIB" "$DCL" "$TMP" >"$HTM" 2>>"$LOG" STATUS=$? echo " ">>"$LOG" if [ $STATUS -eq 0 ] then echo "Conversion completed successfully.">>"$LOG" else echo "***Error: conversion was not completed successfully***">>"$LOG" fi echo " "`date`>>"$LOG" echo " ">>"$LOG" mv "$BKNAME.htm" "$BKNAME/$BKNAME.htm" mv "$LOG" "$BKNAME" rm -fr "$COLL/$BKNAME" 2>"/dev/null" mv "$BKNAME" "$COLL" rm "$TMP" exit $STATUS