3 # Build html versions of sections of lilypond documentation
5 # Usage: doc-section.sh MANUAL SECTION
7 # where MANUAL is the manual and SECTION is the section to be built.
9 # For example, NR 1.2 would be built by
10 # doc-section.sh notation rhythms
12 # and LM 1 would be built by
13 # doc-section.sh learning tutorial
15 # At the end of the run, the user is prompted whether or not to remove files
17 # Before first use, the following must be done:
18 # * Set FROMDIR, DOCDIR, TODIR, LILYPONDBOOK, and TEXI2HTML for your system
20 # * Copy version.itexi from somewhere in your Documentation tree
21 # (probably Documentation/out) to $DOCDIR
25 # * Doesn't use website css files
26 # * bitmap images aren't loaded properly
30 # Customize the file here
32 FROMDIR="$HOME/lilypond"
33 DOCDIR="$HOME/lilypond/tempdocs"
35 LILYPONDBOOK="lilypond-book"
37 REFCHECK="$FROMDIR/scripts/auxiliar/ref_check.py"
42 if test ! -d $TODIR; then
45 if test ! -d $TODIR/out; then
49 cp $FROMDIR/Documentation/common-macros.itexi $TODIR/common-macros.itexi
50 cp $FROMDIR/Documentation/macros.itexi $DOCDIR/macros.itexi
51 cp $DOCDIR/version.itexi $TODIR/version.itexi
53 if test -e cp_$NAME.sh; then
54 cp_$NAME.sh $FROMDIR $TODIR
57 if test -e $TODIR/$NAME.html; then
61 if test -e $TODIR/out/$NAME.texi; then
62 rm $TODIR/out/$NAME.texi
65 echo "Running lilypond-book"
68 -I $FROMDIR/Documentation/snippets \
69 -I $FROMDIR/Documentation/snippets/new \
70 -I $FROMDIR/input/manual \
71 -I $FROMDIR/Documentation \
72 -I $FROMDIR/Documentation/included \
74 $FROMDIR/Documentation/$DIRECTORY/$NAME.itely
76 if [ $BOOKRC != 0 ]; then
77 echo "Lilypond-book returned code $BOOKRC"
85 if test -f $TODIR/out/$NAME.texi; then
86 echo Running texi2html
87 cat $DOCDIR/macros.itexi $TODIR/out/$NAME.texi > $TODIR/$NAME.texi
90 --output=$TODIR/out/$NAME.html \
95 read -p "delete files? (y/n): "
96 if [ "$REPLY" = "y" ]; then