1 GTK Example Code - Tony Gale <gale@gtk.org> 980623
2 --------------------------------------------------
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
8 It's called 'extract.awk', and there is a shell wrapper to invoke
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
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
20 Without the -f switch, all code examples will be extracted.
22 The shell wrapper assumes that the GTK Tutorial is in the
23 file "../docs/gtk_tut.sgml"
25 It works by looking for sections of text in the tutorial surrounded
28 /* example-start helloworld helloworld.c */
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.
38 So, the code between these lines would be extracted to the file
39 helloworld/helloworld.c
41 It also handles replacing the sgml tag '&' with '&'