]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into dev...
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 9 May 2008 17:00:26 +0000 (19:00 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 9 May 2008 17:00:26 +0000 (19:00 +0200)
Conflicts:

buildscripts/html-gettext.py
buildscripts/www_post.py
input/lsr/editorial-and-educational-use-intro.itely
make/doclang-rules.make
python/langdefs.py
stepmake/stepmake/texinfo-rules.make

1  2 
buildscripts/add_html_footer.py
buildscripts/html-gettext.py
buildscripts/www_post.py
input/lsr/lilypond-snippets.tely
make/doclang-rules.make
scm/documentation-generate.scm
scm/documentation-lib.scm
stepmake/stepmake/texinfo-rules.make

index addf3c7d7a6c3f5a4114d94ff35d60cda97671e5,00b48dc6ba5a5accfa490974419c33e396f0c077..5a459784825f1d1bf0955a07b05f75df67a52677
@@@ -6,7 -6,6 +6,7 @@@ Print a nice footer
  import re
  import os
  import time
 +import operator
  
  import langdefs
  
@@@ -51,10 -50,7 +51,10 @@@ mail_address = 'http://post.gmane.org/p
  suggest_Docs_url = 'http://lilypond.org/web/devel/participating/documentation-adding'
  
  header_tag = '<!-- header_tag -->'
 +header_tag_re = re.compile (header_tag)
 +
  footer_tag = '<!-- footer_tag -->'
 +footer_tag_re = re.compile (footer_tag)
  
  lang_available = _doc ("Other languages: %s.")
  browser_lang = _doc ('About <A HREF="%s">automatic language selection</A>.')
@@@ -83,7 -79,7 +83,7 @@@ def build_pages_dict (filelist)
                  e = ''
              else:
                  e = g[1]
-             if not g[0] in pages_dict.keys():
+             if not g[0] in pages_dict:
                  pages_dict[g[0]] = [e]
              else:
                  pages_dict[g[0]].append (e)
@@@ -94,9 -90,6 +94,9 @@@ def source_links_replace (m, source_val
  splitted_docs_re = re.compile ('(input/lsr/out-www/lilypond-snippets|Documentation/user/out-www/(lilypond|music-glossary|lilypond-program|lilypond-learning))/')
  
  snippets_ref_re = re.compile (r'href="(\.\./)?lilypond-snippets')
 +# TODO: master has ../lily- !
 +src_href_re = re.compile ('(href|src)="(lily-.*?|.*?[.]png)"')
 +source_link_re = re.compile ('href="source/(.*?)"')
  
  ## Windows does not support symlinks.
  # This function avoids creating symlinks for splitted HTML manuals
  # this also fixes missing PNGs only present in translated docs
  def hack_urls (s, prefix):
      if splitted_docs_re.match (prefix):
 -        s = re.sub ('(href|src)="(../lily-.*?|.*?[.]png)"', '\\1="../\\2"', s)
 +        s = src_href_re.sub ('\\1="../\\2"', s)
  
      # fix Snippets xrefs ad hoc
      s = snippets_ref_re.sub ('href="source/input/lsr/lilypond-snippets', s)
      if not os.path.islink (source_path):
          return s
      source_val = os.readlink (source_path)
 -    return re.sub ('href="source/(.*?)"', lambda m: source_links_replace (m, source_val), s)
 +    return source_link_re.sub (lambda m: source_links_replace (m, source_val), s)
 +
 +body_tag_re = re.compile ('(?i)<body([^>]*)>')
 +html_tag_re = re.compile ('(?i)<html>')
 +doctype_re = re.compile ('(?i)<!DOCTYPE')
 +doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n'
  
  def add_header (s):
 -    """Add header (<BODY> and doctype)"""
 -    if re.search (header_tag, s) == None:
 -        body = '<BODY BGCOLOR=WHITE TEXT=BLACK>'
 -        s = re.sub ('(?i)<body>', body, s)
 -        if re.search ('(?i)<BODY', s):
 -            s = re.sub ('(?i)<body[^>]*>', body + header, s, 1)
 -        elif re.search ('(?i)<html', s):
 -            s = re.sub ('(?i)<html>', '<HTML>' + header, s, 1)
 -        else:
 -            s = header + s
 +    """Add header (<body> and doctype)"""
 +    if header_tag_re.search (s) == None:
 +        body = '<body bgcolor="white" text="black" \\1>'
 +        (s, n) = body_tag_re.subn (body + header, s, 1)
 +        if not n:
 +            (s, n) = html_tag_re.subn ('<html>' + header, s, 1)
 +            if not n:
 +                s = header + s
  
          s = header_tag + '\n' + s
  
 -        if re.search ('(?i)<!DOCTYPE', s) == None:
 -            doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n'
 +        if doctype_re.search (s) == None:
              s = doctype + s
          return s
  
 +title_tag_re = re.compile ('.*?<title>(.*?)</title>', re.DOTALL)
 +AT_web_title_re = re.compile ('@WEB-TITLE@')
 +
  def add_title (s):
      # urg
      # maybe find first node?
      fallback_web_title = '-- --'
 -    m = re.match ('.*?<title>(.*?)</title>', s, re.DOTALL)
 +    m = title_tag_re.match (s)
      if m:
          fallback_web_title = m.group (1)
 -    s = re.sub ('@WEB-TITLE@', fallback_web_title, s)
 +    s = AT_web_title_re.sub (fallback_web_title, s)
      return s
  
 -info_nav_bar = re.compile (r'<div class="node">\s*<p>\s*<a name=".+?"></a>(.+?)<hr>\s*</div>', re.M | re.S)
 -info_footnote_hr = re.compile (r'<hr>\s*(</div>)?\s*</body>', re.M | re.I)
 +end_body_re = re.compile ('(?i)</body>')
 +end_html_re = re.compile ('(?i)</html>')
  
  def add_footer (s):
 -    """add footer
 -
 -also add navigation bar to bottom of Info HTML pages"""
 -    m = info_nav_bar.search (s)
 -    if m:
 -        # avoid duplicate <hr> in case there are footnotes at the end of the Info HTML page
 -        if info_footnote_hr.search (s):
 -            custom_footer = '<div class="node">\n<p>' + m.group (1) + '</div>\n' + footer
 -        else:
 -            custom_footer = '<br><hr>\n<div class="node">\n<p>' + m.group (1) + '</div>\n' + footer
 -    else:
 -        custom_footer = footer
 -    if re.search ('(?i)</body', s):
 -        s = re.sub ('(?i)</body>', footer_tag + custom_footer + '\n' + '</BODY>', s, 1)
 -    elif re.search ('(?i)</html', s):                
 -        s = re.sub ('(?i)</html>', footer_tag + custom_footer + '\n' + '</HTML>', s, 1)
 -    else:
 -        s += footer_tag + custom_footer + '\n'
 +    """add footer"""
 +    (s, n) = end_body_re.subn (footer_tag + footer + '\n' + '</body>', s, 1)
 +    if not n:
 +        (s, n) = end_html_re.subn (footer_tag + footer + '\n' + '</html>', s, 1)
 +        if not n:
 +            s += footer_tag + footer + '\n'
      return s
  
  def find_translations (prefix, lang_ext):
          if lang_ext != e:
              if e in pages_dict[prefix]:
                  available.append (l)
 -            elif lang_ext == '' and l.enabled and reduce (lambda x, y: x and y, [not prefix.startswith (s) for s in non_copied_pages]):
 +            elif lang_ext == '' and l.enabled and reduce (operator.and_, [not prefix.startswith (s) for s in non_copied_pages]):
                  # English version of missing translated pages will be written
                  missing.append (e)
      return available, missing
  
 +online_links_re = re.compile ('''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html|.png)(#[^"\']*|)[\'"]''')
 +offline_links_re = re.compile ('''href=[\'"]([^/][.]*[^.:\'"]*)(.html)(#[^"\']*|)[\'"]''')
 +
  def process_links (s, prefix, lang_ext, file_name, missing, target):
      page_flavors = {}
      if target == 'online':
          # Strip .html, .png suffix for auto language selection (content
          # negotiation).  The menu must keep the full extension, so do
          # this before adding the menu.
 -        page_flavors[file_name] = [lang_ext, re.sub (
 -            '''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html|.png)(#[^"\']*|)[\'"]''',
 -            '\\1="\\2\\4"', s)]
 +        page_flavors[file_name] = \
 +            [lang_ext, online_links_re.sub ('\\1="\\2\\4"', s)]
      elif target == 'offline':
 -        # in LANG doc index: don't rewrite .html suffixes as not all .LANG.html pages exist
 +        # in LANG doc index: don't rewrite .html suffixes
 +        # as not all .LANG.html pages exist;
          # the doc index should be translated and contain the right links
          if prefix == 'Documentation/out-www/index':
              page_flavors[file_name] = [lang_ext, s]
          elif lang_ext == '':
              page_flavors[file_name] = [lang_ext, s]
              for e in missing:
 -                page_flavors[langdefs.lang_file_name (prefix, e, '.html')] = [e, re.sub (
 -                    '''href=[\'"]([^/][.]*[^.:\'"]*)(.html)(#[^"\']*|)[\'"]''',
 -                    'href="\\1.' + e + '\\2\\3"', s)]
 +                page_flavors[langdefs.lang_file_name (prefix, e, '.html')] = \
 +                    [e, offline_links_re.sub ('href="\\1.' + e + '\\2\\3"', s)]
          else:
 -            page_flavors[file_name] = [lang_ext, re.sub (
 -                '''href=[\'"]([^/][.]*[^.:\'"]*)(.html)(#[^"\']*|)[\'"]''',
 -                'href="\\1.' + lang_ext + '\\2\\3"', s)]
 +            page_flavors[file_name] = \
 +                [lang_ext,
 +                 offline_links_re.sub ('href="\\1.' + lang_ext + '\\2\\3"', s)]
      return page_flavors
  
  def add_menu (page_flavors, prefix, available, target, translation):
-     for k in page_flavors.keys():
+     for k in page_flavors:
          language_menu = ''
          languages = ''
          if page_flavors[k][0] != '':
              language_available = t (lang_available) % language_menu
              languages = LANGUAGES_TEMPLATE % vars ()
          # put language menu before '</body>' and '</html>' tags
 -        if re.search ('(?i)</body', page_flavors[k][1]):
 -            page_flavors[k][1] = re.sub ('(?i)</body>', languages + '</BODY>', page_flavors[k][1], 1)
 -        elif re.search ('(?i)</html', page_flavors[k][1]):
 -            page_flavors[k][1] = re.sub ('(?i)</html>', languages + '</HTML>', page_flavors[k][1], 1)
 -        else:
 -            page_flavors[k][1] += languages
 +        (page_flavors[k][1], n) = end_body_re.subn (languages + '</body>', page_flavors[k][1], 1)
 +        if not n:
 +            (page_flavors[k][1], n) = end_html_re.subn (languages + '</html>', page_flavors[k][1], 1)
 +            if not n:
 +                page_flavors[k][1] += languages
      return page_flavors
  
  
- def add_html_footer (translation,
-                      package_name = '',
+ def add_html_footer (package_name = '',
                       package_version = '',
                       target = 'offline',
                       name_filter = lambda s: s):
      """Add header, footer to a number of HTML files
  
      Arguments:
-      translation               gettext translations dictionary, with language codes as keys
       package_name=NAME         set package_name to NAME
       package_version=VERSION   set package version to VERSION
       targets=offline|online    set page processing depending on the target
              negotiation
       name_filter               a HTML file name filter
      """
+     translation = langdefs.translation
      localtime = time.strftime ('%c %Z', time.localtime (time.time ()))
  
      if re.search ("http://", mail_address):
              s = in_f.read()
              in_f.close()
  
 -            s = re.sub ('%', '%%', s)
 +            s = s.replace ('%', '%%')
              s = hack_urls (s, prefix)
              s = add_header (s)
  
              ### add footer
 -            if re.search (footer_tag, s) == None:
 +            if footer_tag_re.search (s) == None:
                  s = add_footer (s)
                  
                  available, missing = find_translations (prefix, lang_ext)
                  page_flavors = add_menu (page_flavors, prefix, available, target, translation)
              subst = dict ([i for i in globals().items() if type (i[1]) is str])
              subst.update (dict ([i for i in locals().items() if type (i[1]) is str]))
-             for k in page_flavors.keys():
-                 if page_flavors[k][0] in translation.keys():
-                     for name in subst.keys():
+             for k in page_flavors:
+                 if page_flavors[k][0] in translation:
+                     for name in subst:
                          subst[name] = translation[page_flavors[k][0]] (subst[name])
                  subst['footer_name_version'] = subst['footer_name_version'] % subst
                  subst['footer_report_errors'] = subst['footer_report_errors'] % subst
index 7b381349b56fc4cd8a59b66b714382e9c5713ecd,7d32879a4112b0d0e81e1faf9fc6b034c3831854..02a4c947c0220062f9cbe5a6e8db8b759f67656a
@@@ -1,7 -1,7 +1,7 @@@
  #!@PYTHON@
  # html-gettext.py
  
- # USAGE:  html-gettext.py [-o OUTDIR] BUILDSCRIPT-DIR LOCALEDIR LANG FILES
+ # USAGE:  html-gettext.py [-o OUTDIR] LANG FILES
  #
  # -o OUTDIR specifies that output files should be written in OUTDIR
  #    rather than be overwritten
@@@ -11,90 -11,88 +11,88 @@@ import sy
  import re
  import os
  import getopt
- import gettext
+ import langdefs
  
  optlist, args = getopt.getopt(sys.argv[1:],'o:')
- buildscript_dir, localedir, lang = args[0:3]
+ lang = args[0]
+ files = args [1:]
  
  outdir = '.'
  for x in optlist:
-       if x[0] == '-o':
-               outdir = x[1]
- sys.path.append (buildscript_dir)
- import langdefs
+     if x[0] == '-o':
+         outdir = x[1]
  
  double_punct_char_separator = langdefs.LANGDICT[lang].double_punct_char_sep
- t = gettext.translation('lilypond-doc', localedir, [lang])
- my_gettext = t.gettext
+ my_gettext = langdefs.translation[lang]
  
  html_codes = ((' -- ', ' &ndash; '),
-             (' --- ', ' &mdash; '))
+               (' --- ', ' &mdash; '))
  html2texi = {'command': (re.compile (r'<samp><span class="command">(.*?)</span></samp>'), r'@command{\1}'),
-            'code': (re.compile (r'<code>(.*?)</code>'), r'@code{\1}')
-            }
+              'code': (re.compile (r'<code>(.*?)</code>'), r'@code{\1}')
+              }
  texi2html = {'command': (re.compile (r'@command{(.*?)}'), r'<samp><span class="command">\1</span></samp>'),
-            'code': (re.compile (r'@code{(.*?)}'), r'<code>\1</code>')
-            }
+              'code': (re.compile (r'@code{(.*?)}'), r'<code>\1</code>')
+              }
  whitespaces = re.compile (r'\s+')
  
  
  def _ (s):
