]> git.donarmstrong.com Git - lilypond.git/commitdiff
Use doctitle header field of LSR snippets
authorJohn Mandereau <john.mandereau@gmail.com>
Thu, 8 May 2008 22:03:41 +0000 (00:03 +0200)
committerJohn Mandereau <john.mandereau@gmail.com>
Thu, 8 May 2008 22:03:41 +0000 (00:03 +0200)
* add and document [doctitle] lilypond-book fragment option,

* define @lydoctitle macro in the proper places,

* test this new feature in NR Pitches,

* update makefiles accordingly,

* thinko: also document texidocLANG feature,

* misc: try to fix 'make clean' in Documentation/user and input/lsr
with `.SECONDARY:'.

Documentation/de/user/macros.itexi
Documentation/es/user/macros.itexi
Documentation/fr/user/macros.itexi
Documentation/user/GNUmakefile
Documentation/user/lilypond-book.itely
Documentation/user/macros.itexi
Documentation/user/pitches.itely
input/lsr/GNUmakefile
input/lsr/lilypond-snippets.tely
make/lilypond-vars.make
scripts/lilypond-book.py

index 9177b8399caa12a49751435817b197437a641c94..c76439b9dff7cb39b3f6fea45ebdb018e5ac1aa5 100644 (file)
 @code{\TEXT\}@c should use internalsref
 @end macro
 
+@macro lydoctitle {TEXT}
+@emph{\TEXT\}
+
+@end macro
 
 @macro funindex {TEXT}
 @findex \TEXT\
index 508870ed618261feaff6698b08d14a2978f13bf7..33ceb7c5cf2c0f7fc257223882e2d2d574ea9729 100644 (file)
 @code{\TEXT\}
 @end macro
 
+@macro lydoctitle {TEXT}
+@emph{\TEXT\}
+
+@end macro
+
 @macro funindex {TEXT}
 @findex \TEXT\
 @kindex \TEXT\
index 06f0974a96ef86829203c08a439e4084a6827ae6..77ec3accfb2298a2efc916320c41b0ace7b69ba1 100644 (file)
 @code{\TEXT\}
 @end macro
 
+@macro lydoctitle {TEXT}
+@emph{\TEXT\}
+
+@end macro
+
 @macro funindex {TEXT}
 @findex \TEXT\
 @kindex \TEXT\
index c11ad6c3cb954d74a86a3ffecc78620996e428d8..0247f74b1e69445027cc2221f9ceb155cd7c4f10 100644 (file)
@@ -31,7 +31,7 @@ INFO_IMAGES_DIR = lilypond
 DEST_INFO_IMAGES_SUBDIR = Documentation/user
 endif
 
-STEPMAKE_TEMPLATES=tex texinfo omf documentation
+STEPMAKE_TEMPLATES=texinfo omf documentation
 OMF_FILES += $(outdir)/lilypond-internals.html.omf
 
 LOCALSTEPMAKE_TEMPLATES=lilypond ly
@@ -151,3 +151,5 @@ $(outdir)/lilypond-internals.texi: $(LILYPOND_BINARY)
 ## unused
 $(outdir)/interfaces.itexi: dummy
        cd $(outdir) && lilypond $(top-src-dir)/ly/generate-interface-doc
+
+.SECONDARY:
index 4478c0d6cb8a93af87c00d25043989c9e3456a8f..599e2ae36ddaae2abe8abd1450de2b8643661c71 100644 (file)
@@ -700,6 +700,13 @@ lilypond-book --process="lilypond --format=tex --tex \
 Most LilyPond test documents (in the @file{input} directory of the
 distribution) are small @file{.ly} files which look exactly like this.
 
+For localization purpose, if the Texinfo document contains
+@code{@@documentlanguage @var{LANG}} and @file{foo@/.ly} header
+contains a @code{texidoc@var{LANG}} field, and if @command{lilypond}
+is called with @option{--header=@/texidoc@var{LANG}}, then
+@file{foo@/.texidoc@var{LANG}} will be included instead of
+@file{foo@/.texidoc}.
+
 @item lilyquote
 (Only for Texinfo output.)  This option is similar to quote, but only
 the music snippet (and the optional verbatim block implied by
@@ -707,6 +714,19 @@ the music snippet (and the optional verbatim block implied by
 useful if you want to @code{quote} the music snippet but not the
 @code{texidoc} documentation block.
 
+@item doctitle
+(Only for Texinfo output.) This option works similarly to
+@code{texidoc} option: if @command{lilypond} is called with the
+@option{--header=@/doctitle} option, and the file to be processed is
+called @file{foo@/.ly} and contains a @code{doctitle} field in the
+@code{\header}, it creates a file @file{foo@/.doctitle}.  When
+@code{doctitle} option is used, the contents of @file{foo@/.doctitle},
+which should be a single line of @var{text}, is inserted in the
+Texinfo document as @code{@@lydoctitle @var{text}}.
+@code{@@lydoctitle} should be a macro defined in the Texinfo document.
+The same remark about @code{texidoc} processing with localized
+languages also applies to @code{doctitle}.
+
 @item printfilename
 If a LilyPond input file is included with @code{\lilypondfile}, print
 the file name right before the music snippet.  For HTML output, this
index 8a47b637cf21fceebfe810c7269e4af150725c73..0706c522395fb126c74c117f3516466b84c64461 100644 (file)
 
 @end macro
 
+@macro lydoctitle {TEXT}
+@emph{\TEXT\}
+
+@end macro
+
 @macro funindex {TEXT}
 @findex \TEXT\
 @kindex \TEXT\
@@ -347,5 +352,3 @@ program usage manual, @ref{\TEXT\,,,lilypond-program,Application Usage}
 
 @end iftex
 
-
-@c EOF
index be22529c7b6a2e65e42d80c42c47dd9f722d5023..cd5d06d6c3182b9eaeb52d55b80704bd97f5ca9e 100644 (file)
@@ -322,7 +322,7 @@ cis
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {preventing-extra-naturals-from-being-automatically-added.ly}
 
 @seealso
@@ -648,7 +648,7 @@ see @ref{Instrument transpositions}.
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
 
 
@@ -788,7 +788,7 @@ c2 c
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {tweaking-clef-properties.ly}
 
 
@@ -859,10 +859,10 @@ fis
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {non-traditional-key-signatures.ly}
 
 
@@ -914,7 +914,7 @@ The @code{set-octavation} function also takes -1 (for 8va bassa),
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {ottava-text.ly}
 
 
@@ -1721,7 +1721,7 @@ musicB = {
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
 
 
@@ -1793,10 +1793,10 @@ printed if they are not part of the key signature.
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {adding-ambitus-per-voice.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {ambitus-with-multiple-voices.ly}
 
 
@@ -1984,7 +1984,7 @@ the base of the scale is determined by the @code{\key} command.
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {applying-note-head-styles-depending-on-the-step-of-the-scale.ly}
 
 @noindent
index 6103529167235c044e940caf8f4824977fad3826..eacbcb922006ffe6ff457aac10c26537383e5548 100644 (file)
@@ -2,10 +2,12 @@ depth = ../..
 
 # urg, can't name itely templates foo.itely.in because of standard rule
 
-STEPMAKE_TEMPLATES=documentation texinfo tex
+STEPMAKE_TEMPLATES=documentation texinfo
 LOCALSTEPMAKE_TEMPLATES=lilypond ly
 EXTRA_DIST_FILES += README $(call src-wildcard,*.snippet-list)
 
+default:
+
 ifneq ($(out),)
 MAIN_INFO_DOC = lilypond-snippets
 INFO_DOCS = lilypond-snippets
@@ -14,15 +16,13 @@ INFO_IMAGES_DIR = lilypond-snippets
 DEST_INFO_IMAGES_SUBDIR = input/lsr
 endif
 
-default:
-
 include $(depth)/make/stepmake.make
 
 IN_ITELY_FILES = $(call src-wildcard,*-intro.itely)
 GENERATED_ITELY_FILES = $(IN_ITELY_FILES:%-intro.itely=$(outdir)/%.itely)
 
 $(outdir)/%.itely: %-intro.itely %.snippet-list
-       xargs $(PYTHON) $(buildscript-dir)/lys-to-tely.py -f printfilename,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
+       xargs $(PYTHON) $(buildscript-dir)/lys-to-tely.py -f doctitle,texidoc,verbatim --name=$@ --template=$< < $(filter %.snippet-list, $^)
 
 $(outdir)/lilypond-snippets.texi: $(GENERATED_ITELY_FILES) $(LY_FILES)
 
@@ -60,3 +60,5 @@ local-WWW: info $(outdir)/lilypond-snippets.pdf \
   $(outdir)/lilypond-snippets/index.html \
   $(outdir)/lilypond-snippets-big-page.html \
   $(source-links)
+
+.SECONDARY:
index 538988e13c804ca5f31281a964c370a8c98daf63..b1c28b2af8503668778863108dd2cd3458a5a7c8 100644 (file)
 
 @include version.itexi
 
+@macro lydoctitle{TEXT}
+@section \TEXT\
+@end macro
+
 @dircategory GNU LilyPond --- the music typesetter
 @direntry
 * LilyPond Snippets: (lilypond-snippets).       Short tricks, tips, and examples.
index 07828e6a9fd9ac21e3af7ace6cdb4fc7d9863667..c26b1d4219a145d4d33d7c1bfd23d0d22d106dbe 100644 (file)
@@ -32,12 +32,15 @@ LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-
 ANTI_ALIAS_FACTOR=2
 LILYPOND_JOBS=$(if $(CPU_COUNT),-djob-count=$(CPU_COUNT),)
 LANG_TEXIDOC_FLAGS:=$(foreach lang,$(LANGS),--header=texidoc$(lang))
+LANG_DOCTITLE_FLAGS:=$(foreach lang,$(LANGS),--header=doctitle$(lang))
 
 LILYPOND_BOOK_LILYPOND_FLAGS=-dbackend=eps \
 --formats=ps,png,pdf \
 $(LILYPOND_JOBS) \
 -dinclude-eps-fonts \
 -dgs-load-fonts \
+--header=doctitle \
+$(LANG_DOCTITLE_FLAGS) \
 --header=texidoc \
 $(LANG_TEXIDOC_FLAGS) \
 -I $(top-src-dir)/input/manual \
index f10e07c172633f19c4d273ee4c895a11f3a5fc1f..92618ec52e992339587d2acad49b57790f1cbb76 100644 (file)
@@ -247,6 +247,7 @@ QUOTE = 'quote'
 RAGGED_RIGHT = 'ragged-right'
 RELATIVE = 'relative'
 STAFFSIZE = 'staffsize'
+DOCTITLE = 'doctitle'
 TEXIDOC = 'texidoc'
 TEXINFO = 'texinfo'
 VERBATIM = 'verbatim'
@@ -533,6 +534,7 @@ simple_options = [
     NOFRAGMENT,
     NOINDENT,
     PRINTFILENAME,
+    DOCTITLE,
     TEXIDOC,
     LANG,
     VERBATIM,
@@ -1206,10 +1208,14 @@ class LilypondSnippet (Snippet):
         map (consider_file, [base + '.tex',
                              base + '.eps',
                              base + '.texidoc',
-                             base + '.texidoc' + document_language,
+                             base + '.doctitle',
                              base + '-systems.texi',
                              base + '-systems.tex',
                              base + '-systems.pdftexi'])
+        if document_language:
+            map (consider_file,
+                 [base + '.texidoc' + document_language,
+                  base + '.doctitle' + document_language])
 
         # UGH - junk global_options
         if (base + '.eps' in result and self.format in (HTML, TEXINFO)
@@ -1352,6 +1358,13 @@ class LilypondSnippet (Snippet):
     def output_texinfo (self):
         str = self.output_print_filename (TEXINFO)
         base = self.basename ()
+        if DOCTITLE in self.option_dict:
+            doctitle = base + '.doctitle'
+            translated_doctitle = doctitle + document_language
+            if os.path.exists (translated_doctitle):
+                str += '@lydoctitle %s\n' % open (translated_doctitle).read ()
+            elif os.path.exists (doctitle):
+                str += '@lydoctitle %s\n' % open (doctitle).read ()
         if TEXIDOC in self.option_dict:
             texidoc = base + '.texidoc'
             translated_texidoc = texidoc + document_language