@node Scripts to ease doc work
@section Scripts to ease doc work
+@subheading Building only one section of the documentation
+
+In order to save build time, a script is available to build only
+one section of the documentation in English with a default html
+appearance.
+
+The script is available as:
+
+@example
+scripts/auxiliar/doc-section.sh
+@end example
+
+This script will require customization for your site if your
+LilyPond git repository is anyplace but @code{$HOME/lilypond}.
+
+Assuming that no customization is required, you can setup the
+single section build with:
+
+@example
+mkdir $HOME/lilypond/tempdocs
+cp $HOME/lilypond/Documentation/out/version.itexi $HOME/lilypond/tempdocs
+@end example
+
+You can then build a section of the documentation with:
+
+@example
+scripts/auxiliar/doc-section.sh MANUAL SECTION
+@end example
+
+@noindent
+where @code{SECTION} is the name of the file containing the section
+to be build, and @code{MANUAL} isc replaced by the name of the directory
+containing the section. So, for example, to build section 1.1 of the
+Notation Reference, use the command:
+
+@example
+scripts/auxiliar/doc-section.sh notation pitches
+@end example
+
+This script will not work for building sections of the
+Contributors' guide. For building sections of the Contributors'
+Guide, use:
+
+@example
+scripts/auxiliar/cg-section.sh SECTION
+@end example
+
+@noindent
+where @code{SECTION} is the name of the file containing the sections
+to be built. For example, to build section 4 of the Contributors' guide,
+use:
+
+@example
+scripts/auxiliar/cg-section.sh doc-work
+@end example
+
+Like @code{doc-section.sh}, @code{cg-section.sh} may need to be customized
+for your installation.
+
@subheading Stripping whitespace
@c TODO: should this be documented elsewhere? It's useful for
--- /dev/null
+#!/bin/sh
+
+# Build html versions of sections of lilypond Contributors' Guide
+#
+# Usage: cg-section.sh SECTION
+#
+# where SECTION is the section to be built.
+#
+# For example, CG 4 would be built by
+# cg-section.sh doc-work
+#
+# At the end of the run, the user is prompted whether or not to remove files
+#
+# Before first use, the following must be done:
+# * Set FROMDIR, DOCDIR, TODIR, LILYPONDBOOK, and TEXI2HTML for your system
+# * Create $DOCDIR
+# * Copy version.itexi from somewhere in your Documentation tree
+# (probably Documentation/out) to $DOCDIR
+#
+# Known limitations:
+#
+# * Doesn't use website css files
+# * Bitmap images aren't loaded properly
+#
+
+#
+# Customize the file here
+#
+FROMDIR="$HOME/lilypond"
+DOCDIR="$HOME/lilypond/tempdocs"
+TODIR="$DOCDIR/contributor"
+TEXI2HTML="texi2html"
+REFCHECK="$FROMDIR/scripts/auxiliar/ref_check.py"
+
+NAME=$1
+
+if test ! -d $TODIR; then
+ mkdir $TODIR
+fi
+if test ! -d $TODIR/out; then
+ mkdir $TODIR/out
+fi
+
+cp $FROMDIR/Documentation/common-macros.itexi $TODIR/common-macros.itexi
+cp $FROMDIR/Documentation/macros.itexi $DOCDIR/macros.itexi
+cp $DOCDIR/version.itexi $TODIR/version.itexi
+
+if test -e $TODIR/$NAME.html; then
+ rm $TODIR/$NAME.html
+fi
+
+if test -e $TODIR/out/$NAME.texi; then
+ rm $TODIR/out/$NAME.texi
+fi
+
+echo Running RefCheck
+python $REFCHECK
+
+cd $DOCDIR
+echo Running texi2html
+cat $DOCDIR/macros.itexi $FROMDIR/Documentation/contributor/$NAME.itexi > $TODIR/$NAME.texi
+$TEXI2HTML \
+ --no-validate \
+ --output=$TODIR/out/$NAME.html \
+ --I=$FROMDIR/Documentation \
+ --I=$TODIR/out \
+ $TODIR/$NAME.texi
+
+read -p "delete files? (y/n): "
+if [ "$REPLY" = "y" ]; then
+ echo "deleting files"
+ rm -rf $TODIR
+fi
#
# * Doesn't use website css files
# * Bitmap images aren't loaded properly
-# * Won't build Contributors' Guide
+# * Won't build Contributors' Guide; see scripts/auxiliar/cg-section.sh
#
#