summaryrefslogtreecommitdiffstats
path: root/superkaramba/doc/python_api/make_api_doc.sh
blob: 866c5341f5d2cbe3b1a759d39db271199a602a25 (plain)
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
42
#!/bin/bash
#This script grabs the current *_python.h headers,
# converts them to robodoc format, and then generates 
# the api documentation
##########################################################
SRCDIR=../../src/
TEMPDIR=".apiHeaders"

if [[ -d $TEMPDIR ]]; then
        echo "Cleaning out existing $TEMPDIR directory"
        rm -rf $TEMPDIR/*
else
        echo "Creating $TEMPDIR directory"
        mkdir -p $TEMPDIR
fi

function replaceComments()
{
        echo "Converting file $1"
        TEMPFILE="temp.h"
        cat $1 | sed -e 's/^\/\*\*/\/\/\*\*\*\*p\*/' -e 's/^\*\//\/\/\*\*\*/' -e 's/^\*/\/\//' > $TEMPFILE
        if [[ -s $TEMPFILE ]] ; then
                mv $TEMPFILE $1
        fi
}


FOO=`find $SRCDIR -type f -name "*_python.h"`

for FILE in $FOO
do
        cp $FILE $TEMPDIR/
done

BAR=`ls $TEMPDIR`
for FILE in $BAR
do
        replaceComments $TEMPDIR/$FILE
done

echo "Creating api documentation in output file: python_api.html"
robodoc --rc api_html.rc