From 3de7706192291cb406be9653ef941a2219679b2f Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Wed, 6 Aug 2008 12:56:04 +0200 Subject: [PATCH] texi2html: Create map for snippets, link other map files, rename to .xref-map -) Renamed the map files to .xref-map, so that they are indicated by extension only (instead of _xref.map) -) Add map file as dependency for the snippets page, so that it will be generated automatically -) Linked the map file for the snippets in Documentation/user/out-www and the map files from Documentation/user in input/lsr/out-www, so that cross references between those manuals work correctly, too. --- Documentation/user/GNUmakefile | 4 +++- buildscripts/extract_texi_filenames.py | 4 ++-- input/lsr/GNUmakefile | 10 +++++++++- lilypond-texi2html.init | 4 ++-- stepmake/stepmake/texinfo-rules.make | 8 ++++---- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 23c67ec40c..b930b98e16 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -125,13 +125,15 @@ $(outdir)/%/source: mkdir -p $(dir $@) ln -sf $(depth)/.. $(@) -local-WWW-1: $(MASTER_TEXI_FILES) $(MASTER_TEXI_FILES:%.texi=%_xref.map) $(PDF_FILES) info +local-WWW-1: $(MASTER_TEXI_FILES) $(MASTER_TEXI_FILES:%.texi=%.xref-map) $(outdir)/lilypond-snippets.xref-map $(PDF_FILES) info local-WWW-2: $(HTML_FILES) $(DEEP_HTML_FILES) $(source-links) $(outdir)/%.bib: %.bib ln -f $< $@ +$(outdir)/lilypond-snippets.xref-map: + ln -fs ../../../input/lsr/$@ $@ # lilypond.texi deps $(top-build-dir)/mf/$(outconfbase)/feta16list.ly: diff --git a/buildscripts/extract_texi_filenames.py b/buildscripts/extract_texi_filenames.py index e8334f34e6..beea07e433 100755 --- a/buildscripts/extract_texi_filenames.py +++ b/buildscripts/extract_texi_filenames.py @@ -14,7 +14,7 @@ # which is then used for the filename/anchor. # # If this script is run on a file texifile.texi, it produces a file -# texifile_xref.map with tab-separated entries of the form +# texifile.xref-map with tab-separated entries of the form # NODE\tFILENAME\tANCHOR # Note: The filename does not have any extension appended! # This file can then be used by our texi2html init script to determine @@ -104,7 +104,7 @@ unnumbered_re = re.compile (r'unnumbered.*') def process_sections (filename, page): sections = section_translation_re.findall (page) # TODO: Don't rely on the file having a 4-letter extension (texi)!!! - p = os.path.join (outdir, filename) [:-5] + '_xref.map' + p = os.path.join (outdir, filename) [:-5] + '.xref-map' f = open (p, 'w') this_title = '' diff --git a/input/lsr/GNUmakefile b/input/lsr/GNUmakefile index ed7eeef113..97e188eb88 100644 --- a/input/lsr/GNUmakefile +++ b/input/lsr/GNUmakefile @@ -58,10 +58,18 @@ local-clean: local-WWW-1: info $(outdir)/lilypond-snippets.pdf \ $(outdir)/lilypond-snippets.texi \ - $(outdir)/lilypond-snippets_xref.map + $(outdir)/lilypond-snippets.xref-map \ + $(outdir)/lilypond.xref-map \ + $(outdir)/lilypond-learning.xref-map local-WWW-2: $(outdir)/lilypond-snippets/index.html \ $(outdir)/lilypond-snippets-big-page.html \ $(source-links) +%.xref-map: %.texi + $(PYTHON) $(buildscript-dir)/extract_texi_filenames.py $< + +$(outdir)/lilypond.xref-map $(outdir)/lilypond-learning.xref-map: + ln -sf ../../../Documentation/user/$@ $@ + .SECONDARY: diff --git a/lilypond-texi2html.init b/lilypond-texi2html.init index a7eaf9d17f..f1815cb339 100644 --- a/lilypond-texi2html.init +++ b/lilypond-texi2html.init @@ -326,7 +326,7 @@ sub split_at_numbered_sections($$$) sub lilypond_init_map () { my ($docu_dir, $docu_name) = split_texi_filename ($Texi2HTML::THISDOC{'input_file_name'}); - my $map_filename = "$docu_dir/${docu_name}_xref.map"; + my $map_filename = "$docu_dir/${docu_name}.xref-map"; $node_to_filename_map = load_map_file ($map_filename); } push @Texi2HTML::Config::command_handler_init, \&lilypond_init_map; @@ -427,7 +427,7 @@ sub lilypond_external_href($$$) # Load the map if we haven't done so already if (!exists($translated_books{$map_name})) { my ($docu_dir, $docu_name) = split_texi_filename ($Texi2HTML::THISDOC{'input_file_name'}); - my $map_filename = "$docu_dir/${map_name}_xref.map"; + my $map_filename = "$docu_dir/${map_name}.xref-map"; $translated_books{$map_name} = load_map_file ($map_filename); } diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index a75cb0f548..fc23bcb3fd 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -26,12 +26,12 @@ endif $(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir.dep $(outdir)/version.itexi $(MAKEINFO) -I$(outdir) --output=$@ $< -$(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/%_xref.map $(outdir)/version.itexi +$(outdir)/%-big-page.html: $(outdir)/%.texi $(outdir)/%.xref-map $(outdir)/version.itexi $(TEXI2HTML) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) -$(outdir)/%.html: $(outdir)/%.texi $(outdir)/%_xref.map $(outdir)/version.itexi +$(outdir)/%.html: $(outdir)/%.texi $(outdir)/%.xref-map $(outdir)/version.itexi $(TEXI2HTML) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $< cp $(top-src-dir)/Documentation/lilypond*.css $(dir $@) @@ -44,7 +44,7 @@ $(outdir)/%.pdf.omf: %.texi $(outdir)/%.ps.gz.omf: %.texi $(call GENERATE_OMF,ps.gz) -$(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/%_xref.map $(outdir)/version.itexi +$(outdir)/%/index.html: $(outdir)/%.texi $(outdir)/%.xref-map $(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 $@) @@ -59,7 +59,7 @@ $(outdir)/%.texi: %.texi rm -f $@ cp $< $@ -%_xref.map: %.texi +%.xref-map: %.texi $(PYTHON) $(buildscript-dir)/extract_texi_filenames.py $< -- 2.39.5