3
# $Id: regen.sh 71749 2012-06-13 23:20:08Z RD $
5
# This bash script regenerates the HTML doxygen version of the
6
# wxWidgets manual and adjusts the doxygen log to make it more
10
# ./regen.sh [html|chm|xml|latex|all]
12
# Pass "x" to regen only the X output format and "all" to regen them all.
13
# If no arguments are passed all formats are regenerated
14
# (just like passing "all").
18
# remember current folder and then cd to the docs/doxygen one
20
path=${0%%/$me} # path from which the script has been launched
23
if [ "$WXWIDGETS" = "" ]; then
24
export WXWIDGETS=`cd ../.. && pwd`
25
if [ "$OSTYPE" = "cygwin" ]; then
26
export WXWIDGETS=`cygpath -w $WXWIDGETS`
30
if [ "$DOXYGEN" = "" ]; then
34
# prepare folders for the cp commands below
35
mkdir -p out/html # we need to copy files in this folder below
36
mkdir -p out/html/generic out/html/wxmsw out/html/wxgtk out/html/wxmac
38
# These are not automatically copied by Doxygen because they're not
39
# used in doxygen documentation, only in our html footer and by our
41
cp images/powered-by-wxwidgets.png out/html
42
cp images/logo_*.png out/html
43
cp images/tab_*.gif out/html
44
cp images/wxmsw/*png out/html/wxmsw
45
cp images/wxmac/*png out/html/wxmac
46
cp images/wxgtk/*png out/html/wxgtk
47
cp images/generic/*png out/html/generic
48
cp wxwidgets.js out/html
50
# which configuration should we use?
51
if [[ -z "$1" ]]; then
52
cfgfile="Doxyfile_all"
60
# NB: we do this _after_ copying the required files to the output folders
61
# otherwise when generating the CHM file with Doxygen, those files are
66
if [[ "$1" = "qch" ]]; then
67
# we need to add missing files to the .qhp
71
# remove all <file> and <files> tags
72
cat $qhelpfile | grep -v "<file" >temp
74
# remove last 4 lines (so we have nothing after the last <keyword> tag)
76
wanted=`expr $lines - 4`
77
head -n $wanted temp >$qhelpfile
79
# generate a list of new <keyword> tags to add to the index file; without
80
# this step in the 'index' tab of Qt assistant the "wxWindow" class is not
81
# present; just "wxWindow::wxWindow" ctor is listed.
82
# NOTE: this operation is not indispensable but produces a QCH easier to use IMO.
83
sed -e 's/<keyword name="wx[a-zA-Z~]*" id="wx\([a-zA-Z]*\)::[a-zA-Z~]*" ref="\([a-z_]*.html\)#.*"/<keyword name="wx\1" id="wx\1" ref="\2"/g' < $qhelpfile | grep "<keyword name=\"wx" | uniq >temp
85
echo " </keywords>" >>$qhelpfile
86
echo " <files>" >>$qhelpfile
88
# remove useless files to make the qch slim
91
# add a <file> tag for _any_ file in out/html folder except the .qhp itself
93
if [[ $f != $qhelpfile ]]; then
94
echo " <file>$f</file>" >>$qhelpfile
98
# add ending tags to the qhp file
101
</QtHelpProject>" >>$qhelpfile
103
# replace keyword names so that they appear fully-qualified in the
104
# "index" tab of the Qt Assistant; e.g. Fit => wxWindow::Fit
105
# NOTE: this operation is not indispendable but produces a QCH easier to use IMO.
106
sed -e 's/<keyword name="[a-zA-Z:~]*" id="\([a-zA-Z]*::[a-zA-Z~]*\)"/<keyword name="\1" id="\1"/g' <$qhelpfile >temp
109
# last, run qhelpgenerator:
111
qhelpgenerator out/html/index.qhp -o out/wx.qch
114
if [[ "$1" = "docset" ]]; then
115
DOCSETNAME="org.wxwidgets.doxygen.wx29.docset"
116
ATOM="org.wxwidgets.doxygen.docset.wx29.atom"
117
ATOMDIR="http://docs.wxwidgets.org/docsets"
118
XAR="org.wxwidgets.doxygen.docset.wx29.xar"
119
XARDIR="http://docs.wxwidgets.org/docsets"
120
XCODE_INSTALL=`sh xcode-select -print-path`
122
cp wxdocsettabs.css out/html/wxtabs.css
123
cp wxdocsetwidgets.css out/html/wxwidgets.css
124
cp img_downArrow.png out/html
125
cp background_navigation.png out/html
130
rm -rf $DESTINATIONDIR/$DOCSETNAME
131
rm -f $DESTINATIONDIR/$XAR
135
defaults write $DESTINATIONDIR/$DOCSETNAME/Contents/Info CFBundleVersion 1.3
136
defaults write $DESTINATIONDIR/$DOCSETNAME/Contents/Info CFBundleShortVersionString 1.3
137
defaults write $DESTINATIONDIR/$DOCSETNAME/Contents/Info CFBundleName "wxWidgets 2.9 Library"
138
defaults write $DESTINATIONDIR/$DOCSETNAME/Contents/Info DocSetFeedURL $ATOMDIR/$ATOM
139
defaults write $DESTINATIONDIR/$DOCSETNAME/Contents/Info DocSetFallbackURL http://docs.wxwidgets.org
140
defaults write $DESTINATIONDIR/$DOCSETNAME/Contents/Info DocSetDescription "API reference and conceptual documentation for wxWidgets 2.9"
141
defaults write $DESTINATIONDIR/$DOCSETNAME/Contents/Info NSHumanReadableCopyright "Copyright 1992-2011 wxWidgets team, Portions 1996 Artificial Intelligence Applications Institute"
143
$XCODE_INSTALL/usr/bin/docsetutil package -atom $DESTINATIONDIR/$ATOM -download-url $XARDIR/$XAR -output $DESTINATIONDIR/$XAR $DESTINATIONDIR/$DOCSETNAME
148
# Doxygen has the annoying habit to put the full path of the
149
# affected files in the log file; remove it to make the log
152
interfacepath=`cd ../../interface && pwd`/
153
cat doxygen.log | sed -e "s|$currpath||g" -e "s|$interfacepath||g" > temp
154
cat temp > doxygen.log
157
# return to the original folder from which this script was launched