-       if not s:
-               return ''
-       s = whitespaces.sub (' ', s)
-       for c in html_codes:
-               s = s.replace (c[1], c[0])
-       for u in html2texi.values():
-               s = u[0].sub (u[1], s)
-       s = my_gettext (s)
-       for u in texi2html.values():
-               s = u[0].sub (u[1], s)
-       for c in html_codes:
-               s = s.replace (c[0], c[1])
-       return s
+     if not s:
+         return ''
+     s = whitespaces.sub (' ', s)
+     for c in html_codes:
+         s = s.replace (c[1], c[0])
+     for u in html2texi.values():
+         s = u[0].sub (u[1], s)
+     s = my_gettext (s)
+     for u in texi2html.values():
+         s = u[0].sub (u[1], s)
+     for c in html_codes:
+         s = s.replace (c[0], c[1])
+     return s
  
  def link_gettext (m):
-       return '<link rel="' + m.group(1) + '" ' + m.group(2) + ' title="' + _(m.group(3)) + '">'
+     return '<link rel="' + m.group(1) + '" ' + m.group(2) + ' title="' + _(m.group(3)) + '">'
  
  def title_gettext (m):
-       return '<title>' + _(m.group(1)) + ' - ' + m.group(2) + '</title>'
+     return '<title>' + _(m.group(1)) + ' - ' + m.group(2) + '</title>'
  
  def a_href_gettext (m):
