[161] | 1 | #!/bin/bash -x |
---|
[85] | 2 | # |
---|
[123] | 3 | # update : |
---|
| 4 | # $Id$ |
---|
[139] | 5 | # |
---|
| 6 | # ++ one day we can add accessibility check with tidy with -access 3 |
---|
| 7 | # diagnostics are not so good so far because tidy (HTML Tidy for Mac OS X |
---|
| 8 | # released on 1 September 2005) doesn't handle carriage returns |
---|
| 9 | # |
---|
[164] | 10 | # fplod 2006-08-29T14:01:11Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 11 | # add main which needs xmllint processing to resolve xinclude |
---|
[161] | 12 | # fplod 2006-08-18T13:38:31Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 13 | # add faqsaxo which needs xmllint processing to resolve xinclude |
---|
[144] | 14 | # fplod 2006-07-21T08:25:05Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 15 | # add prerequisites for mini_notice production |
---|
[139] | 16 | # fplod 2006-07-12T11:57:24Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 17 | # add style.css |
---|
| 18 | # fplod 2006-07-11T08:25:30Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 19 | # use of tidy and titlepage.saxo.xml |
---|
| 20 | # replace /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl |
---|
| 21 | # by saxo_html.xsl |
---|
[123] | 22 | # fplod 2006-07-05T13:18:56Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 23 | # add infoupdatecm |
---|
| 24 | # add sort and varname in production of infoupdatekwd |
---|
[92] | 25 | # fplod 2006-06-07T13:55:07Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 26 | # add infoupdatekwd |
---|
[86] | 27 | # fplod 2006-06-02T14:37:47Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 28 | # take only one tar file : the most recent using modification time |
---|
[85] | 29 | # fplod 2006-06-02T10:00:41Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 30 | # http://forge.ipsl.jussieu.fr/saxo/download/ is the new directory reference |
---|
[87] | 31 | # for tar file instead of ~/SAXO_SRC/ ie home of Sebatien Masson on |
---|
[85] | 32 | # arete.lodyc.jussieu.fr |
---|
| 33 | # !!! saxo@forge.ipsl.jussieu.fr password is needed |
---|
[79] | 34 | # fplod 2006-05-31T10:34:18Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 35 | # . add creation of all_plots.html using firststeps.html |
---|
[87] | 36 | # . remplace ~/SAXO_SRC/SRC/Documentation/xmldoc/figpng by ./figpng/ |
---|
[79] | 37 | # we suppose that this shell script is launched when we are in |
---|
| 38 | # <working space of saxo>/SRC/Documentation/xmldoc/ |
---|
| 39 | # |
---|
[65] | 40 | set -u |
---|
[79] | 41 | # |
---|
[100] | 42 | case $( whoami ) in |
---|
| 43 | smasson) |
---|
| 44 | lgforge=smasson |
---|
| 45 | ;; |
---|
| 46 | floseb) |
---|
| 47 | lgforge=smasson |
---|
| 48 | ;; |
---|
| 49 | *) |
---|
| 50 | lgforge=saxo |
---|
| 51 | ;; |
---|
| 52 | esac |
---|
| 53 | # |
---|
[79] | 54 | case "${1}" in |
---|
[84] | 55 | getsaxo) |
---|
[87] | 56 | # size of SRCand DATA with .svn |
---|
| 57 | szallsvn=$( du -sh ../../.. | awk '{print $1}' ) |
---|
| 58 | szallsvn=${szallsvn%*M} |
---|
| 59 | # size of SRC with .svn |
---|
| 60 | szsrcsvn=$( du -sh ../../../SRC | awk '{print $1}' ) |
---|
| 61 | szsrcsvn=${szsrcsvn%*M} |
---|
| 62 | # size of DATA with .svn |
---|
| 63 | szdatasvn=$( du -sh ../../../DATA | awk '{print $1}' ) |
---|
| 64 | szdatasvn=${szdatasvn%*M} |
---|
[100] | 65 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times" |
---|
[87] | 66 | # find the most recent SAXO_SRC_yyyymmdd.tar.gz in |
---|
[85] | 67 | # /ipsl/forge/projets/saxo/download/ |
---|
[100] | 68 | infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1) |
---|
[85] | 69 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
| 70 | szsrc=$(echo ${infosrc} | awk '{print $5}') |
---|
[87] | 71 | # ndate is the date in the file SAXO_SRC_*.tar.gz |
---|
[85] | 72 | ndate=${filesrc##*_} |
---|
[79] | 73 | ndate=${ndate%.tar.gz} |
---|
[87] | 74 | # find the most recent SAXO_DATA_yyyymmdd.tar.gz in |
---|
[85] | 75 | # /ipsl/forge/projets/saxo/download/ |
---|
[100] | 76 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
[85] | 77 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
| 78 | szdata=$(echo ${infodata} | awk '{print $5}') |
---|
[87] | 79 | # ndate2 is the date in the file SAXO_DATA_*.tar.gz |
---|
[85] | 80 | ndate2=${filedata##*_} |
---|
[79] | 81 | ndate2=${ndate2%.tar.gz} |
---|
| 82 | ;; |
---|
[92] | 83 | infoupdatekwd) |
---|
| 84 | grep "^ old = \[old, .* new = \[new" ../../ForOldVersion/updatekwd.pro | \ |
---|
[123] | 85 | sort | \ |
---|
| 86 | sed -e "s/\( old = \[old, '\)\(.*\)\('\] *& new = \[new, '\)\(.*\)\('\]\)/<row><entry colname='old'><varname>\2<\/varname><\/entry> <entry colname='new'><varname>\4<\/varname><\/entry><\/row>/" > /tmp/rowskwd.xml |
---|
[92] | 87 | ;; |
---|
[123] | 88 | infoupdatecm) |
---|
| 89 | grep "IF NOT key_forgetold AND n_elements(" ../../ForOldVersion/updateold.pro | \ |
---|
| 90 | sort | \ |
---|
| 91 | sed -e "s/\(^.* THEN \)\(.*\)\( = \)\(.*\)/<row><entry colname='old'><varname>\2<\/varname><\/entry> <entry colname='new'><varname>\4<\/varname><\/entry><\/row>/" > /tmp/rowscm.xml |
---|
| 92 | ;; |
---|
[144] | 93 | mini_notice) |
---|
| 94 | # production of images with frames and callouts |
---|
[149] | 95 | # ./forxxxdoc.sh 0101 |
---|
| 96 | # ./forxxxdoc.sh 0201 |
---|
[144] | 97 | ;; |
---|
[79] | 98 | *) |
---|
[144] | 99 | echo "iii : no prerequisites needed" |
---|
[79] | 100 | ;; |
---|
| 101 | esac |
---|
| 102 | |
---|
[65] | 103 | # figures lists |
---|
[79] | 104 | cd ./figpng |
---|
[65] | 105 | |
---|
| 106 | # |
---|
| 107 | figsplt_lev="" |
---|
| 108 | for i in tst_plt_lev_[0-9][0-9].png |
---|
| 109 | do |
---|
[81] | 110 | figsplt_lev="${figsplt_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 111 | done |
---|
| 112 | figspltz_lev="" |
---|
| 113 | for i in tst_pltz_lev_[0-9][0-9].png |
---|
| 114 | do |
---|
[81] | 115 | figspltz_lev="${figspltz_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 116 | done |
---|
| 117 | figspltt_lev="" |
---|
| 118 | for i in tst_pltt_lev_[0-9][0-9].png |
---|
| 119 | do |
---|
[81] | 120 | figspltt_lev="${figspltt_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 121 | done |
---|
| 122 | # |
---|
| 123 | figsplt_orca2="" |
---|
| 124 | for i in tst_plt_orca2_[0-9][0-9].png |
---|
| 125 | do |
---|
[81] | 126 | figsplt_orca2="${figsplt_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 127 | done |
---|
| 128 | figspltz_orca2="" |
---|
| 129 | for i in tst_pltz_orca2_[0-9][0-9].png |
---|
| 130 | do |
---|
[81] | 131 | figspltz_orca2="${figspltz_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 132 | done |
---|
| 133 | figspltt_orca2="" |
---|
| 134 | for i in tst_pltt_orca2_[0-9][0-9].png |
---|
| 135 | do |
---|
[81] | 136 | figspltt_orca2="${figspltt_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 137 | done |
---|
| 138 | # |
---|
| 139 | figsplt_orca05="" |
---|
| 140 | for i in tst_plt_orca05_[0-9][0-9].png |
---|
| 141 | do |
---|
[81] | 142 | figsplt_orca05="${figsplt_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 143 | done |
---|
| 144 | figspltz_orca05="" |
---|
| 145 | for i in tst_pltz_orca05_[0-9][0-9].png |
---|
| 146 | do |
---|
[81] | 147 | figspltz_orca05="${figspltz_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 148 | done |
---|
| 149 | figspltt_orca05="" |
---|
| 150 | for i in tst_pltt_orca05_[0-9][0-9].png |
---|
| 151 | do |
---|
[81] | 152 | figspltt_orca05="${figspltt_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 153 | done |
---|
| 154 | ## |
---|
| 155 | # |
---|
| 156 | figsplt_lev_stride="" |
---|
| 157 | for i in tst_plt_lev_stride_[0-9][0-9].png |
---|
| 158 | do |
---|
[81] | 159 | figsplt_lev_stride="${figsplt_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 160 | done |
---|
| 161 | figspltz_lev_stride="" |
---|
| 162 | for i in tst_pltz_lev_stride_[0-9][0-9].png |
---|
| 163 | do |
---|
[81] | 164 | figspltz_lev_stride="${figspltz_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 165 | done |
---|
| 166 | figspltt_lev_stride="" |
---|
| 167 | for i in tst_pltt_lev_stride_[0-9][0-9].png |
---|
| 168 | do |
---|
[81] | 169 | figspltt_lev_stride="${figspltt_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 170 | done |
---|
| 171 | # |
---|
| 172 | figsplt_orca2_stride="" |
---|
| 173 | for i in tst_plt_orca2_stride_[0-9][0-9].png |
---|
| 174 | do |
---|
[81] | 175 | figsplt_orca2_stride="${figsplt_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 176 | done |
---|
| 177 | figspltz_orca2_stride="" |
---|
| 178 | for i in tst_pltz_orca2_stride_[0-9][0-9].png |
---|
| 179 | do |
---|
[81] | 180 | figspltz_orca2_stride="${figspltz_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 181 | done |
---|
| 182 | figspltt_orca2_stride="" |
---|
| 183 | for i in tst_pltt_orca2_stride_[0-9][0-9].png |
---|
| 184 | do |
---|
[81] | 185 | figspltt_orca2_stride="${figspltt_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 186 | done |
---|
| 187 | # |
---|
| 188 | figsplt_orca05_stride="" |
---|
| 189 | for i in tst_plt_orca05_stride_[0-9][0-9].png |
---|
| 190 | do |
---|
[81] | 191 | figsplt_orca05_stride="${figsplt_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 192 | done |
---|
| 193 | figspltz_orca05_stride="" |
---|
| 194 | for i in tst_pltz_orca05_stride_[0-9][0-9].png |
---|
| 195 | do |
---|
[81] | 196 | figspltz_orca05_stride="${figspltz_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 197 | done |
---|
| 198 | figspltt_orca05_stride="" |
---|
| 199 | for i in tst_pltt_orca05_stride_[0-9][0-9].png |
---|
| 200 | do |
---|
[81] | 201 | figspltt_orca05_stride="${figspltt_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 202 | done |
---|
| 203 | ## |
---|
[79] | 204 | cd .. # ie <working space of saxo>/SRC/Documentation/xmldoc |
---|
[139] | 205 | # |
---|
| 206 | # production of titlepage.saxo.xsl |
---|
| 207 | # |
---|
| 208 | # si pb reseau remplacer sur mac par la ligne suivante |
---|
| 209 | titlepagexsl=http://docbook.sourceforge.net/release/xsl/current/template/titlepage.xsl |
---|
| 210 | titlepagexsl=/sw/share/xml/xsl/docbook-xsl/template/titlepage.xsl |
---|
| 211 | # |
---|
| 212 | xsltproc \ |
---|
| 213 | --xinclude \ |
---|
| 214 | -o titlepage.saxo.xsl \ |
---|
| 215 | ${titlepagexsl} \ |
---|
| 216 | titlepage.saxo.xml |
---|
| 217 | # |
---|
[79] | 218 | case "${1}" in |
---|
[85] | 219 | getsaxo) |
---|
| 220 | sed -e s/"\&date\;"/${ndate}/g \ |
---|
| 221 | -e s/"\&date2\;"/${ndate2}/g \ |
---|
| 222 | -e s/"\&szsrc\;"/${szsrc}/g \ |
---|
| 223 | -e s/"\&szdata\;"/${szdata}/g \ |
---|
[87] | 224 | -e s/"\&szallsvn\;"/${szallsvn}/g \ |
---|
| 225 | -e s/"\&szsrcsvn\;"/${szsrcsvn}/g \ |
---|
| 226 | -e s/"\&szdatasvn\;"/${szdatasvn}/g \ |
---|
[85] | 227 | ${1}.xml > ${1}_${$}.xml |
---|
| 228 | ;; |
---|
[88] | 229 | firststeps) |
---|
[84] | 230 | sed -e s/"\&figsplt_lev\;"/"${figsplt_lev}"/g \ |
---|
[79] | 231 | -e s/"\&figsplt_orca2\;"/"${figsplt_orca2}"/g \ |
---|
| 232 | -e s/"\&figsplt_orca05\;"/"${figsplt_orca05}"/g \ |
---|
| 233 | -e s/"\&figspltz_lev\;"/"${figspltz_lev}"/g \ |
---|
| 234 | -e s/"\&figspltz_orca2\;"/"${figspltz_orca2}"/g \ |
---|
| 235 | -e s/"\&figspltz_orca05\;"/"${figspltz_orca05}"/g \ |
---|
| 236 | -e s/"\&figspltt_lev\;"/"${figspltt_lev}"/g \ |
---|
| 237 | -e s/"\&figspltt_orca2\;"/"${figspltt_orca2}"/g \ |
---|
| 238 | -e s/"\&figspltt_orca05\;"/"${figspltt_orca05}"/g \ |
---|
| 239 | -e s/"\&figsplt_lev_stride\;"/"${figsplt_lev_stride}"/g \ |
---|
| 240 | -e s/"\&figsplt_orca2_stride\;"/"${figsplt_orca2_stride}"/g \ |
---|
| 241 | -e s/"\&figsplt_orca05_stride\;"/"${figsplt_orca05_stride}"/g \ |
---|
| 242 | -e s/"\&figspltz_lev_stride\;"/"${figspltz_lev_stride}"/g \ |
---|
| 243 | -e s/"\&figspltz_orca2_stride\;"/"${figspltz_orca2_stride}"/g \ |
---|
| 244 | -e s/"\&figspltz_orca05_stride\;"/"${figspltz_orca05_stride}"/g \ |
---|
| 245 | -e s/"\&figspltt_lev_stride\;"/"${figspltt_lev_stride}"/g \ |
---|
| 246 | -e s/"\&figspltt_orca2_stride\;"/"${figspltt_orca2_stride}"/g \ |
---|
| 247 | -e s/"\&figspltt_orca05_stride\;"/"${figspltt_orca05_stride}"/g \ |
---|
| 248 | ${1}.xml > ${1}_${$}.xml |
---|
| 249 | ;; |
---|
[92] | 250 | infoupdatekwd) |
---|
[123] | 251 | sed -e "/-- rows from updatekwd.pro --/r /tmp/rowskwd.xml" \ |
---|
[92] | 252 | ${1}.xml > ${1}_${$}.xml |
---|
[123] | 253 | /bin/rm /tmp/rowskwd.xml |
---|
[92] | 254 | ;; |
---|
[123] | 255 | infoupdatecm) |
---|
| 256 | sed -e "/-- rows from updateold.pro --/r /tmp/rowscm.xml" \ |
---|
| 257 | ${1}.xml > ${1}_${$}.xml |
---|
| 258 | /bin/rm /tmp/rowscm.xml |
---|
| 259 | ;; |
---|
[164] | 260 | faqsaxo|main) |
---|
[161] | 261 | # resolve xinclude |
---|
| 262 | xmllint --xinclude \ |
---|
| 263 | --output ${1}_${$}.xml ${1}.xml |
---|
| 264 | ;; |
---|
[79] | 265 | *) |
---|
| 266 | cp ${1}.xml ${1}_${$}.xml |
---|
| 267 | echo "iii : no xml transformation needed" |
---|
| 268 | ;; |
---|
| 269 | esac |
---|
[65] | 270 | # |
---|
[161] | 271 | CLASSPATH="${CLASSPATH}:\ |
---|
[65] | 272 | /sw/share/java/saxon/saxon.jar:\ |
---|
| 273 | /sw/share/xml/xsl/docbook-xsl/extensions/saxon653.jar" |
---|
| 274 | export CLASSPATH |
---|
| 275 | # |
---|
[139] | 276 | java com.icl.saxon.StyleSheet -o ${1}.html ${1}_${$}.xml \ |
---|
| 277 | saxo_html.xsl \ |
---|
| 278 | section.autolabel=1 html.stylesheet="style.css saxo.css" css.decoration=1 \ |
---|
| 279 | callout.graphics.extension=".png" \ |
---|
| 280 | callout.graphics="1" \ |
---|
| 281 | callout.graphics.path="images/callouts/" \ |
---|
| 282 | use.extensions=1 \ |
---|
| 283 | callouts.extension=1 |
---|
| 284 | # |
---|
[79] | 285 | case "${1}" in |
---|
| 286 | firststeps) |
---|
[139] | 287 | java com.icl.saxon.StyleSheet -o all_plots_${$}.xml ${1}_${$}.xml \ |
---|
[79] | 288 | all_plots_docbook.xsl |
---|
| 289 | java com.icl.saxon.StyleSheet -o all_plots.html all_plots_${$}.xml \ |
---|
[139] | 290 | saxo_html.xsl \ |
---|
| 291 | section.autolabel=1 html.stylesheet="style.css saxo.css" css.decoration=1 |
---|
[79] | 292 | rm -f all_plots_${$}.xml |
---|
[88] | 293 | # not very nice... but useful !! |
---|
| 294 | sed -e s/".png\""/".png?format=raw\""/g ${1}.html > ${1}_${$}.html |
---|
| 295 | mv ${1}_${$}.html ${1}.html |
---|
[158] | 296 | ;; |
---|
[94] | 297 | main) |
---|
| 298 | sed -e s?"../../saxo/browser/trunk/SRC/Documentation/xmldoc/"??g \ |
---|
[100] | 299 | -e s?"../../saxo/browser/trunk/SRC/Documentation/idldoc_html_output/"?"../idldoc_html_output/"?g \ |
---|
[94] | 300 | -e s?"../../saxo/browser/trunk"?"http://forge.ipsl.jussieu.fr/saxo/browser/trunk"?g \ |
---|
| 301 | ${1}.html > ${1}_${$}.html |
---|
| 302 | mv ${1}_${$}.html ${1}.html |
---|
[158] | 303 | ;; |
---|
| 304 | mini_notice) |
---|
| 305 | # not very nice... but useful !! |
---|
| 306 | sed -e s/".png\""/".png?format=raw\""/g ${1}.html > ${1}_${$}.html |
---|
| 307 | mv ${1}_${$}.html ${1}.html |
---|
| 308 | ;; |
---|
[79] | 309 | esac |
---|
[139] | 310 | # |
---|
| 311 | # use of tidy to have a W3C compliant html file |
---|
| 312 | tidy -m ${1}.html |
---|
| 313 | # |
---|
| 314 | # clean |
---|
[79] | 315 | rm -f ${1}_${$}.xml |
---|
[139] | 316 | rm titlepage.saxo.xsl |
---|
| 317 | # |
---|
| 318 | # exit |
---|
| 319 | exit 0 |
---|