forked from ibm-messaging/mq-mqi-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makedoc
executable file
·52 lines (45 loc) · 1.2 KB
/
makedoc
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
43
44
45
46
47
48
49
50
51
52
# Create JSDoc to describe the API
# Use a simple configuration file to
# control JSDoc format.
configFile=/tmp/jsdoc.cfg
cat << EOF > $configFile
{
"templates" : {
"default" : {
"outputSourceFiles" : false
}
}
}
EOF
# Exclude a few files from the doc generation process
contents=`ls ./lib/*js |\
grep -v mqidefs.js |\
grep -v mqistrings.js |\
grep -v mqitypes.js |\
grep -v mqiutils.js`
# Create a package definition without the version number
# so it is not used in the output path.
tmpPackage="/tmp/package.json"
cat ./package.json | grep -v version > $tmpPackage
# The output goes in the source tree
outputDirectory="./doc"
rm -rf $outputDirectory/ibmmq
# And now run the processor
jsdoc -a all \
-c $configFile \
-d $outputDirectory \
-P $tmpPackage \
--verbose \
--pedantic \
$contents
# A couple of simple patches to the generated files
# make it look a little better. Doesn't seem to be
# a way to configure these in the default JSDoc template.
x=`find $outputDirectory -name index.html`
for f in $x
do
cat $f |\
sed "s/JSDoc: Home/JSDoc: IBM MQ/g" |\
sed "s/>Home</>IBM MQ Node.js API</g" > $f.tmp
mv $f.tmp $f
done