15d0030ffdd5b6bcb0923286af6799efbd438bfa
[m17n/m17n-docs.git] / utils / exprog.sh
1 #!/bin/sh
2
3 cat <<EOF
4 /***en @page m17nExProg Example Programs
5
6 This section describes these example programs.  They are to demonstrate
7 the usage of the m17n library, not for practical use.
8
9 <ul>
10 EOF
11
12 cat $* | grep '@page' | sed -e 's/@page \([^ ]*\)/<li> @ref \1 "\1" --/'
13
14 cat <<EOF
15 </ul>
16 */
17 EOF
18
19 cat $* | \
20 sed -n -e '/\/\*\*\*/,/\*\// p' | \
21 sed -e 's/@section/@subsection/' \
22     -e 's/@page \([^ ]*\)/@section \1 \1 --/'