| 
									
										
										
										
											1999-01-08 15:27:17 +00:00
										 |  |  | #! /bin/sh | 
					
						
							|  |  |  | #  -*- Ksh -*- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1999-01-08 15:32:27 +00:00
										 |  |  | #  Script to drive the HTML-info conversion process. | 
					
						
							| 
									
										
										
										
											2002-11-13 19:31:04 +00:00
										 |  |  | #  Pass in upto three parameters: | 
					
						
							|  |  |  | #  - the name of the main tex file | 
					
						
							|  |  |  | #  - the name of the output file in texi format (optional) | 
					
						
							|  |  |  | #  - the name of the output file in info format (optional) | 
					
						
							| 
									
										
										
										
											1999-01-08 15:32:27 +00:00
										 |  |  | # | 
					
						
							|  |  |  | #  Written by Fred L. Drake, Jr. <fdrake@acm.org> | 
					
						
							| 
									
										
										
										
											1999-01-08 15:27:17 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | EMACS=${EMACS:-emacs} | 
					
						
							|  |  |  | MAKEINFO=${MAKEINFO:-makeinfo} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Normalize file name since something called by html2texi.pl seems to | 
					
						
							|  |  |  | # screw up with relative path names. | 
					
						
							|  |  |  | FILENAME="$1" | 
					
						
							|  |  |  | DOCDIR=`dirname "$FILENAME"` | 
					
						
							|  |  |  | DOCFILE=`basename "$FILENAME"` | 
					
						
							| 
									
										
										
										
											2002-05-03 04:50:51 +00:00
										 |  |  | DOCNAME=`basename "$FILENAME" .tex` | 
					
						
							|  |  |  | if [ $# -gt 1 ]; then | 
					
						
							| 
									
										
										
										
											2002-11-13 19:31:04 +00:00
										 |  |  |     TEXINAME="$2" | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |     TEXINAME="python-$DOCNAME.texi" | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | if [ $# -gt 2 ]; then | 
					
						
							|  |  |  |     INFONAME="$3" | 
					
						
							| 
									
										
										
										
											2002-05-03 04:50:51 +00:00
										 |  |  | else | 
					
						
							|  |  |  |     INFONAME="python-$DOCNAME.info" | 
					
						
							|  |  |  | fi | 
					
						
							| 
									
										
										
										
											1999-01-08 15:27:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1999-01-08 15:32:27 +00:00
										 |  |  | # Now build the real directory names, and locate our support stuff: | 
					
						
							| 
									
										
										
										
											1999-01-08 15:27:17 +00:00
										 |  |  | WORKDIR=`pwd` | 
					
						
							|  |  |  | cd `dirname $0` | 
					
						
							|  |  |  | TOOLSDIR=`pwd` | 
					
						
							|  |  |  | cd $DOCDIR | 
					
						
							|  |  |  | DOCDIR=`pwd` | 
					
						
							|  |  |  | cd $WORKDIR | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | run() { | 
					
						
							| 
									
										
										
										
											1999-01-08 15:32:27 +00:00
										 |  |  |     # show what we're doing, like make does: | 
					
						
							|  |  |  |     echo "$*" | 
					
						
							| 
									
										
										
										
											2002-05-03 04:50:51 +00:00
										 |  |  |     "$@" || exit $? | 
					
						
							| 
									
										
										
										
											1999-01-08 15:27:17 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # generate the Texinfo file: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-05-03 04:50:51 +00:00
										 |  |  | run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \ | 
					
						
							|  |  |  |     --eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \ | 
					
						
							| 
									
										
										
										
											2002-11-13 19:31:04 +00:00
										 |  |  |     --eval "(setq py2texi-texi-file-name \"$TEXINAME\")" \ | 
					
						
							|  |  |  |     --eval "(setq py2texi-info-file-name \"$INFONAME\")" \ | 
					
						
							| 
									
										
										
										
											2002-05-03 04:50:51 +00:00
										 |  |  |     --eval "(py2texi \"$DOCDIR/$DOCFILE\")" \ | 
					
						
							|  |  |  |     -f kill-emacs | 
					
						
							|  |  |  | echo Done | 
					
						
							| 
									
										
										
										
											1999-01-08 15:27:17 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # generate the .info files: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | run $MAKEINFO --footnote-style end --fill-column 72 \ | 
					
						
							| 
									
										
										
										
											2002-11-13 19:31:04 +00:00
										 |  |  | 	      --paragraph-indent 0 --output=$INFONAME $TEXINAME |