1root=http://www.opengl.org/sdk/docs/
2
3createProperties() {
4
5    toc=index.html
6    doc=${1}
7
8    #download index
9    wget ${root}/${doc}/xhtml/${toc};
10
11    #find lines with links to gl* function doc
12    grep -E .+\<a\ target=\"pagedisp\"\ href=\"gl[A-Z][^\"]+\"\>gl[A-Z][a-Z0-9]+\</a\>.+ ./${toc} > links;
13
14    #add all links as properties to file and cleanup
15    sed -r "s/.+<td><a target=\"pagedisp\" href=\"([a-Z0-9.]+)\">([a-Z0-9]+)<\/a><\/td>.*/\2 = ${doc}\/xhtml\/\1/" links | sort -u;
16
17    rm ./${toc} ./links
18
19}
20
21>tmp
22
23createProperties man2 >> tmp
24createProperties man3 >> tmp
25createProperties man4 >> tmp
26
27#add doc root to properties file
28echo "#Generated, do not edit, edit createTagletProps.sh instead.
29#This file is used in NativeTaglet and maps the generated method names
30#to the function specific OpenGL documentation man pages.
31nativetaglet.baseUrl=${root}" > native-taglet.properties;
32
33cat tmp | sort -k1,2 -r | awk '!x[$1]++' | tr -d [:blank:] | sort >> native-taglet.properties;
34rm tmp
35