File: convert_links.sh

package info (click to toggle)
eccodes 2.45.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 154,456 kB
  • sloc: cpp: 162,953; ansic: 26,308; sh: 21,742; f90: 6,854; perl: 6,361; python: 5,172; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 278; xml: 183; awk: 66
file content (46 lines) | stat: -rwxr-xr-x 1,210 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

set -e

# Change the links from example code back to confluence
# This is only done the first time before checking in the new html files
# Do not run this on html files which are already converted!
fnames="
 bufr_get_keys
 grib_index
 grib_get_keys
 grib_set_keys
 grib_get_data
 grib_clone
 grib_print_data
 grib_copy_message
 count_messages
 grib_nearest
 grib_samples
 grib_set_missing
"
# Adding target="_blank" ensures link opens in a new tab/window in browser
for fn in $fnames; do
  perl -p -i -e "s|$fn\.f90|<a href=\"https://software.ecmwf.int/wiki/display/ECC/$fn\" target=\"_blank\">$fn.f90</a>|" ../html/classeccodes.html
  # Do all F90 interface files too
  perl -p -i -e "s|$fn\.f90|<a href=\"https://software.ecmwf.int/wiki/display/ECC/$fn\" target=\"_blank\">$fn.f90</a>|" ../html/interfaceeccodes*.html
done

pnames="
 grib_get_keys
 grib_set_keys
 grib_samples
 grib_set_missing
 grib_nearest
 grib_index
 grib_print_data
 grib_multi_write
 grib_iterator
 grib_clone
 grib_keys_iterator
 bufr_get_keys
"
for fn in $pnames; do
  perl -p -i -e "s|$fn\.py|<a href=\"https://software.ecmwf.int/wiki/display/ECC/$fn\" target=\"_blank\">$fn.py</a>|" ../html/namespaceec_codes.html
done