This is intended to quickly compile a section
of the manuals as a check during doc editing,
but parts of it were broken. This patch returns
it to a usable state.
- fix help
- automatically invoke browser to view output
- add choice of browser
- fix pictures
- re-implement option to delete or retain
temp files
-Usage: $0 MANUAL SECTION
+Usage: $0 MANUAL SECTION
-if [ "$1" == '-h' ] || [ "$1" == '--help' ]; then
+if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
echo "\$LILYPOND_GIT was not set; auto-detected source tree at $LILYPOND_GIT"
fi
echo "\$LILYPOND_GIT was not set; auto-detected source tree at $LILYPOND_GIT"
fi
+if [ -n "$BROWSER" ]; then
+ echo "Using browser from \$BROWSER: $BROWSER"
+else
+ echo "\$BROWSER not set; using firefox as default"
+ BROWSER="firefox"
+fi
+
if test ! -e "$LILYPOND_GIT/DEDICATION"; then
echo "Error: $LILYPOND_GIT did not look like a LilyPond source tree; aborting." >&2
exit 1
if test ! -e "$LILYPOND_GIT/DEDICATION"; then
echo "Error: $LILYPOND_GIT did not look like a LilyPond source tree; aborting." >&2
exit 1
cp "$LILYPOND_GIT/Documentation/common-macros.itexi" "$OUTPUT_DIR/common-macros.itexi"
cp "$LILYPOND_GIT/Documentation/macros.itexi" "$DOC_DIR/macros.itexi"
cp "$DOC_DIR/version.itexi" "$OUTPUT_DIR/version.itexi"
cp "$LILYPOND_GIT/Documentation/common-macros.itexi" "$OUTPUT_DIR/common-macros.itexi"
cp "$LILYPOND_GIT/Documentation/macros.itexi" "$DOC_DIR/macros.itexi"
cp "$DOC_DIR/version.itexi" "$OUTPUT_DIR/version.itexi"
+cp -r "$LILYPOND_GIT/Documentation/pictures/" "$OUTPUT_DIR/out/pictures"
if test -e "$OUTPUT_DIR/$SECTION.html"; then
rm "$OUTPUT_DIR/$SECTION.html"
if test -e "$OUTPUT_DIR/$SECTION.html"; then
rm "$OUTPUT_DIR/$SECTION.html"
"$OUTPUT_DIR/$SECTION.texi"
fi
"$OUTPUT_DIR/$SECTION.texi"
fi
+echo "Displaying output in $BROWSER; close browser window when done."
-The $SECTION section of the $MANUAL manual should now be viewable at
+$BROWSER $OUTPUT_DIR/out/$SECTION.html
- $OUTPUT_DIR/out/$SECTION.html
-If you want to keep the generated docs around for a while, answer
-'n' to the next question. If you only needed them to quickly check
-something, view them now and then answer 'y' when you're done.
+If you want to avoid recompiling the snippets on the next
+invocation with '$MANUAL $SECTION', answer 'n' to the next question.
-read -p "rm -rf $OUTPUT_DIR ? (y/n): "
+echo "Delete temp files? [y/n]"
+read REPLY;
if [ "$REPLY" = "y" ]; then
echo "deleting files"
rm -rf "$OUTPUT_DIR"
if [ "$REPLY" = "y" ]; then
echo "deleting files"
rm -rf "$OUTPUT_DIR"