From 495f76d0be91b16b708318936759189df9f5f266 Mon Sep 17 00:00:00 2001 From: Carl Sorensen Date: Wed, 18 Aug 2010 10:00:59 -0600 Subject: [PATCH] Add scripts/auxiliar/cg-section.sh plus documentation --- Documentation/contributor/doc-work.itexi | 59 ++++++++++++++++++++++ scripts/auxiliar/{doc-section.sh => cg-section.sh} | 53 ++++++------------- scripts/auxiliar/doc-section.sh | 2 +- 3 files changed, 75 insertions(+), 39 deletions(-) copy scripts/auxiliar/{doc-section.sh => cg-section.sh} (51%) diff --git a/Documentation/contributor/doc-work.itexi b/Documentation/contributor/doc-work.itexi index 6a9d0e0d2e..b866f2c966 100644 --- a/Documentation/contributor/doc-work.itexi +++ b/Documentation/contributor/doc-work.itexi @@ -1294,6 +1294,65 @@ the difficulty. @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 diff --git a/scripts/auxiliar/doc-section.sh b/scripts/auxiliar/cg-section.sh similarity index 51% copy from scripts/auxiliar/doc-section.sh copy to scripts/auxiliar/cg-section.sh index 94c45d4a67..272260c3c9 100755 --- a/scripts/auxiliar/doc-section.sh +++ b/scripts/auxiliar/cg-section.sh @@ -1,16 +1,13 @@ #!/bin/sh -# Build html versions of sections of lilypond documentation +# Build html versions of sections of lilypond Contributors' Guide # -# Usage: doc-section.sh MANUAL SECTION +# Usage: cg-section.sh SECTION # -# where MANUAL is the manual and SECTION is the section to be built. +# where SECTION is the section to be built. # -# For example, NR 1.2 would be built by -# doc-section.sh notation rhythms -# -# and LM 1 would be built by -# doc-section.sh learning tutorial +# 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 # @@ -24,7 +21,6 @@ # # * Doesn't use website css files # * Bitmap images aren't loaded properly -# * Won't build Contributors' Guide # # @@ -32,13 +28,11 @@ # FROMDIR="$HOME/lilypond" DOCDIR="$HOME/lilypond/tempdocs" -TODIR=$DOCDIR/$NAME -LILYPONDBOOK="lilypond-book" +TODIR="$DOCDIR/contributor" TEXI2HTML="texi2html" REFCHECK="$FROMDIR/scripts/auxiliar/ref_check.py" -DIRECTORY=$1 -NAME=$2 +NAME=$1 if test ! -d $TODIR; then mkdir $TODIR @@ -59,35 +53,18 @@ if test -e $TODIR/out/$NAME.texi; then rm $TODIR/out/$NAME.texi fi -echo "Running lilypond-book" -$LILYPONDBOOK \ - -f texi-html \ - -I $FROMDIR/Documentation/snippets \ - -I $FROMDIR/Documentation/snippets/new \ - -I $FROMDIR/input/manual \ - -I $FROMDIR/Documentation \ - -I $FROMDIR/Documentation/included \ - -o $TODIR/out \ - $FROMDIR/Documentation/$DIRECTORY/$NAME.itely -BOOKRC=$? -if [ $BOOKRC != 0 ]; then - echo "Lilypond-book returned code $BOOKRC" - exit $BOOKRC -fi - echo Running RefCheck python $REFCHECK cd $DOCDIR -if test -f $TODIR/out/$NAME.texi; then - echo Running texi2html - cat $DOCDIR/macros.itexi $TODIR/out/$NAME.texi > $TODIR/$NAME.texi - $TEXI2HTML \ - --no-validate \ - --output=$TODIR/out/$NAME.html \ - --I=$TODIR/out \ - $TODIR/$NAME.texi -fi +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 diff --git a/scripts/auxiliar/doc-section.sh b/scripts/auxiliar/doc-section.sh index 94c45d4a67..2957db5b38 100755 --- a/scripts/auxiliar/doc-section.sh +++ b/scripts/auxiliar/doc-section.sh @@ -24,7 +24,7 @@ # # * 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 # # -- 2.11.4.GIT