]> git.donarmstrong.com Git - lilypond.git/blob - scripts/auxiliar/cg-section.sh
Imported Upstream version 2.14.2
[lilypond.git] / scripts / auxiliar / cg-section.sh
1 #!/bin/sh
2
3 #  Build html versions of sections of lilypond Contributors' Guide
4 #
5 #  Usage:  cg-section.sh SECTION
6 #
7 #   where SECTION is the section to be built.
8 #
9 #   For example, CG 4 would be built by
10 #       cg-section.sh doc-work
11 #
12 #   At the end of the run, the user is prompted whether or not to remove files
13 #
14 #  Before first use, the following must be done:
15 #     * Set FROMDIR, DOCDIR, TODIR, LILYPONDBOOK, and TEXI2HTML for your system
16 #     * Create $DOCDIR
17 #     * Copy version.itexi from somewhere in your Documentation tree
18 #         (probably Documentation/out) to $DOCDIR
19 #
20 #  Known limitations:
21 #
22 #     * Doesn't use website css files
23 #     * Bitmap images aren't loaded properly
24 #
25
26 #
27 #  Customize the file here
28 #
29 FROMDIR="$HOME/lilypond"
30 DOCDIR="$HOME/lilypond/tempdocs"
31 TODIR="$DOCDIR/contributor"
32 TEXI2HTML="texi2html"
33 REFCHECK="$FROMDIR/scripts/auxiliar/ref_check.py"
34
35 NAME=$1
36
37 if test ! -d $TODIR; then
38   mkdir $TODIR
39 fi
40 if test ! -d $TODIR/out; then
41   mkdir $TODIR/out
42 fi
43
44 cp $FROMDIR/Documentation/common-macros.itexi $TODIR/common-macros.itexi
45 cp $FROMDIR/Documentation/macros.itexi $DOCDIR/macros.itexi
46 cp $DOCDIR/version.itexi $TODIR/version.itexi
47
48 if test -e $TODIR/$NAME.html; then
49   rm $TODIR/$NAME.html
50 fi
51
52 if test -e $TODIR/out/$NAME.texi; then
53   rm $TODIR/out/$NAME.texi
54 fi
55
56 echo Running RefCheck
57 python $REFCHECK
58
59 cd $DOCDIR
60 echo Running texi2html
61 cat $DOCDIR/macros.itexi $FROMDIR/Documentation/contributor/$NAME.itexi > $TODIR/$NAME.texi
62 $TEXI2HTML \
63   --no-validate \
64   --output=$TODIR/out/$NAME.html \
65   --I=$FROMDIR/Documentation \
66   --I=$TODIR/out \
67   $TODIR/$NAME.texi
68
69 read -p "delete files? (y/n): "
70 if [ "$REPLY" = "y" ]; then
71   echo "deleting files"
72   rm -rf $TODIR
73 fi