forked from thias/puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gendoc
executable file
·32 lines (28 loc) · 824 Bytes
/
gendoc
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
#!/bin/sh
#
# This is all quite ugly because puppetdoc is meant to be run on a real
# puppet master, not just against standalone modules.
#
# NOTE: puppetdoc needs ruby-rdoc to be able to run...
#
# /data/software/puppet-modules
REMOVE=`pwd`
# /data
START=`echo $REMOVE | cut -d / -f 1-2`
# /../../..
RELATIVE=`echo $REMOVE | sed 's|/[^/]*|/..|g'`
rm -rf doc/
puppetdoc \
--all \
--outputdir ./doc \
--mode rdoc \
--charset utf-8 \
--modulepath modules \
--manifestdir /var/empty
mv doc/files${REMOVE}/modules doc/files/
rm -rf doc/files${START}
# Clean up
find doc/files -name '*.html' -exec sed -i "s|${REMOVE}||g" {} \;
find doc/files -name '*.html' -exec sed -i "s|${RELATIVE}/./|/|g" {} \;
# Clean classes/definition pages
find doc/classes -name '*.html' -exec sed -i "s|${REMOVE}||g" {} \;