forked from CalexCore/amity.rpc.php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocgen
More file actions
executable file
·41 lines (34 loc) · 768 Bytes
/
docgen
File metadata and controls
executable file
·41 lines (34 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
function parse()
{
f=$(basename $1)
echo "<a href=\"$f\">$f</a>" >> ${dir}/index.html
while IFS= read line; do
if [[ $line = '//*'* ]]; then
if [[ $line = '//*desc:'* ]]; then
echo ${line:9} >> ${dir}/index.html
else
echo " " ${line:3} >> ${dir}/index.html
fi
fi
done <"$f"
echo "" >> ${dir}/index.html
}
function writeheader()
{
echo "<pre><h3>AMITY Public API</h3><ul>" > ${dir}/index.html
}
function writefooter()
{
echo "</ul></pre>" >> ${dir}/index.html
}
function parsefiles()
{
for fn in ${dir}/*.php; do
parse "${fn}"
done
}
writeheader
parsefiles
writefooter