lib/Tools/doc
changeset 15703 727ef1b8b3ee
parent 14981 e73f8140af78
child 15717 541e50adfc73
--- a/lib/Tools/doc	Wed Apr 13 09:48:41 2005 +0200
+++ b/lib/Tools/doc	Wed Apr 13 18:34:22 2005 +0200
@@ -40,6 +40,7 @@
   IFS=":"
   for DIR in $ISABELLE_DOCS
   do
+    [ -d "$DIR" ] || fail "Bad document directory: $DIR"
     [ -f "$DIR/Contents" ] && grep -v "^>>" "$DIR/Contents"
   done
   IFS="$ORIG_IFS"
@@ -48,7 +49,12 @@
   IFS=":"
   for DIR in $ISABELLE_DOCS
   do
-    [ -f "$DIR/$DOC.dvi" ] && { cd "$DIR"; IFS="$ORIG_IFS"; exec $DVI_VIEWER "$DOC.dvi"; }
+    IFS="$ORIG_IFS"
+    [ -d "$DIR" ] || fail "Bad document directory: $DIR"
+    for FMT in "$ISABELLE_DOC_FORMAT" dvi
+    do
+      [ -f "$DIR/$DOC.$FMT" ] && { cd "$DIR"; exec "$ISATOOL" display "$DOC.$FMT"; }
+    done
   done
   IFS="$ORIG_IFS"
   fail "Unknown Isabelle document: $DOC"