rearrange rules to not emit the example start and end markers.
* examples/extract.awk: rearrange rules to not emit the example start and end markers. * docs/tutorial/gtk-tut.sgml: turn the start and end markers into SGML comments, so they don't clutter the formatted tutorial.
This commit is contained in:
parent
e07fabae62
commit
21ac424e41
9 changed files with 152 additions and 96 deletions
|
|
@ -31,6 +31,15 @@ BEGIN {in_example=0; check=0; spec_example=""; do_output=0; flatten=0; verbose=0
|
|||
}
|
||||
}
|
||||
|
||||
$2 == "example-end" && in_example == 0 { printf("\nERROR: multiple ends at line %d\n", NR) > "/dev/stderr";
|
||||
exit}
|
||||
$2 == "example-end" { in_example=0; do_output=0 }
|
||||
|
||||
in_example==1 && check==0 && do_output==1 { gsub(/&/, "\\&", $0);
|
||||
gsub(/</, "<", $0);
|
||||
gsub(/>/, ">", $0);
|
||||
print $0 >file_name }
|
||||
|
||||
$2 == "example-start" && in_example == 1 { printf("\nERROR: nested example at line %d\n", NR) > "/dev/stderr";
|
||||
exit}
|
||||
|
||||
|
|
@ -53,15 +62,6 @@ $2 == "example-start" && check == 0 \
|
|||
}
|
||||
}
|
||||
|
||||
in_example==1 && check==0 && do_output==1 { gsub(/&/, "\\&", $0);
|
||||
gsub(/</, "<", $0);
|
||||
gsub(/>/, ">", $0);
|
||||
print $0 >file_name }
|
||||
|
||||
$2 == "example-end" && in_example == 0 { printf("\nERROR: multiple ends at line %d\n", NR) > "/dev/stderr";
|
||||
exit}
|
||||
$2 == "example-end" { in_example=0; do_output=0 }
|
||||
|
||||
|
||||
END {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue