Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bfc18bd

Browse files
committed
Integrated SF patch #539487 by Matthias Klose:
This patch adds Milan Zamazal's conversion script and modifies the mkinfo script to build the info doc files from the LaTeX sources. Currently, the mac, doc and inst TeX files are not handled. Explicitly checks for GNU Emacs 21.
1 parent a3b0b29 commit bfc18bd

5 files changed

Lines changed: 958 additions & 59 deletions

File tree

Doc/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ BUILDINDEX=$(TOOLSDIR)/buildindex.py
8888
PYTHONDOCS="See <i><a href=\"about.html\">About this document...</a></i> for information on suggesting changes."
8989
HTMLBASE= file:`pwd`
9090

91+
# The emacs binary used to build the info docs. GNU Emacs 21 is required.
92+
EMACS= emacs
93+
9194
# The end of this should reflect the major/minor version numbers of
9295
# the release:
9396
WHATSNEW=whatsnew23
@@ -287,7 +290,7 @@ paper-$(PAPER)/$(WHATSNEW).pdf:
287290
# conversions, as described above. See also the README file.
288291

289292
info:
290-
cd $(INFODIR) && $(MAKE)
293+
cd $(INFODIR) && $(MAKE) EMACS=$(EMACS)
291294

292295
# Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
293296
# HTML converter. For more info on this program, see

Doc/info/Makefile

Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,70 +4,67 @@ TOPDIR=..
44
TOOLSDIR=$(TOPDIR)/tools
55
HTMLDIR=$(TOPDIR)/html
66

7+
# The emacs binary used to build the info docs. GNU Emacs 21 is required.
8+
EMACS=emacs
9+
710
MKINFO=$(TOOLSDIR)/mkinfo
8-
SCRIPTS=$(TOOLSDIR)/html2texi.pl $(TOOLSDIR)/checkargs.pm $(TOOLSDIR)/mkinfo \
9-
$(TOOLSDIR)/fixinfo.el
11+
SCRIPTS=$(TOOLSDIR)/checkargs.pm $(TOOLSDIR)/mkinfo $(TOOLSDIR)/py2texi.el
12+
13+
# set VERSION to code the VERSION number into the info file name
14+
# allowing installation of more than one set of python info docs
15+
# into the same directory
16+
VERSION=
1017

11-
all: python-api.info python-ext.info python-lib.info \
12-
python-ref.info python-tut.info \
13-
python-dist.info python-inst.info
18+
all: check-emacs-version \
19+
python$(VERSION)-api.info python$(VERSION)-ext.info \
20+
python$(VERSION)-lib.info python$(VERSION)-ref.info \
21+
python$(VERSION)-tut.info python$(VERSION)-dist.info
1422

23+
# python$(VERSION)-doc.info python$(VERSION)-inst.info
24+
# python$(VERSION)-mac.info
1525

16-
python-api.info: $(HTMLDIR)/api/api.html $(SCRIPTS)
17-
$(MKINFO) $<
26+
check-emacs-version:
27+
@v="`$(EMACS) --version 2>&1 | egrep '^(GNU |X)Emacs [12]*'`"; \
28+
if `echo "$$v" | grep '^GNU Emacs 21' >/dev/null 2>&1`; then \
29+
echo "Using $(EMACS) to build the info docs"; \
30+
else \
31+
echo "GNU Emacs 21 is required to build the info docs"; \
32+
echo "Found $$v"; \
33+
false; \
34+
fi
1835

19-
python-ext.info: $(HTMLDIR)/ext/ext.html $(SCRIPTS)
20-
$(MKINFO) $<
36+
python$(VERSION)-api.info: ../api/api.tex $(SCRIPTS)
37+
EMACS=$(EMACS) $(MKINFO) $< $@
2138

22-
python-lib.info: $(HTMLDIR)/lib/lib.html $(SCRIPTS)
23-
$(MKINFO) $<
39+
python$(VERSION)-ext.info: ../ext/ext.tex $(SCRIPTS)
40+
EMACS=$(EMACS) $(MKINFO) $< $@
41+
42+
python$(VERSION)-lib.info: ../lib/lib.tex $(SCRIPTS)
43+
EMACS=$(EMACS) $(MKINFO) $< $@
2444

2545
# Not built by default; the conversion doesn't really handle it well.
26-
python-mac.info: $(HTMLDIR)/mac/mac.html $(SCRIPTS)
27-
$(MKINFO) $<
46+
python$(VERSION)-mac.info: ../mac/mac.tex $(SCRIPTS)
47+
EMACS=$(EMACS) $(MKINFO) $< $@
48+
49+
python$(VERSION)-ref.info: ../ref/ref.tex $(SCRIPTS)
50+
EMACS=$(EMACS) $(MKINFO) $< $@
2851

29-
python-ref.info: $(HTMLDIR)/ref/ref.html $(SCRIPTS)
30-
$(MKINFO) $<
52+
python$(VERSION)-tut.info: ../tut/tut.tex $(SCRIPTS)
53+
EMACS=$(EMACS) $(MKINFO) $< $@
3154

