2 Perl script `update_examples' is intended to update
3 examples in the Maxima texinfo documentation.
5 `update_examples' is a filter - it reads standard input
6 and direst result to standard output:
8 ./update_examples < original.texi > updated.texi
10 The script scans input texinfo file for
11 constructions of the form:
18 (%i1) expand((x+y)^2);
27 Lines between `@c ===beg===' and `@c ===end==='
28 are Maxima commands (without leftmost `@c ').
29 The script extracts this commands, passes them to
30 Maxima and inserts resulting output between
31 `@example' and `@end example'.
33 Maxima commands between `@c ===beg===' and `@c ===end==='
34 must obey some simple rules:
37 1. Each command must begin at 4th column right
38 after `@c ' without extra spaces between `@c '
41 @c expand((x+y)^2); - is right
43 @c expand((x+y)^2); - is wrong
46 2. If command spans several lines then second and
47 all subsequent lines must have alt least one
48 extra space between `@c ' and the command.
63 Examples without preceding `@c ===beg==='/`@c ===end==='
66 By default `update_examples' calls local Maxima
67 script `../../maxima-local' but this can be changed
68 by setting MAXIMA_EXAMPLE_COMMAND environment
71 The environment variable STRIP_TOPDIR controls
72 which path is stripped out of the output (load,
73 batch commands). If the variable isn't set then
74 anything above /maxima/doc/info is stripped.
76 IMPORTANT: `update_examples' script works only
77 in combination with special Maxima initialization
78 file `maxima-init.lisp'. This init file ensures
79 that output is no more than 65 characters wide
80 by setting `linel:65;' and helps to identify
84 Vadim V. Zhytnikov <vvzhy@mail.ru>