-       s = ''
-       if m.group(0)[-1] == ':':
-               s = double_punct_char_separator + ':'
-       t = ''
-       if m.lastindex == 7:
-               t = m.group(7)
-       return '<a ' + (m.group(1) or '') + m.group(2) + (m.group(3) or '') + _(m.group(4)) + m.group(5) + _(m.group(6)) + t + '</a>' + s
+     s = ''
+     if m.group(0)[-1] == ':':
+         s = double_punct_char_separator + ':'
+     t = ''
+     if m.lastindex == 7:
+         t = m.group(7)
+     return '<a ' + (m.group(1) or '') + m.group(2) + (m.group(3) or '') + _(m.group(4)) + m.group(5) + _(m.group(6)) + t + '</a>' + s
  
  def h_gettext (m):
-       if m.group (3):
-               s = _(m.group(3))
-       else:
-               s= ''
-       return '<h' + m.group(1) + m.group(2) + '>' + s +\
-              m.group(4) + _(m.group(5)) + '</h' + m.group(1) + '>'
+     if m.group (3):
+         s = _(m.group(3))
+     else:
+         s= ''
+     return '<h' + m.group(1) + m.group(2) + '>' + s +\
+            m.group(4) + _(m.group(5)) + '</h' + m.group(1) + '>'
  
  def crossmanual_ref_gettext (m):
