]> Pileus Git - ~andy/gtk/blob - examples/README.1ST
Start mass update for GTK 1.1 Look for the best version of awk Fix FD leak
[~andy/gtk] / examples / README.1ST
1 GTK Example Code - Tony Gale <gale@gtk.org> 980623
2 --------------------------------------------------
3
4 I have written an awk script to automatically extract the code
5 examples from the GTK Tutorial (in sgml), so they only have to be
6 changed in one place.
7
8 It's called 'extract.awk', and there is a shell wrapper to invoke
9 it called 'extract.sh'
10
11 It takes the following switches:
12  -c : Just do checking rather than output files
13  -f <filename> : Extract a specific file
14  -d : Extract file(s) to current directory
15
16 Without the -d switch, the code will be placed in the appropriate
17 sub-directory. Those sub-directories will be created if they do not
18 exist.
19
20 Without the -f switch, all code examples will be extracted.
21
22 The shell wrapper assumes that the GTK Tutorial is in the 
23 file "../docs/gtk_tut.sgml"
24
25 It works by looking for sections of text in the tutorial surrounded
26 by, for example:
27
28 /* example-start helloworld helloworld.c */
29
30 and
31
32 /* example-end */
33
34 Where "helloworld" is the directory into which the file will be
35 placed (which can also be a directory spec like hello/hello1), and
36 "helloworld.c" is the file name for the code.
37
38 So, the code between these lines would be extracted to the file
39 helloworld/helloworld.c
40
41 It also handles replacing the sgml tag '&amp;' with '&'