]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix Info documentation with images
authorJohn Mandereau <john.mandereau@gmail.com>
Fri, 13 Mar 2009 07:40:09 +0000 (08:40 +0100)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 17 Jul 2009 09:05:21 +0000 (02:05 -0700)
This patch mainly applies suggestions from David Kastrup and Jan.

* fix symlinks creation from prefix/share/info to
prefix/share/doc/lilypond, enable it even when installing in
nonstandard prefix, and clean it up in the makefiles,

* add info and info-install toplevel targets,

* improve documentation (make help, stdout prints and Application
  Usage),

* fix flats graphics in Introduction for Info format.
(cherry picked from commit 0c9af42587ceac7e72290435164f6a9394250c66)

Documentation/user/compile.itely
Documentation/user/introduction.itely
GNUmakefile.in
scripts/build/relative.py
stepmake/stepmake/generic-vars.make
stepmake/stepmake/texinfo-rules.make
stepmake/stepmake/texinfo-targets.make
stepmake/stepmake/toplevel-targets.make

index 15227251bd15057f4b218eb759ebd54754521b44..5ceaa5772069a310e99866e8964eb18aaaf188fa 100644 (file)
@@ -230,8 +230,8 @@ make web
 After compilation, the HTML documentation tree is available in
 @file{out-www/offline-root/}, and can be browsed locally.
 
-The HTML and PDF files can be installed into the standard documentation
-path by issuing
+The HTML, PDF and if available Info files can be installed into the
+standard documentation path by issuing
 
 @example
 make web-install
@@ -239,13 +239,34 @@ make web-install
 
 @noindent
 This also installs Info documentation with images if the installation
-prefix is properly set; otherwise, instructions for manual installation
-of Info documentation are printed on standard output.
+prefix is properly set; otherwise, instructions to complete proper
+installation of Info documentation are printed on standard output.
 
-It is also possible to build a documentation tree in
-@file{out-www/online-root/}, with special processing, so it can be used
-on a website with content negotiation for automatic language selection;
-this can be achieved by issuing
+Compilation of documentation in Info format with images can be done
+separately by issuing
+
+@example
+make info
+@end example
+
+@noindent
+Separate installation of this documentation is done by issuing
+
+@example
+make info-install
+@end example
+
+@noindent
+Note that to get the images in Info documentation, @code{web-install}
+target creates symbolic links to HTML and PDF installed documentation
+tree in @file{@var{prefix}/share/info}, in order to save disk space,
+whereas @code{info-install} copies images in
+@file{@var{prefix}/share/info} subdirectories.
+
+It is possible to build a documentation tree in
+@file{out-www/online-root/}, with special processing, so it can be
+used on a website with content negotiation for automatic language
+selection; this can be achieved by issuing
 
 @example
 make WEB_TARGETS=online web
@@ -269,12 +290,14 @@ make help
 @noindent
 from every directory in the build tree.  Most targets for
 documentation maintenance are available from @file{Documentation/};
-for more information, see @file{Documentation/user/README.txt} and
-@file{Documentation/TRANSLATION}.
+@c FIXME: xref to CG
+for more information, see the Contributors' Guide, section
+@emph{Documentation work}.
 
 The makefile variable @code{QUIET_BUILD} may be set to @code{1} for a
 less verbose build output, just like for building the programs.
 
+
 @knownissues
 
 The most time consuming task for building the documentation is running
index a27db04c1015b40c4f191221812928c382a1aa1d..b031f13ab38a9c69dc754729aa99f07167cf4271 100644 (file)
@@ -109,8 +109,8 @@ much thicker than lines in the computer edition.
 @end ifnottex
 @end ifnotinfo
 @ifinfo
-@image{lilypond/henle-flat-bw,,,png} @image{lilypond/baer-flat-bw,,,png}
-@image{lilypond/lily-flat-bw,,,png}
+@image{lilypond/henle-flat-bw,,,,png} @image{lilypond/baer-flat-bw,,,,png}
+@image{lilypond/lily-flat-bw,,,,png}
 @end ifinfo
 
 @item @tab
index 1039ff32320b8ab29bd07b71e39326a76c5cde55..aee8bfe20b0a9cb2f6c9903ff4a6b9e6211547e6 100644 (file)
@@ -74,6 +74,12 @@ dist-toplevel-txt-files: do-top-doc
 doc: 
        $(MAKE) -C Documentation
 
