infofilter 518 Bytes
Newer Older
Alessandro Rubini's avatar
Alessandro Rubini committed
1 2 3 4 5 6 7 8 9
#! /usr/bin/sed -f

# allow "%" as a comment char, but only at the beginning of the line
s/^%/@c /
#s/[^\\]%.*$//
s/^\\%/%/


#preserve blanks and braces in @example blocks
10 11 12 13 14 15 16 17
/^@example/,/^@end example/ s/{/@{/g
/^@example/,/^@end example/ s/}/@}/g
/^@example/,/^@end example/ p
/^@example/,/^@end example/ d
/^@smallexample/,/^@end smallexample/ s/{/@{/g
/^@smallexample/,/^@end smallexample/ s/}/@}/g
/^@smallexample/,/^@end smallexample/ p
/^@smallexample/,/^@end smallexample/ d
Alessandro Rubini's avatar
Alessandro Rubini committed
18 19 20 21

# remove leading blanks
s/^[ 	]*//