-       return '<a href="' + m.group(1) + '">' + _(m.group(2)) + '</a>'
+     return '<a href="' + m.group(1) + '">' + _(m.group(2)) + '</a>'
  
- for filename in args[3:]:
-       f = open (filename, 'r')
-       page = f.read ()
-       f.close()
-       page = re.sub (r'<link rel="(up|prev|next)" (.*?) title="([^"]*?)">', link_gettext, page)
-       page = re.sub (r'<title>([^<]*?) - ([^<]*?)</title>', title_gettext, page)
-       # ugh
-       page = re.sub (r'(?ms)<a ((?:rel="\w+")? ?(?:accesskey="[^"]+?")? ?(?:name=".*?")? ?)(href=".+?">)(<code>)?(Appendix )?([A-Z\d.]+ |)(.+?)(?(3)</code>)</a>:?', a_href_gettext, page)
-       page = re.sub (r'<h(\d)( class="\w+"|)>\s*(Appendix |)([A-Z\d.]+ |)?([^<]*[^< ])\s*</h\1>', h_gettext, page)
-       page = re.sub (r'<a href="(\.\./(?:music-glossary|lilypond-program/)?(?:.+?))">(.+?)</a>', crossmanual_ref_gettext, page)
-       # this is necessary for entries not translated by a_href_gettext
-       page = re.sub (r'<a href="(.+?)">(.+?)</a>', crossmanual_ref_gettext, page)
-       for w in ('Next:', 'Previous:', 'Up:'):
-               page = re.sub (w, _(w), page)
-       page = langdefs.LANGDICT[lang].html_filter (page)
-       f = open (os.path.join (outdir, filename), 'w')
-       f.write (page)
-       f.close ()
+ for filename in files:
+     f = open (filename, 'r')
+     page = f.read ()
+     f.close()
+     page = re.sub (r'<link rel="(up|prev|next)" (.*?) title="([^"]*?)">', link_gettext, page)
+     page = re.sub (r'<title>([^<]*?) - ([^<]*?)</title>', title_gettext, page)
+     # ugh
+     page = re.sub (r'(?ms)<a ((?:rel="\w+")? ?(?:accesskey="[^"]+?")? ?(?:name=".*?")? ?)(href=".+?">)(<code>)?(Appendix )?([A-Z\d.]+ |)(.+?)(?(3)</code>)</a>:?', a_href_gettext, page)
 -    page = re.sub (r'<h(\d)( class="\w+"|)>(Appendix |)([A-Z\d.]+ |)?([^<]+)</h\1>', h_gettext, page)