32-
python-tut.info: $(HTMLDIR)/tut/tut.html $(SCRIPTS)
33-
$(MKINFO) $<
55+
# Not built by default; the conversion doesn't handle it at all.
56+
python$(VERSION)-doc.info: ../doc/doc.tex $(SCRIPTS)
57+
EMACS=$(EMACS) $(MKINFO) $< $@
3458

35-
python-dist.info: $(HTMLDIR)/dist/dist.html $(SCRIPTS)
36-
$(MKINFO) $<
59+
python$(VERSION)-dist.info: ../dist/dist.tex $(SCRIPTS)
60+
EMACS=$(EMACS) $(MKINFO) $< $@
3761

38-
python-inst.info: $(HTMLDIR)/inst/inst.html $(SCRIPTS)
39-
$(MKINFO) $<
62+
# Not built by default; the conversion chokes on two @end multitable's
63+
python$(VERSION)-inst.info: ../inst/inst.tex $(SCRIPTS)
64+
EMACS=$(EMACS) $(MKINFO) $< $@
4065

4166
clean:
4267
rm -f *.texi~ *.texi
4368

4469
clobber: clean
45-
rm -f *.texi python-*.info python-*.info-[0-9]*
46-
47-
48-
# This makes sure we can build info files from a "clean" tree,
49-
# in case we haven't already built the HTML:
50-
51-
$(HTMLDIR)/api/api.html:
52-
cd $(HTMLDIR) && $(MAKE) api
53-
54-
$(HTMLDIR)/ext/ext.html:
55-
cd $(HTMLDIR) && $(MAKE) ext
56-
57-
$(HTMLDIR)/lib/lib.html:
58-
cd $(HTMLDIR) && $(MAKE) lib
59-
60-
$(HTMLDIR)/mac/mac.html:
61-
cd $(HTMLDIR) && $(MAKE) mac
62-
63-
$(HTMLDIR)/ref/ref.html:
64-
cd $(HTMLDIR) && $(MAKE) ref
65-
66-
$(HTMLDIR)/tut/tut.html:
67-
cd $(HTMLDIR) && $(MAKE) tut
68-
69-
$(HTMLDIR)/dist/dist.html:
70-
cd $(HTMLDIR) && $(MAKE) dist
71-
72-
$(HTMLDIR)/inst/inst.html:
73-
cd $(HTMLDIR) && $(MAKE) inst
70+
rm -f *.texi python*-*.info python*-*.info-[0-9]*

Doc/info/python.dir

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
Python Standard Documentation
33

44
* Python Library: (python-lib). Python Library Reference
5+
* Python Mac Modules: (python-mac). Python Macintosh Modules
56
* Python Reference: (python-ref). Python Reference Manual
6-
* Python Distutils: (python-dist). Distributing Python Modules
77
* Python API: (python-api). Python/C API Reference Manual
88
* Python Extending: (python-ext). Extending & Embedding Python
9-
* Python Mac Modules: (python-mac). Python Macintosh Modules
109
* Python Tutorial: (python-tut). Python Tutorial
10+
* Documenting Python: (python-doc). Documenting Python
11+
* Installing Modules: (python-inst). Installing Python Modules
12+
* Distributing Modules: (python-dist). Distributing Python Modules

Doc/tools/mkinfo

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ MAKEINFO=${MAKEINFO:-makeinfo}
1717
FILENAME="$1"
1818
DOCDIR=`dirname "$FILENAME"`
1919
DOCFILE=`basename "$FILENAME"`
20-
DOCNAME=`basename "$FILENAME" .html`
20+
DOCNAME=`basename "$FILENAME" .tex`
21+
if [ $# -gt 1 ]; then
22+
INFONAME="$2"
23+
else
24+
INFONAME="python-$DOCNAME.info"
25+
fi
2126

2227
# Now build the real directory names, and locate our support stuff:
2328
WORKDIR=`pwd`
@@ -31,18 +36,20 @@ cd $WORKDIR
3136
run() {
3237
# show what we're doing, like make does:
3338
echo "$*"
34-
$* || exit $?
39+
"$@" || exit $?
3540
}
3641

3742

3843
# generate the Texinfo file:
3944

40-
run $PERL -I$TOOLSDIR $TOOLSDIR/html2texi.pl $DOCDIR/$DOCFILE
41-
run $EMACS -batch -l $TOOLSDIR/fixinfo.el $DOCNAME.texi
42-
rm -f $DOCNAME.texi~
45+
run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \
46+
--eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \
47+
--eval "(py2texi \"$DOCDIR/$DOCFILE\")" \
48+
-f kill-emacs
49+
echo Done
4350

4451

4552
# generate the .info files:
4653

4754
run $MAKEINFO --footnote-style end --fill-column 72 \
48-
--paragraph-indent 0 $DOCNAME.texi
55+
--paragraph-indent 0 --output=$INFONAME $DOCNAME.texi

0 commit comments

Comments
 (0)