RN rnmake  3.0.0
doxyindex.sh
1 #!/bin/sh
2 # Package: RN Makefile System Utility
3 # File: doxyindex.sh
4 # Desc: Overwrite doxygen's generated index.html with tailored version.
5 # Usage: doxyindex.sh -t <title> -h <doxyheader>
6 #
7 # /*! \file */
8 # /*! \cond RNMAKE_DOXY*/
9 
10 # The options string
11 optstr="t:h:"
12 
13 title=
14 header=
15 
16 #
17 # Get options. Note: first colon says that getopts will not print errors.
18 #
19 while getopts :${optstr} opt
20 do
21  case $opt in
22  t) title="$OPTARG" ;;
23 
24  h) header="$OPTARG" ;;
25 
26  *) echo "rnmake: $0: error: Unknown opt: $opt"; exit 2;;
27  esac
28 done
29 
30 shift $(($OPTIND - 1))
31 
32 if [ "${title}" = "" ]
33 then
34  echo "rnmake: $0: error: No title specfied"
35  exit 2
36 fi
37 
38 if [ "${header}" = "" ]
39 then
40  echo "rnmake: $0: error: No package header specified"
41  exit 2
42 fi
43 
44 #
45 # Add Frame doc type
46 #
47 cat <<ENDOFDOC
48 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
49 ENDOFDOC
50 
51 #
52 # Header contains the expected html structure.
53 # <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
54 # <html>
55 # <head>
56 # header data
57 # </head>
58 # <body...>
59 #
60 # Remove any <DOCTYPE> and <title> elements and the trailing </head> and
61 # <body> elements.
62 #
63 cat ${header} | grep -vi -E "<!DOCTYPE.*>|<title>|</head>|<body.*>"
64 
65 #
66 # Add specified title and ending index frameset
67 #
68 cat <<ENDOFDOC
69  <title>${title}</title>
70  </head>
71  <frameset cols="250,*">
72  <frame src="tree.html" name="treefrm">
73  <frame src="main.html" name="basefrm">
74  <noframes>
75  <a href="main.html">Frames are disabled. Click here to go to the main page.</a>
76  </noframes>
77  </frameset>
78 </html>
79 ENDOFDOC
80 
81 exit 0
82 
83 #/*! \endcond RNMAKE_DOXY */