/[packages]/cauldron/maxima/current/SOURCES/maxima-5.14.0-missed-extract-categories.patch
ViewVC logotype

Contents of /cauldron/maxima/current/SOURCES/maxima-5.14.0-missed-extract-categories.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62078 - (show annotations) (download)
Tue Mar 1 15:24:56 2011 UTC (10 years, 5 months ago) by dmorgan
File size: 4051 byte(s)
imported package maxima
1 --- maxima-5.14.0/doc/info/extract_categories1.awk.catg 2008-04-24 22:21:31.000000000 +0200
2 +++ maxima-5.14.0/doc/info/extract_categories1.awk 2007-11-28 04:36:48.000000000 +0100
3 @@ -0,0 +1,20 @@
4 +BEGIN { print "categories = {}" }
5 +
6 +{for (i=1; i<=NF; i++) print $i;}
7 +
8 +END {
9 + print "for key in categories.keys():"
10 + print " f = open (\"Category-\" + key + \".texi\", \"w\")"
11 + print " f.write (\"@anchor{Category: \" + key + \"}\\n\")"
12 + print " f.write (\"@opencatbox\\n\")"
13 + print " f.write (\"@b{Category: \" + key + \"}\\n\\n\")"
14 + print " items = categories [key]"
15 + print " if len (items) == 0: continue"
16 + print " items.sort ()"
17 + print " f.write (\"@ref{Item: \" + items[0][0] + \", \" + items[0][1] + \"}\\n\")"
18 + print " for item in items [1:]:"
19 + print " f.write (\"@html\\n&middot;\\n@end html\\n\")"
20 + print " f.write (\"@ref{Item: \" + item[0] + \", \" + item[1] + \"}\\n\")"
21 + print " f.write (\"@closecatbox\")"
22 + print }
23 +
24 --- maxima-5.14.0/doc/info/extract_categories.sh.catg 2008-04-24 22:21:13.000000000 +0200
25 +++ maxima-5.14.0/doc/info/extract_categories.sh 2007-12-29 18:15:26.000000000 +0100
26 @@ -0,0 +1,80 @@
27 +TARGET=$1
28 +if [ "x$TARGET" = "x" ]; then
29 + echo USAGE: sh $0 '<TARGET>'
30 + exit 1
31 +fi
32 +
33 +set -x
34 +
35 +TARGET_TEXI=$TARGET.texi
36 +
37 +WORKING_DIRECTORY=`mktemp -d /tmp/maxima-texinfo-categories-XXXXXX`
38 +cp -R *.texi figures $WORKING_DIRECTORY
39 +d=`pwd`
40 +cd $WORKING_DIRECTORY
41 +
42 +for f in *.texi; do
43 + if [ $f = "maxima.texi" ]
44 + then echo SKIP OVER $f
45 + else
46 + sed 's/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \2}\
47 +\0/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\
48 +\0/' "$f" > tmp.texi
49 + mv tmp.texi "$f"
50 + fi
51 +done
52 +
53 +cat *.texi\
54 + | awk '!/^@c / && !/^@c$/ && (/^@deffn/ || /^@defvr/ || /^@end deffn/ || /^@end defvr/ || /@category/ || /@node/)'\
55 + | sed -f $d/extract_categories1.sed \
56 + | awk -F '$' -f $d/extract_categories1.awk \
57 + > tmp-make-categories.py
58 +
59 +python tmp-make-categories.py
60 +
61 +sed 's/^@bye//' $TARGET_TEXI > tmp-target.texi
62 +echo '@node Documentation Categories' >> tmp-target.texi
63 +echo '@chapter Documentation Categories' >> tmp-target.texi
64 +for f in Category-*.texi; do echo '@include' $f; done >> tmp-target.texi
65 +echo '@bye' >> tmp-target.texi
66 +mv tmp-target.texi $TARGET_TEXI
67 +
68 +perl $d/texi2html -split_chapter --lang=en --output=. \
69 + --css-include=$d/manual.css --init-file $d/texi2html.init $TARGET_TEXI
70 +
71 +# Now clean up the texi2html output. I'm going to burn in Hell for this (and much else).
72 +
73 +for f in *.html
74 +do
75 + grep -q '<a href=".*">Category: .*</a>' $f
76 + if [ $? = 0 ]; then
77 + echo FIX UP CATEGORY BOXES IN $f
78 + sed 's/^&middot;$//; s/<p>\(<a href=".*">Category: .*<\/a>\)/<p>Categories:\&nbsp;\&nbsp;\1/' $f > tmp.html
79 + mv tmp.html $f
80 + fi
81 +done
82 +
83 +for f in *.html
84 +do
85 + grep -q '<a href=".*">Category: .*</a>' $f
86 + if [ $? = 0 ]; then
87 + echo FIX UP CATEGORY HREFS IN $f
88 + sed 's/<a href="\(.*\)">Category: \(.*\)<\/a>/<a href="\1">\2<\/a>/' $f > tmp.html
89 + mv tmp.html $f
90 + fi
91 +done
92 +
93 +for f in *.html
94 +do
95 + grep -q '<a href=".*">Item: .*</a>' $f
96 + if [ $? = 0 ]; then
97 + echo FIX UP ITEM HREFS IN $f
98 + sed 's/<a href="\(.*\)">Item: \(.*\)<\/a>/<a href="\1">\2<\/a>/' $f > tmp.html
99 + mv tmp.html $f
100 + fi
101 +done
102 +
103 +mv *.html $d
104 +
105 +cd $d
106 +set +x
107 --- maxima-5.14.0/doc/info/extract_categories1.sed.catg 2008-04-24 22:21:25.000000000 +0200
108 +++ maxima-5.14.0/doc/info/extract_categories1.sed 2007-11-28 04:36:48.000000000 +0100
109 @@ -0,0 +1,7 @@
110 +s/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/items = ["\2"]/
111 +s/^@def\(fn\|vr\)x *{[^}]*} *\([^[:blank:]]*\).*/if not "\2" in items: items.append ("\2")/
112 +s/^@end def\(fn\|vr\)/items = []/
113 +s/^@node *\([^,]*\).*/items = ["\1"] # extracted from node/
114 +s/@opencatbox//
115 +s/@closecatbox//
116 +s/@category{\([^}]*\)}\s*/\$foo = []\$for x in items: foo.append ([items[0], x])\$try: categories ["\1"] . extend (foo)\$except KeyError: categories ["\1"] = foo\$/g

  ViewVC Help
Powered by ViewVC 1.1.28