Add scripts/auxiliar/cg-section.sh plus documentation
[lilypond/mpolesky.git] / scripts / auxiliar / cg-section.sh
blob272260c3c9129948a77aaed3fe0c983e7bcfa460
1 #!/bin/sh
3 # Build html versions of sections of lilypond Contributors' Guide
5 # Usage: cg-section.sh SECTION
7 # where SECTION is the section to be built.
9 # For example, CG 4 would be built by
10 # cg-section.sh doc-work
12 # At the end of the run, the user is prompted whether or not to remove files
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
20 # Known limitations:
22 # * Doesn't use website css files
23 # * Bitmap images aren't loaded properly
27 # Customize the file here
29 FROMDIR="$HOME/lilypond"
30 DOCDIR="$HOME/lilypond/tempdocs"
31 TODIR="$DOCDIR/contributor"
32 TEXI2HTML="texi2html"
33 REFCHECK="$FROMDIR/scripts/auxiliar/ref_check.py"
35 NAME=$1
37 if test ! -d $TODIR; then
38 mkdir $TODIR
40 if test ! -d $TODIR/out; then
41 mkdir $TODIR/out
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
48 if test -e $TODIR/$NAME.html; then
49 rm $TODIR/$NAME.html
52 if test -e $TODIR/out/$NAME.texi; then
53 rm $TODIR/out/$NAME.texi
56 echo Running RefCheck
57 python $REFCHECK
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
69 read -p "delete files? (y/n): "
70 if [ "$REPLY" = "y" ]; then
71 echo "deleting files"
72 rm -rf $TODIR