+info:
+       $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) out=www info && ) true
+
+info-install: info
+       $(MAKE) out=www COPY_INFO_IMAGES=1 install-info-WWW
+
 install-help2man:
        $(MAKE) -C scripts man install-help2man
        $(MAKE) -C lily man install-help2man
@@ -85,10 +91,7 @@ install-WWW:
        rsync -rl --exclude='*.signature' $(outdir)/offline-root/ $(DESTDIR)$(webdir)
 
 install-info-WWW:
-       $(MAKE) -C Documentation/user install-info
-       $(MAKE) -C input/lsr install-info
-       (cd $(DESTDIR)$(infodir) && rm -f lilypond && ln -sf $$($(PYTHON) $(buildscript-dir)/relative $(DESTDIR)$(webdir)/Documentation/user) lilypond)
-       (cd $(DESTDIR)$(infodir) && rm -f lilypond-snippets && ln -sf $$($(PYTHON) $(buildscript-dir)/relative $(DESTDIR)$(webdir)/input/lsr) lilypond-snippets)
+       $(foreach d, $(INFO_DIRECTORIES),$(MAKE) -C $(d) install-info && ) true
 
 web-install:
        $(MAKE) out=www install-WWW
index cb1da88433aa45c24f836c625aec8a500ed15508..f62e7a80a2382ded865628e73d1f71421bdf64c0 100755 (executable)
@@ -10,7 +10,7 @@ def relative (dir, r=os.getcwd ()):
     if prefix == len (dir):
         return './'
     if prefix > 1:
-        return '../' * len (r[prefix:].split ('/')) + dir[prefix:]
+        return '../' * (len (r[prefix:].split ('/')) - 1) + dir[prefix:]
     return dir
 
 if __name__ == '__main__':
index 31c81d20180ddb27c6c74c7dcf71003c45389d45..f4c843649447decd4e82c8a5d1ca19550cf40f46 100644 (file)
@@ -69,6 +69,9 @@ endif
 LANG=
 export LANG
 
+
+INFO_DIRECTORIES = Documentation/user input/lsr
+
 # clean file lists:
 #
 ERROR_LOG = 2> /dev/null
index 3f605b2a28388f1694f349205bbbf044c3e9d816..351a1cc2d8a639754c8e1b43dea50efd5dec1cdf 100644 (file)
@@ -34,7 +34,7 @@ $(outdir)/%.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version
        $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $<
        cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
 
-$(outdir)/%/index.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi
+$(outdir)/%/index.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi $(outdir)/%.html.omf
        mkdir -p $(dir $@)
        $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
        cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@)
@@ -46,10 +46,7 @@ $(outdir)/%.html.omf: %.texi
 $(outdir)/%.pdf.omf: %.texi
        $(call GENERATE_OMF,pdf)
 
-$(outdir)/%.ps.gz.omf: %.texi
-       $(call GENERATE_OMF,ps.gz)
-
-$(outdir)/%.pdf: $(outdir)/%.texi $(outdir)/version.itexi
+$(outdir)/%.pdf: $(outdir)/%.texi $(outdir)/version.itexi $(outdir)/%.pdf.omf
        cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) -I $(abs-src-dir) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
 
 $(outdir)/%.txt: $(outdir)/%.texi $(outdir)/version.itexi
index 6754b77f5fe389bacd8ad48f64406e54e2c58dc4..e9cbf16aec7a1f91c5a2b85550c52de187985a5f 100644 (file)
@@ -31,25 +31,43 @@ ifeq ($(out),www)
 # This builds all .info targets with images, in out-www.
 # Viewable with a recent Emacs, doing: C-u C-h i out-www/lilypond.info
 
+ifneq ($(COPY_INFO_IMAGES),)
+# only Info docs are installed (not HTML nor PDF),
+# so images should be copied
+
+install-info-images:
+# remove $(infodir)/$(INFO_IMAGES_DIR) in case it is a symlink
+       -rm -f $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+       $(INSTALL) -d $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+       rsync -r --include '[0-9a-f][0-9a-f]' --include '*.png' --exclude '*' $(outdir)/ $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)/
+
+uninstall-info-images:
+       rm -f $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR) || rm -rf $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+
+else # if HTML and PDF docs are installed too, symlink image directories
+install-info-images: uninstall-info-images
+       cd $(DESTDIR)$(infodir) && ln -sf $$($(PYTHON) $(buildscript-dir)/relative $(DESTDIR)$(webdir)/$(DEST_INFO_IMAGES_SUBDIR)) $(INFO_IMAGES_DIR)
+
+uninstall-info-images:
+       rm -f $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR) || rm -rf $(DESTDIR)$(infodir)/$(INFO_IMAGES_DIR)
+endif # copying info images
+
+
 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
