File: update_srcdoc.sh

package info (click to toggle)
boost1.35 1.35.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 203,856 kB
  • ctags: 337,867
  • sloc: cpp: 938,683; xml: 56,847; ansic: 41,589; python: 18,999; sh: 11,566; makefile: 664; perl: 494; yacc: 456; asm: 353; csh: 6
file content (54 lines) | stat: -rw-r--r-- 2,036 bytes parent folder | download
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
47
48
49
50
51
52
53
54
#!/bin/sh
################################################################################
# Shell script which updates the Circular Buffer library documentation with    #
# the latest source code documentation (which is in the source files).         #
#                                                                              #
# Copyright (c) 2007 Jan Gaspar                                                #
#                                                                              #
# Use, modification, and distribution is subject to the Boost Software         #
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at      #
# http://www.boost.org/LICENSE_1_0.txt)                                        #
################################################################################

CONTAINER=$1
DOCFILE="$CONTAINER.html"
XSLT="$CONTAINER.xslt"
XHTML="$CONTAINER.xhtml"
SPECIALIZATION=${CONTAINER#circular_buffer_}

if [ ${#SPECIALIZATION} -gt 0 ]; then
  DOCFILE=${DOCFILE#circular_buffer_}
  XSLT=${XSLT#circular_buffer_}
  XHTML=${XHTML#circular_buffer_}
fi

if [ -f $DOCFILE ]; then

  echo Starting Doxygen ...
  doxygen

  echo Converting Doxygen generated source code documentation into XHTML ...
  xsltproc --stringparam container $CONTAINER --stringparam xmldir srcdoc -o srcdoc/srcdoc.xhtml $XSLT srcdoc/index.xml

  echo Preprocessing $DOCFILE ...
  sed 's/<a\s*id="[^"]*"/<a /g' $DOCFILE | sed 's/<a\s*\(name="[^"]*"\)\s*\(id="[^"]*"\)/<a \1/g' > srcdoc/$DOCFILE

  echo Converting preprocessed $DOCFILE into XHTML ...
  xsltproc --html -o srcdoc/$XHTML html2xhtml.xslt srcdoc/$DOCFILE

  echo Generating $DOCFILE with updated source code documentation ...
  xsltproc --stringparam srcdoc srcdoc/srcdoc.xhtml -o $DOCFILE update_srcdoc.xslt srcdoc/$XHTML

  echo Correcting and pretty-printing $DOCFILE with HTML Tidy ...
  tidy -ashtml -config Tidy.conf $DOCFILE

  echo Removing temporary directory ...
  rm -rf srcdoc

  echo Done.

else

  echo Usage: update_srcdoc.sh container

fi