]>
Commit | Line | Data |
---|---|---|
85e43f4e | 1 | #!/bin/bash |
a7c93f3f | 2 | # |
cba817ac | 3 | # $Id$ |
a7c93f3f | 4 | # |
cba817ac FM |
5 | # This bash script regenerates the HTML doxygen version of the |
6 | # wxWidgets manual and adjusts the doxygen log to make it more | |
7 | # readable. | |
a7c93f3f FM |
8 | # |
9 | # Usage: | |
189dea29 | 10 | # ./regen.sh [html|chm|xml|latex|all] |
a7c93f3f | 11 | # |
189dea29 | 12 | # Pass "x" to regen only the X output format and "all" to regen them all. |
a7c93f3f FM |
13 | # If no arguments are passed all formats are regenerated |
14 | # (just like passing "all"). | |
15 | # | |
16 | ||
cba817ac | 17 | |
189dea29 | 18 | # remember current folder and then cd to the docs/doxygen one |
aa6ec1d7 FM |
19 | me=$(basename $0) |
20 | path=${0%%/$me} # path from which the script has been launched | |
21 | current=$(pwd) | |
22 | cd $path | |
e5156137 | 23 | export WXWIDGETS=`cd ../.. && pwd` |
aa6ec1d7 | 24 | |
a7c93f3f | 25 | # prepare folders for the cp commands below |
85e43f4e | 26 | mkdir -p out/html # we need to copy files in this folder below |
7a118965 | 27 | mkdir -p out/html/wxmsw out/html/wxgtk out/html/wxmac |
4411a6b6 | 28 | |
20a886a3 BP |
29 | # These are not automatically copied by Doxygen because they're not |
30 | # used in doxygen documentation, only in our html footer and by our | |
a7c93f3f | 31 | # custom aliases |
4411a6b6 | 32 | cp images/powered-by-wxwidgets.png out/html |
9c981bfb | 33 | cp images/*logo.png out/html |
7a118965 FM |
34 | cp images/wxmsw/*png out/html/wxmsw |
35 | cp images/wxmac/*png out/html/wxmac | |
36 | cp images/wxgtk/*png out/html/wxgtk | |
20a886a3 | 37 | cp wxwidgets.js out/html |
d513b59d | 38 | |
a7c93f3f | 39 | # this CSS is not automatically copied by Doxygen because it's |
d513b59d FM |
40 | # included by our custom html header... |
41 | cp wxwidgets.css out/html | |
42 | ||
a7c93f3f FM |
43 | # which configuration should we use? |
44 | if [[ -z "$1" ]]; then | |
66e09890 | 45 | cfgfile="Doxyfile_all" |
a7c93f3f | 46 | else |
66e09890 | 47 | cfgfile="Doxyfile_$1" |
a7c93f3f FM |
48 | fi |
49 | ||
85e43f4e FM |
50 | # |
51 | # NOW RUN DOXYGEN | |
52 | # | |
53 | # NB: we do this _after_ copying the required files to the output folders | |
54 | # otherwise when generating the CHM file with Doxygen, those files are | |
55 | # not included! | |
56 | # | |
85e43f4e FM |
57 | doxygen $cfgfile |
58 | ||
5590a552 FM |
59 | if [[ "$1" = "qch" ]]; then |
60 | # we need to add missing files to the .qhp | |
61 | cd out/html | |
62 | qhelpfile="index.qhp" | |
63 | ||
64 | # remove <file> lines | |
65 | cat $qhelpfile | grep -v "\<file\>" >temp | |
66 | ||
67 | # remove last 3 lines | |
68 | lines=$(wc -l < temp) | |
69 | wanted=`expr $lines - 3` | |
70 | head -n $wanted temp >$qhelpfile | |
71 | ||
72 | # remove useless .md5 and .map files | |
73 | rm *map *md5 | |
74 | ||
75 | # add a <file> tag for _any_ file in out/html folder except the .qhp itself | |
76 | for f in *; do | |
77 | if [[ $f != $qhelpfile ]]; then | |
78 | echo " <file>$f</file>" >>$qhelpfile | |
79 | fi | |
80 | done | |
81 | ||
82 | # add ending tags to the qhp file | |
83 | echo " </files> | |
84 | </filterSection> | |
85 | </QtHelpProject>" >>$qhelpfile | |
86 | ||
87 | # last, run qhelpgenerator: | |
88 | cd ../.. | |
89 | qhelpgenerator out/html/index.qhp -o out/wx.qch | |
90 | fi | |
91 | ||
d513b59d FM |
92 | # Doxygen has the annoying habit to put the full path of the |
93 | # affected files in the log file; remove it to make the log | |
94 | # more readable | |
95 | currpath=`pwd`/ | |
2c58a7e7 FM |
96 | interfacepath=`cd ../../interface && pwd`/ |
97 | cat doxygen.log | sed -e "s|$currpath||g" -e "s|$interfacepath||g" >temp | |
4514447c | 98 | |
edbbd747 FM |
99 | # Doxygen warnings are not completely sorted for filename; enforce correct sorting: |
100 | cat temp | sort >doxygen.log | |
101 | rm temp | |
4514447c | 102 | |
edbbd747 | 103 | # return to the original folder from which this script was launched |
aa6ec1d7 | 104 | cd $current |