-## Can not have absolute symlinks because some binary packages build schemes
-## install files in nonstandard root.  Best we can do is to notify the
-## builder or packager.
+## install-info can't do all his job for binary packages build systems.
+## Best we can do is to notify the builder or packager.
 local-install-info: info
        -$(INSTALL) -d $(DESTDIR)$(infodir)
        @echo
        @echo "***************************************************************"
-       @echo "Please add or update the LilyPond direntries, do"
-       @echo
-       @echo "    install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info"
-       @echo
-       @echo "For images in the INFO docs to work, do: "
+       @echo "Please add or update the LilyPond direntries,"
+       @echo "do or add in the postinstall script"
        @echo
-       @echo "    (cd $(infodir) && ln -sfT ../doc/lilypond/html/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR))"
-       @echo "or add something like that to the postinstall script."
+       @echo "    install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$(MAIN_INFO_DOC).info"
        @echo
+       $(MAKE) install-info-images
 
-local-uninstall-info:
+local-uninstall-info: uninstall-info-images
        -rmdir $(DESTDIR)$(infodir)
 
 else # installing directly into standard /usr/...
@@ -57,33 +75,28 @@ local-install-info: info
        -$(INSTALL) -d $(DESTDIR)$(infodir)
        $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
        install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
-       cd $(infodir) && ln -sfT $(webdir)/$(DEST_INFO_IMAGES_SUBDIR) $(INFO_IMAGES_DIR)
+       $(MAKE) install-info-images
 
-local-uninstall-info:
+local-uninstall-info: uninstall-info-images
        $(foreach f,$(INFO_FILES),install-info --remove --info-dir=$(infodir) $(f) ; )true
-       rm -f $(infodir)/$(INFO_IMAGES_DIR)
 
 endif # installing directly into standard /usr/...
 
 else # out!=www
 
 ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
-## Can not have absolute symlinks because some binary packages build schemes
-## install files in nonstandard root.  Best we can do is to notify the
-## builder or packager.
+## install-info can't do all his job for binary packages build systems.
+## Best we can do is to notify the builder or packager.
 local-install-info: info
        -$(INSTALL) -d $(DESTDIR)$(infodir)
        @echo
        @echo "***************************************************************"
        @echo "Please add or update the LilyPond direntries, do"
        @echo
-       @echo "    install-info --info-dir=$(infodir) out/$(MAIN_INFO_DOC).info"
-       @echo
-       @echo "For images in the INFO docs to work, do"
+       @echo "    install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$(MAIN_INFO_DOC).info"
        @echo
-       @echo "    make out=www install-info "
-       @echo
-       @echo "and read the extra instructions."
+       @echo "To compile Info documentation with images, please read"
+       @echo "Application Usage document, section \"Building documentation\"."
        @echo
 
 local-uninstall-info:
@@ -96,9 +109,19 @@ local-install-info: info
        install-info --info-dir=$(infodir) $(outdir)/$(MAIN_INFO_DOC).info
        @echo
        @echo "***************************************************************"
-       @echo "For images in the INFO docs to work, do"
+       @echo "To compile Info documentation with images, do from top of the build tree"
+       @echo
+       @echo "    make web"
+       @echo
+       @echo "which builds documentation in all formats; to build only Info documentation, do"
+       @echo
+       @echo "    make info"
+       @echo
+       @echo "To list all available targets, do"
+       @echo
+       @echo "    make help"
        @echo
-       @echo "    make out=www install-info "
+       @echo "For details, please read Application Usage document, section \"Building documentation\"."
        @echo
 
 local-uninstall-info:
index a9f8909fa6a53ad48856873c980d2584e98dae24..cc4a156e1ae7e8b5726b18b2625a62a1c1ad9109 100644 (file)
@@ -60,6 +60,8 @@ local-help:
   dist        roll tarball: $(depth)/$(outdir)/$(distname).tar.gz\n\
   distclean   also remove configure output\n\
   doc         update all documentation (without images)\n\
+  info        build Info documentation with images\n\
+  info-install  install Info documentation with images\n\
   cvs-clean   also remove out directories and generated files\n\
   maintainerclean also remove distributed generated files\n\
   po          make new translation Portable Object database\n\