mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
Use a Python script to create "empty" indexes. This solves Guido's
corrupted file problem and avoids the shell escape interpretation portability problem. ;-( See comments at top of newind.py for an explanation.
This commit is contained in:
parent
bdab730cf3
commit
4f4e920889
3 changed files with 48 additions and 3 deletions
|
|
@ -65,6 +65,7 @@ DOCDESTDIR= $LIBDEST/doc
|
||||||
EMACS= emacs
|
EMACS= emacs
|
||||||
PYTHON= python
|
PYTHON= python
|
||||||
MAKEINFO= makeinfo
|
MAKEINFO= makeinfo
|
||||||
|
# When debugging partparse.py, make this the pyc file:
|
||||||
PARTPARSEOBJ= partparse.pyc
|
PARTPARSEOBJ= partparse.pyc
|
||||||
PARTPARSE= $(PYTHON) $(PARTPARSEOBJ)
|
PARTPARSE= $(PYTHON) $(PARTPARSEOBJ)
|
||||||
|
|
||||||
|
|
@ -163,8 +164,8 @@ LIBFILES = lib.tex \
|
||||||
|
|
||||||
# Library document
|
# Library document
|
||||||
lib.dvi: modindex.py indfix.py $(LIBFILES)
|
lib.dvi: modindex.py indfix.py $(LIBFILES)
|
||||||
echo '\\begin{theindex}\end{theindex}' >$*.ind
|
./newind.py >$*.ind
|
||||||
echo '\\begin{theindex}\label{modindex}\end{theindex}' >mod$*.ind
|
./newind.py modindex >mod$*.ind
|
||||||
$(LATEX) $*
|
$(LATEX) $*
|
||||||
./modindex.py mod$*.idx
|
./modindex.py mod$*.idx
|
||||||
./fix_hack $*.idx
|
./fix_hack $*.idx
|
||||||
|
|
@ -180,7 +181,7 @@ tut.dvi: tut.tex
|
||||||
# Extending & Embedding, Python/C API documents.
|
# Extending & Embedding, Python/C API documents.
|
||||||
# Done this way to avoid repeated command sets.
|
# Done this way to avoid repeated command sets.
|
||||||
.tex.dvi:
|
.tex.dvi:
|
||||||
echo '\\''begin{theindex}\end{theindex}' >$*.ind
|
./newind.py >$*.ind
|
||||||
$(LATEX) $*
|
$(LATEX) $*
|
||||||
./fix_hack $*.idx
|
./fix_hack $*.idx
|
||||||
$(MAKEINDEX) $*.idx
|
$(MAKEINDEX) $*.idx
|
||||||
|
|
|
||||||
22
Doc/newind.py
Executable file
22
Doc/newind.py
Executable file
|
|
@ -0,0 +1,22 @@
|
||||||
|
#! /usr/bin/env python
|
||||||
|
|
||||||
|
"""Really nasty little script to create an empty, labeled index on stdout.
|
||||||
|
|
||||||
|
Do it this way since some shells seem to work badly (and differently) with
|
||||||
|
the leading '\b' for the first output line. Specifically, /bin/sh on
|
||||||
|
Solaris doesn't seem to get it right. Once the quoting works there, it
|
||||||
|
doesn't work on Linux any more. ;-(
|
||||||
|
"""
|
||||||
|
__version__ = '$Revision$'
|
||||||
|
# $Source$
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if sys.argv[1:]:
|
||||||
|
label = sys.argv[1]
|
||||||
|
else:
|
||||||
|
label = "genindex"
|
||||||
|
|
||||||
|
print "\\begin{theindex}"
|
||||||
|
print "\\label{%s}" % label
|
||||||
|
print "\\end{theindex}"
|
||||||
22
Doc/tools/newind.py
Executable file
22
Doc/tools/newind.py
Executable file
|
|
@ -0,0 +1,22 @@
|
||||||
|
#! /usr/bin/env python
|
||||||
|
|
||||||
|
"""Really nasty little script to create an empty, labeled index on stdout.
|
||||||
|
|
||||||
|
Do it this way since some shells seem to work badly (and differently) with
|
||||||
|
the leading '\b' for the first output line. Specifically, /bin/sh on
|
||||||
|
Solaris doesn't seem to get it right. Once the quoting works there, it
|
||||||
|
doesn't work on Linux any more. ;-(
|
||||||
|
"""
|
||||||
|
__version__ = '$Revision$'
|
||||||
|
# $Source$
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if sys.argv[1:]:
|
||||||
|
label = sys.argv[1]
|
||||||
|
else:
|
||||||
|
label = "genindex"
|
||||||
|
|
||||||
|
print "\\begin{theindex}"
|
||||||
|
print "\\label{%s}" % label
|
||||||
|
print "\\end{theindex}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue