From: Carl Sorensen Date: Wed, 18 Aug 2010 16:00:59 +0000 (-0600) Subject: Add scripts/auxiliar/cg-section.sh plus documentation X-Git-Tag: release/2.13.31-1~45 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=495f76d0be91b16b708318936759189df9f5f266;p=lilypond.git Add scripts/auxiliar/cg-section.sh plus documentation --- 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/cg-section.sh b/scripts/auxiliar/cg-section.sh new file mode 100755 index 0000000000..272260c3c9 --- /dev/null +++ b/scripts/auxiliar/cg-section.sh @@ -0,0 +1,73 @@ +#!/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 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 # #