From: John Mandereau Date: Sun, 9 Nov 2008 16:46:38 +0000 (+0100) Subject: Docs: add LSR snippets to variables and comments gettexting X-Git-Tag: release/2.11.64-1~59 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0da867c418679318682d8c64576dc2acb203a748;p=lilypond.git Docs: add LSR snippets to variables and comments gettexting This is a second attempt, which is supposed to fix c43987a1620dc43c65bbc07b22375cabf45ebd2f. --- diff --git a/Documentation/po/GNUmakefile b/Documentation/po/GNUmakefile index 3f8fc3ce4a..eea2f247d1 100644 --- a/Documentation/po/GNUmakefile +++ b/Documentation/po/GNUmakefile @@ -11,7 +11,8 @@ DOMAIN=lilypond-doc DOC_PO_SOURCES = postprocess_html.py texi-gettext.py translations-status.py TELY_FILES = $(shell ls $(depth)/Documentation/user/lilypond*.tely) TELY_FILES += $(foreach l, $(LANGS), $(shell ls $(depth)/Documentation/$(l)/user/lilypond*.tely)) -TELY_FILES += $(shell ls $(depth)/input/lsr/*.ly) +LSR_LYS := $(shell ls $(depth)/input/lsr/*.ly) +TELY_FILES += $(LSR_LYS:%.ly=../%.ly) messages: $(outdir)/messages diff --git a/buildscripts/texi-langutils.py b/buildscripts/texi-langutils.py index 37de5cc419..720b520a2e 100644 --- a/buildscripts/texi-langutils.py +++ b/buildscripts/texi-langutils.py @@ -62,7 +62,8 @@ texinfo_with_menus_re = re.compile (r"^(\*) +([^:\n]+)::.*?$|^@(include|menu|end texinfo_re = re.compile (r"^@(include|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *(.+?)$|@(rglos){(.+?)}", re.M) ly_string_re = re.compile (r'^([a-zA-Z]+)[\t ]*=|%+[\t ]*(.*)$|\\(?:new|context)\s+(?:[a-zA-Z]*?(?:Staff(?:Group)?|Voice|FiguredBass|FretBoards|Names|Devnull))\s+=\s+"?([a-zA-Z]+)"?\s+') -verbatim_ly_re = re.compile (r'@lilypond\[.*?verbatim') +lsr_verbatim_ly_re = re.compile (r'% begin verbatim$') +texinfo_verbatim_ly_re = re.compile (r'^@lilypond\[.*?verbatim') def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, output_file=None, scan_ly=False): try: @@ -73,12 +74,16 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu includes = [] # process ly var names and comments - if output_file and scan_ly: + if output_file and (scan_ly or texifilename.endswith ('.ly')): lines = texifile.splitlines () i = 0 in_verb_ly_block = False + if texifilename.endswith ('.ly'): + verbatim_ly_re = lsr_verbatim_ly_re + else: + verbatim_ly_re = texinfo_verbatim_ly_re for i in range (len (lines)): - if verbatim_ly_re.match (lines[i]): + if verbatim_ly_re.search (lines[i]): in_verb_ly_block = True elif lines[i].startswith ('@end lilypond'): in_verb_ly_block = False