]> granicus.if.org Git - postgresql/commitdiff
Add option --refentry to change \keepn (keep with next paragraph) to
authorThomas G. Lockhart <lockhart@fourpalms.org>
Fri, 20 Apr 2001 15:50:25 +0000 (15:50 +0000)
committerThomas G. Lockhart <lockhart@fourpalms.org>
Fri, 20 Apr 2001 15:50:25 +0000 (15:50 +0000)
 \keep (keep current paragraph together). This fixes most troubles with
 reference pages marked up with <refentry> tags.
Use on reference.rtf, generated by "make reference.rtf".

doc/src/sgml/fixrtf

index a6a701f6db0895ab61cc3a434b3ffb9d9d32deb4..2c1172408c82dbd293e8aeca61cb1dd02f7d3c53 100755 (executable)
@@ -5,15 +5,35 @@
 #  M$Word does not care about it.
 # (c) 2001, Thomas Lockhart, PostgreSQL Inc.
 
-flist=$@
+flist=""
+RPAT=""
+for i in $@ ; do
+  case "$i" in
+    -r|--refentry)
+      RPAT='-e s/\\\keepn/\\\keep/g'
+      ;;
+    -?|--help)
+      echo "$0 [--refentry] <rtf file> ..."
+      exit 0
+      ;;
+    -*)
+      echo "Command $i not recognized"
+      $0 --help
+      exit 1
+      ;;
+    *)
+      flist="$flist $i"
+  esac
+done
+
 if [ "$flist" = "" ] ; then
   flist=*.rtf
 fi
 
 for f in $flist ; do
-  echo -n "Repairing $f..."
+  echo -n "Repairing '$f' ..."
   if [ -r $f ] ; then
-    (sed 's/{\\stylesheet{\\s1/{\\stylesheet{\\s0 Normal 0;}{\\s1/g' $f > $f.new \
+    (sed -e 's/{\\stylesheet{\\s1/{\\stylesheet{\\s0 Normal 0;}{\\s1/g' $RPAT $f > $f.new \
       && mv -f $f.new $f \
       && echo " done") || echo " failed"
   else