From c58f346374be696b6351a0b678fe5c3b33a7092c Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Fri, 8 Jan 1999 15:27:17 +0000 Subject: [PATCH] New support scripts for HTML->info conversion that use Michael Ernst's new conversion tools. --- Doc/tools/fix.el | 5 ----- Doc/tools/fixinfo.el | 17 +++++++++++++++++ Doc/tools/mkinfo | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 5 deletions(-) delete mode 100644 Doc/tools/fix.el create mode 100644 Doc/tools/fixinfo.el create mode 100755 Doc/tools/mkinfo diff --git a/Doc/tools/fix.el b/Doc/tools/fix.el deleted file mode 100644 index f41fb59cd42..00000000000 --- a/Doc/tools/fix.el +++ /dev/null @@ -1,5 +0,0 @@ -; load the new texinfo package (2.xx) if not installed by default -; (setq load-path (cons "/ufs/guido/lib/emacs/texinfo-2.14" load-path)) -(find-file "temp.texi") -(texinfo-all-menus-update t) -(texinfo-all-menus-update t) diff --git a/Doc/tools/fixinfo.el b/Doc/tools/fixinfo.el new file mode 100644 index 00000000000..75baf34beb3 --- /dev/null +++ b/Doc/tools/fixinfo.el @@ -0,0 +1,17 @@ +(defun fix-python-texinfo () + (goto-char (point-min)) + (replace-regexp "\\(@setfilename \\)\\([-a-z]*\\)$" + "\\1python-\\2.info") + (replace-string "@node Front Matter\n@chapter Abstract\n" + "@node Abstract\n@section Abstract\n") + (progn + (mark-whole-buffer) + (texinfo-master-menu 'update-all-nodes) + ) + (save-buffer) + ) ;; fix-python-texinfo + +;; now really do it: +(find-file (car command-line-args-left)) +(fix-python-texinfo) +(kill-emacs) diff --git a/Doc/tools/mkinfo b/Doc/tools/mkinfo new file mode 100755 index 00000000000..51279a03211 --- /dev/null +++ b/Doc/tools/mkinfo @@ -0,0 +1,41 @@ +#! /bin/sh +# -*- Ksh -*- + + +PERL=${PERL:-perl} +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"` +DOCNAME=`basename "$FILENAME" .html` + +WORKDIR=`pwd` +cd `dirname $0` +TOOLSDIR=`pwd` +cd $DOCDIR +DOCDIR=`pwd` +cd $WORKDIR + + +run() { + echo "$@" + $* || exit $? +} + + +# generate the Texinfo file: + +run $PERL -I$TOOLSDIR $TOOLSDIR/html2texi.pl $DOCDIR/$DOCFILE +run $EMACS -batch -l $TOOLSDIR/fixinfo.el $DOCNAME.texi +rm -f $DOCNAME.texi~ + + +# generate the .info files: + +run $MAKEINFO --footnote-style end --fill-column 72 \ + --paragraph-indent 0 $DOCNAME.texi