From e480f60f4618cd3e6b743f3fc4d2482af8de0cb5 Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Tue, 2 Sep 2008 13:14:20 +0200 Subject: [PATCH] Fix trailing spaces and split long Python lines Also remove commented out duplicate makeinfo configure check, and remove duplicate stalled Texinfo macros. All these nitpicks have been caught by checking output from git diff master dev/texi2html --- Documentation/lilypond-ie-fixes.css | 2 +- Documentation/user/macros.itexi | 14 +------------- buildscripts/extract_texi_filenames.py | 6 ++++-- buildscripts/postprocess_html.py | 16 +++++++++++----- configure.in | 2 -- lilypond-texi2html.init | 12 ++++++------ stepmake/stepmake/texinfo-rules.make | 2 +- stepmake/stepmake/texinfo-vars.make | 2 +- 8 files changed, 25 insertions(+), 31 deletions(-) diff --git a/Documentation/lilypond-ie-fixes.css b/Documentation/lilypond-ie-fixes.css index 8a068900f0..6587e18ead 100644 --- a/Documentation/lilypond-ie-fixes.css +++ b/Documentation/lilypond-ie-fixes.css @@ -25,4 +25,4 @@ div#main { div#tocframe { height: 100%; width: 27%; -} +} diff --git a/Documentation/user/macros.itexi b/Documentation/user/macros.itexi index 6801ff4f34..a00f9c07ff 100644 --- a/Documentation/user/macros.itexi +++ b/Documentation/user/macros.itexi @@ -288,22 +288,14 @@ @ref{\TEXT\,,\DISPLAY\,lilypond-learning,Learning Manual} @end macro -@macro rlearningnamed{TEXT,DISPLAY} -learning manual, @ref{\TEXT\,,\DISPLAY\,lilypond-learning,Learning Manual} -@end macro - @macro ruser{TEXT} @ref{\TEXT\,,,lilypond,Notation Reference} @end macro -@macro rusernamed{TEXT,DISPLAY,DISPLAY} +@macro rusernamed{TEXT,DISPLAY} @ref{\TEXT\,,\DISPLAY\,lilypond,Notation Reference} @end macro -@macro rusernamed{TEXT,DISPLAY,DISPLAY} -notation reference, @ref{\TEXT\,,\DISPLAY\,lilypond,Notation Reference} -@end macro - @macro rprogram{TEXT} @ref{\TEXT\,,,lilypond-program,Application Usage} @end macro @@ -312,10 +304,6 @@ notation reference, @ref{\TEXT\,,\DISPLAY\,lilypond,Notation Reference} @ref{\TEXT\,,\DISPLAY\,lilypond-program,Application Usage} @end macro -@macro rprogramnamed{TEXT,DISPLAY} -program usage manual, @ref{\TEXT\,,\DISPLAY\,lilypond-program,Application Usage} -@end macro - @macro rlsr{TEXT} @ref{\TEXT\,,,lilypond-snippets,Snippets} @end macro diff --git a/buildscripts/extract_texi_filenames.py b/buildscripts/extract_texi_filenames.py index c85a18fb22..5798d5dab2 100755 --- a/buildscripts/extract_texi_filenames.py +++ b/buildscripts/extract_texi_filenames.py @@ -18,7 +18,7 @@ # NODE\tFILENAME\tANCHOR # LANG is the document language in case it's not 'en' # Note: The filename does not have any extension appended! -# This file can then be used by our texi2html init script to determine +# This file can then be used by our texi2html init script to determine # the correct file name and anchor for external refs import sys @@ -41,7 +41,9 @@ if not os.path.isdir (outdir): include_re = re.compile (r'@include ((?!../lily-).*?)\.texi$', re.M) whitespaces = re.compile (r'\s+') -section_translation_re = re.compile (r'^@(node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading|translationof) (.*?)\s*$', re.MULTILINE) +section_translation_re = re.compile ('^@(node|(?:unnumbered|appendix)\ +(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|\ +(?:major|chap|(?:sub){0,2})heading|translationof) (.*?)\\s*$', re.MULTILINE) def expand_includes (m, filename): filepath = os.path.join (os.path.dirname (filename), m.group(1)) + '.texi' diff --git a/buildscripts/postprocess_html.py b/buildscripts/postprocess_html.py index 6ebe31a8e0..98d4961224 100644 --- a/buildscripts/postprocess_html.py +++ b/buildscripts/postprocess_html.py @@ -94,10 +94,13 @@ def build_pages_dict (filelist): def source_links_replace (m, source_val): return 'href="' + os.path.join (source_val, m.group (1)) + '"' -splitted_docs_re = re.compile ('(input/lsr/out-www/lilypond-snippets|Documentation/user/out-www/(lilypond|music-glossary|lilypond-program|lilypond-learning))/') +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') -user_ref_re = re.compile (r'href="(?:\.\./)?lilypond(-internals|-learning|-program|(?!-snippets))') +user_ref_re = re.compile ('href="(?:[.][.])?lilypond\ +(-internals|-learning|-program|(?!-snippets))') ## Windows does not support symlinks. # This function avoids creating symlinks for splitted HTML manuals @@ -177,12 +180,15 @@ 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 (operator.and_, [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)(#[^"']*|)['"]''') +online_links_re = re.compile ('''(href|src)=['"]([^/][.]*[^.:'"]*)\ +([.]html|[.]png)(#[^"']*|)['"]''') offline_links_re = re.compile ('''href=['"]([^/][.]*[^.:'"]*)([.]html)(#[^"']*|)['"]''') big_page_name_re = re.compile ('''(.+?)-big-page''') @@ -313,7 +319,7 @@ def process_html_files (package_name = '', ### add footer if footer_tag_re.search (s) == None: s = add_footer (s, footer_tag + footer) - + available, missing = find_translations (prefix, lang_ext) page_flavors = process_links (s, prefix, lang_ext, file_name, missing, target) # Add menu after stripping: must not have autoselection for language menu. diff --git a/configure.in b/configure.in index be353c500e..ffd787f4c9 100644 --- a/configure.in +++ b/configure.in @@ -126,8 +126,6 @@ AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt)) CPPFLAGS="$save_CPPFLAGS" -# We check for makeinfo below, too. Really duplicate that check? -## STEPMAKE_MAKEINFO(REQUIRED, 4.11) STEPMAKE_PYTHON_DEVEL(REQUIRED) STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.15) diff --git a/lilypond-texi2html.init b/lilypond-texi2html.init index 66c269b36f..e208e5933b 100644 --- a/lilypond-texi2html.init +++ b/lilypond-texi2html.init @@ -350,7 +350,7 @@ sub lilypond_element_target_name($$$) } # If we have an entry in the section<=>filename map, use that one, otherwise - # generate the anchor here. + # generate the anchor here. if (exists ($node_to_filename_map->{$node_name})) { (my $filename, $target) = @{$node_to_filename_map->{$node_name}}; } else { @@ -884,7 +884,7 @@ sub lilypond_print_navigation # before the fn text. -# The following code is copied from texi2html's examples/makeinfo.init and +# The following code is copied from texi2html's examples/makeinfo.init and # should be updated when texi2html makes some changes there! my $makekinfo_like_footnote_absolute_number = 0; @@ -899,7 +899,7 @@ sub makeinfo_like_foot_line_and_ref($$$$$$$$) my $footnote_file = shift; my $lines = shift; my $state = shift; - + $makekinfo_like_footnote_absolute_number++; # this is a bit obscure, this allows to add an anchor only if formatted @@ -907,7 +907,7 @@ sub makeinfo_like_foot_line_and_ref($$$$$$$$) $docid = '' if ($state->{'outside_document'} or $state->{'multiple_pass'}); if ($from_file eq $footnote_file) - { + { $from_file = $footnote_file = ''; } @@ -985,8 +985,8 @@ sub makeinfo_like_paragraph ($$$$$$$$$$$$$) my $docid = $state->{'footnote_place_id'}; my $doc_state = $state->{'footnote_document_state'}; $docid = '' if ($doc_state->{'outside_document'} or $doc_state->{'multiple_pass'}); - my $foot_label = &$anchor($state->{'footnote_footnote_id'}, - $document_file . "#$state->{'footnote_place_id'}", + my $foot_label = &$anchor($state->{'footnote_footnote_id'}, + $document_file . "#$state->{'footnote_place_id'}", "$state->{'footnote_number_in_page'}"); $footnote_text = "[${foot_label}] "; } diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 00435f2f2c..4d1f06283f 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -28,7 +28,7 @@ $(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir- ifeq (,$(findstring texi2html,$(MISSING_OPTIONAL))) $(outdir)/%-big-page.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi - $(TEXI2HTML) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) $(outdir)/%.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi diff --git a/stepmake/stepmake/texinfo-vars.make b/stepmake/stepmake/texinfo-vars.make index dcfa5e63b9..726273c55f 100644 --- a/stepmake/stepmake/texinfo-vars.make +++ b/stepmake/stepmake/texinfo-vars.make @@ -18,7 +18,7 @@ XREF_MAPS_DIR=$(top-build-dir)/out/xref-maps XREF_MAPS_FILES=$(INFO_DOCS:%=$(XREF_MAPS_DIR)/%.xref-map) # texi2html flags -ifneq ($(ISOLANG),) +ifneq ($(ISOLANG),) TEXI2HTML_LANG = --lang=$(ISOLANG) endif TEXI2HTML_FLAGS += --css-ref=lilypond.css $(DOCUMENTATION_INCLUDES) \ -- 2.39.2