++    page = re.sub (r'<h(\d)( class="\w+"|)>\s*(Appendix |)([A-Z\d.]+ |)?([^<]+)\s*</h\1>', h_gettext, page)
+     page = re.sub (r'<a href="(\.\./(?:music-glossary|lilypond-program/)?(?:.+?))">(.+?)</a>', crossmanual_ref_gettext, page)
+     # this is necessary for entries not translated by a_href_gettext
+     page = re.sub (r'<a href="(.+?)">(.+?)</a>', crossmanual_ref_gettext, page)
+     for w in ('Next:', 'Previous:', 'Up:'):
+         page = re.sub (w, _(w), page)
+     page = langdefs.LANGDICT[lang].html_filter (page)
+     f = open (os.path.join (outdir, filename), 'w')
+     f.write (page)
+     f.close ()
diff --combined buildscripts/www_post.py
index 84e2ac70eca07373055eedcd46eb48375ee59977,b2d7ca510cb9bf663e3697d958709bce57acb96d..b05e5e20116bda755232b37f7c6130952acedb3e
@@@ -9,9 -9,8 +9,8 @@@
  import sys
  import os
  import re
- import gettext
  
- package_name, package_version, buildscript_dir, localedir, outdir, targets = sys.argv[1:]
+ package_name, package_version, buildscript_dir, outdir, targets = sys.argv[1:]
  targets = targets.split (' ')
  outdir = os.path.normpath (outdir)
  doc_dirs = ['input', 'Documentation', outdir]
@@@ -49,8 -48,8 +48,8 @@@ sys.stderr.write ("Mirrorring...\n"
  dirs, symlinks, files = mirrortree.walk_tree (
      tree_roots = doc_dirs,
      process_dirs = outdir,
-     exclude_dirs = '(^|/)(' + '|'.join ([l.code for l in langdefs.LANGUAGES]) + r'|po|out|.*?[.]t2d|\w*?-root)(/|$)',
+     exclude_dirs = '(^|/)(' + r'|po|out|out-test|.*?[.]t2d|\w*?-root)(/|$)|Documentation/(' + '|'.join ([l.code for l in langdefs.LANGUAGES]) + ')',
 -    find_files = r'.*?\.(?:midi|html|pdf|png|txt|ly|signature)$|VERSION',
 +    find_files = r'.*?\.(?:midi|html|pdf|png|txt|ly|signature|css)$|VERSION',
      exclude_files = r'lily-[0-9a-f]+.*\.(pdf|txt)')
  
  # actual mirrorring stuff
@@@ -92,17 -91,10 +91,10 @@@ if 'online' in targets
      f.write ('#.htaccess\nDirectoryIndex index\n')
      f.close ()
  
- # load gettext messages catalogs
- translation = {}
- for l in langdefs.LANGUAGES:
-     if l.enabled and l.code != 'en':
-         translation[l.code] = gettext.translation('lilypond-doc', localedir, [l.code]).gettext
  add_html_footer.build_pages_dict (html_files)
  for t in targets:
      sys.stderr.write ("Processing HTML pages for %s target...\n" % t)
      add_html_footer.add_html_footer (
-         translation = translation,
          package_name = package_name,
          package_version = package_version,
          target = t,
index 016708fc212e6399201be3123870e5617732f47f,538988e13c804ca5f31281a964c370a8c98daf63..2b4250945fb39b1cbb01a5962e03b2dc4aae1a6a
@@@ -13,6 -13,8 +13,8 @@@
  @end tex
  @end iftex
  
+ @include version.itexi
  @dircategory GNU LilyPond --- the music typesetter
  @direntry
  * LilyPond Snippets: (lilypond-snippets).       Short tricks, tips, and examples.
@@@ -65,7 -67,7 +67,7 @@@ This document shows a selected set of L
  Please note that it is not an exact subset of LSR: some snippets come
  from @file{input/new} LilyPond sources directory, and snippets from LSR
  are converted through @command{convert-ly}, as LSR is based on a stable
- LilyPond version, and this document is for version @value{version}.
+ LilyPond version, and this document is for version @version{}.
  
  Snippets are grouped by tags; tags listed in the table of contents match
  a section of LilyPond notation manual.  Snippets may have several tags,
@@@ -84,7 -86,7 +86,7 @@@ Musical notatio
  * Repeats::
  * Simultaneous notes::
  * Staff notation::
- * Editorial and educational use::
+ * Editorial annotations::
  * Text::
  
  Specialist notation
@@@ -94,6 -96,7 +96,7 @@@
  * Percussion::
  * Fretted strings::
  * Unfretted strings::
+ * Winds::
  * Ancient notation::
  
  Other collections
  * Templates::
  @end menu
  
 +@contents
 +
  
  @c Please take care of naming every .itely
  @c with an existing tag name.
  @include repeats.itely
  @include simultaneous-notes.itely
  @include staff-notation.itely
- @include editorial-and-educational-use.itely
+ @include editorial-annotations.itely
  @include text.itely
  
  @include vocal-music.itely
  @include percussion.itely
  @include fretted-strings.itely
  @include unfretted-strings.itely
- @c @include winds.itely
+ @include winds.itely
  @include ancient-notation.itely
  
  @include contexts-and-engravers.itely
diff --combined make/doclang-rules.make
index 36a53f956a41276359313bf065f45573a9a00518,10fa6ef382ecc95622f0ab6abe94f313070089c4..33101c46b9c68321f58f52b4ad5ab3e39a2be4f7
@@@ -1,16 -1,14 +1,17 @@@
 -$(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/version.itexi
++<<<<<<< HEAD:make/doclang-rules.make
 +$(outdir)/%/index.html: $(outdir)/%.texi $(OUT_PNG_IMAGES) $(outdir)/version.itexi
        mkdir -p $(dir $@)
 -      $(MAKEINFO) -P $(outdir) --output=$(outdir)/$* --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
 +      $(TEXI2HTML) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
 +      cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
  
 -$(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/version.itexi
 -      $(MAKEINFO) -P $(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $< 
 +$(outdir)/%-big-page.html: $(outdir)/%.texi $(OUT_PNG_IMAGES) $(outdir)/version.itexi
 +      $(TEXI2HTML) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$@ $(TEXI2HTML_INIT) $<
 +      cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
  
  $(outdir)/%.pdftexi: $(outdir)/%.texi doc-po $(outdir)/version.itexi
-       $(PYTHON) $(buildscript-dir)/texi-gettext.py $(buildscript-dir) $(top-build-dir)/Documentation/po/$(outdir) $(ISOLANG) $<
+       $(PYTHON) $(buildscript-dir)/texi-gettext.py $(ISOLANG) $<
  
 -$(outdir)/%.pdf: $(outdir)/%.pdftexi
 +$(outdir)/%.pdf: $(outdir)/%.pdftexi $(outdir)/version.itexi
        cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) $(TEXINFO_PAPERSIZE_OPTION) $(notdir $*).pdftexi
  
  $(outdir)/version.%: $(top-src-dir)/VERSION
        echo $(TOPLEVEL_VERSION)>> $@
        echo '@end macro'>> $@
  
 +$(outdir)/%.png: $(top-build-dir)/Documentation/user/$(outdir)/%.png
 +      ln -f $< $@
 +
+ # This makes sure lilypond-doc gettext domain has been compiled
+ # before lilypond-book runs
+ %.tely: doc-po
  $(OUT_TEXI_FILES): $(ITELY_FILES) $(ITEXI_FILES)
  
  $(DEEP_HTML_FILES) $(PDF_FILES): $(ITELY_FILES) $(ITEXI_FILES)
index 526e9a209364e9eb8cbe87a9cbbeef9cdca45e0f,94dbf27a240f4fae79c912ab5d88db4c113117fb..3e97f638f0d23d88acfdd1ee67be5ec2f0bafef5
   (slot-ref (all-scheme-functions-doc) 'text)
   (open-output-file "scheme-functions.tely"))
  
- (display 
-  (markup-doc-string)
-  (open-output-file "markup-commands.tely"))
;;(display 
;; (markup-doc-string)
;; (open-output-file "markup-commands.tely"))
  
- (display 
-  (markup-list-doc-string)
-  (open-output-file "markup-list-commands.tely"))
+ (call-with-output-file "markup-commands.tely"
+   (lambda (port)
+     (dump-node (markup-doc-node) port 2 #t)))
+ (call-with-output-file "markup-list-commands.tely"
+   (lambda (port)
+     (dump-node (markup-list-doc-node) port 2 #t)))
  
  (display 
   (identifiers-doc-string)
  @ifclear bigpage
  
  @macro ruser{NAME}
 -@ref{\\NAME\\,,,lilypond}
 +@ref{\\NAME\\,,,lilypond,Notation Reference}
  @cindex \\NAME\\
  @end macro
  
  @macro glossaryref{NAME}
 -@ref{\\NAME\\,,,music-glossary}
 +@ref{\\NAME\\,,,music-glossary,Music Glossary}
  @cindex \\NAME\\
  @end macro
  
  @end iftex
  
  
- @macro internalsref{NAME}
+ @macro rinternals{NAME}
  @ref{\\NAME\\}
  @end macro
  
  @omfcategory Applications|Publishing
  @end ignore
  
 -
 +@contents
  ")
   out-port)
  
index 1931363e421c96d1e808dd42e7a933bbb1308ade,24d94215fa19c00ae70b3e5fa808f79aad2d9ed2..0c9e2bdec6a1a5bbe2491e14b645ae29ba1c4f65
     (node-name x)
     (node-desc x)))
  
- (define (dump-node node port level)
+ (define* (dump-node node port level #:optional (appendix #f))
    (display
     (string-append
      "\n@node "
      (node-name node)
      "\n\n"
-     (texi-section-command level) " "
+     (if appendix
+         (texi-appendix-section-command level)
+         (texi-section-command level))
+     " "
      (node-name node)
      "\n\n"
      (node-text node)
@@@ -38,7 -41,7 +41,7 @@@
              (node-children node)))
        ""))
     port)
-   (map (lambda (x) (dump-node x port (+ 1 level)))
+   (map (lambda (x) (dump-node x port (+ 1 level) appendix))
         (node-children node)))
  
  (define (processing name)
    (cdr (assoc level '(
                      ;; Hmm, texinfo doesn't have ``part''
                      (0 . "@top")
 -                    (1 . "@unnumbered")
 -                    (2 . "@unnumberedsec")
 -                    (3 . "@unnumberedsubsec")
 +                    (1 . "@chapter")
 +                    (2 . "@section")
 +                    (3 . "@subsection")
                      (4 . "@unnumberedsubsubsec")
                      (5 . "@unnumberedsubsubsec")))))
  
+ (define (texi-appendix-section-command level)
+   (cdr (assoc level '((0 . "@top")
+                     (1 . "@appendix")
+                     (2 . "@appendixsec")
+                     (3 . "@appendixsubsec")
+                     (4 . "@appendixsubsubsec")
+                     (5 . "@appendixsubsubsec")))))
  (define (one-item->texi label-desc-pair)
    "Document one (LABEL . DESC); return empty string if LABEL is empty string."
    (if (eq? (car label-desc-pair) "")
index 3c602e6018d01474813dc10b498c37c866e7fc88,c6e29cde73e645e1336da3dd7aadd2afff541f5d..649956f6fb5cb5496d231dfccafe58e546559bf2
@@@ -26,19 -26,11 +26,14 @@@ endi
  $(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir.dep $(outdir)/version.itexi
        $(MAKEINFO) -I$(outdir) --output=$@ $<
  
- $(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/version.itexi
-       mkdir -p $(dir $@)
-       $(TEXI2HTML) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
-       cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
  $(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/version.itexi
 -      $(MAKEINFO) -I $(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split -D bigpage --no-headers $<
 +      $(TEXI2HTML) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< 
 +      cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
 +
  
  $(outdir)/%.html: $(outdir)/%.texi $(outdir)/version.itexi
 -      $(MAKEINFO) -I $(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $<
 +      $(TEXI2HTML) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $<
 +      cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
  
  $(outdir)/%.html.omf: %.texi
        $(call GENERATE_OMF,html)
@@@ -49,6 -41,10 +44,11 @@@ $(outdir)/%.pdf.omf: %.tex
  $(outdir)/%.ps.gz.omf: %.texi
        $(call GENERATE_OMF,ps.gz)
  
 -      $(MAKEINFO) -I $(outdir) --output=$(dir $@) --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
+ $(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/version.itexi
+       mkdir -p $(dir $@)
++      $(TEXI2HTML) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $<
++      cp $(top-src-dir)/Documentation/lilypond.css $(dir $@)
  $(outdir)/%.pdf: $(outdir)/%.texi $(outdir)/version.itexi
        cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
  
@@@ -64,3 -60,4 +64,4 @@@ $(outdir)/version.%: $(top-src-dir)/VER
        echo $(TOPLEVEL_VERSION)>> $@
        echo '@end macro'>> $@
  
+ .SECONDARY: $(outdir)/version.itexi $(outdir)/version.texi