From: Jan Nieuwenhuizen Date: Wed, 12 Aug 2009 13:13:01 +0000 (+0200) Subject: WEB: Integration of new web site [general.texi]. X-Git-Tag: release/2.13.4-1~179^2~101 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ba32454fd3765fe77f58e13c2b3db4a4196282a7;p=lilypond.git WEB: Integration of new web site [general.texi]. Fixes: - eternal circular dependencies by not re-using/re-touching xref-maps - texi2html flags cleanups - new-lang target in Documentation produces working skeleton again - move some lilypond-specific code out of stepmake - fr: missing macro definitions - web css fix for footer --- diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 7b9c52fc8d..e524b682ac 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -93,9 +93,10 @@ OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES))) ## No big page OUT_HTML_FILES := $(subst $(outdir)/general-big-page.html,,$(OUT_HTML_FILES)) -## Different init file and CSS -$(outdir)/general/index.html: \ - TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/web-texi2html.init +$(outdir)/general/index.html:\ + TEXI2HTML_INIT = $(WEB_TEXI2HTML_INIT) +$(outdir)/general/index.html:\ + TEXI2HTML_SPLIT := $(WEB_TEXI2HTML_SPLIT) ########### ### Targets @@ -144,6 +145,12 @@ endif ######### ### Rules +$(outdir)/lilypond-%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi + $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< + +$(outdir)/lilypond.info: $(src-dir)/general.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi + $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< + # cd $(outdir) rule gets bit hairy for --srcdir configure builds txt-to-html: $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true @@ -226,27 +233,54 @@ CHECK_TRANSLATION_FLAGS = --no-color endif ifneq ($(ISOLANG),) +new-lang-dir: + mkdir -p $(ISOLANG)/$(DIR) + cp fr/GNUmakefile $(ISOLANG) + cp fr/$(DIR)/GNUmakefile $(ISOLANG)/$(DIR) + sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/$(DIR)/GNUmakefile +ifeq (ugh,urgh) +# Law of conservation of badness in action :-) + cd $(ISOLANG)/$(DIR) && ../../$(auxscript-dir)/texi-langutils.py -l $(ISOLANG) -o ../../$(outdir)/doc.pot --skeleton --gettext $$(ls -1 ../../$(DIR).tely ../../$(DIR).texi) +# gets written to wrong directory; texi-langutils.py outdir/output is a mess + mv $(ISOLANG)/$(DIR)/$(DIR).* $(ISOLANG) || : +# cleanup cruft + rm -f $(ISOLANG)/node_list $(ISOLANG)/*/node_list +else + $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext $$(cd $(ISOLANG) && ls -1 ../$(DIR).tely ../$(DIR).texi) + mv $$(ls $(outdir)/$(DIR).tely $(outdir)/$(DIR).texi) $(ISOLANG) || : + mv $$(ls $(outdir)/*.*tely $(outdir)/*.*texi) $(ISOLANG)/$(DIR) ||: +endif + new-lang: +# FIXME: allow this target to update a language too +# do not blindly overwrite, use test -e and only create missing files +# for inspiration, see [old] lilypond/web GNUmakefile's target new: @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \ then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \ exit 3 ; \ fi - mkdir -p $(ISOLANG)/learning - cp fr/GNUmakefile $(ISOLANG) - cp fr/learning/GNUmakefile $(ISOLANG)/learning - sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/learning/GNUmakefile - $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) -o doc.pot --skeleton --gettext ../learning.tely - mv $(outdir)/*.*tely $(ISOLANG)/learning + $(foreach i,$(TRANSLATION_DIRS),$(MAKE) new-lang-dir DIR=$(i) &&) : + cd fr && cp $(EXTRA_TRANSLATION_FILES) ../$(ISOLANG) msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot cp po/lilypond-doc.pot po/$(ISOLANG).po @echo "*** Please add a language definition for $(ISOLANG) in python/langdefs.py ***" -CHECKED_FILES = $(ISOLANG)/index.html.in $(foreach i,learning notation application, \ - $(shell find $(ISOLANG)/$(manual) -name '*.*te??' -not -wholename '*out-www*')) \ - $(shell find $(ISOLANG)/texidocs/ -name '*.texidoc') +#TRANSLATION_DIRS = $(shell git ls-files $(ISOLANG) | $(PYTHON) $(buildscript-dir)/pytt.py '/[^/]*$$' / | sort -u ) +TRANSLATION_DIRS = application general learning notation texidocs +TRANSLATION_FILES = $(shell git ls-files $(ISOLANG) | grep -v GNUmakefile) +EXTRA_TRANSLATION_FILES =\ + dedication.itely\ + index.html.in\ + common-macros.itexi\ + macros.itexi\ + translations.html.in\ + translations.template.html.in\ +# + TELY_FILES = $(call src-wildcard,$(ISOLANG)/*.tely) skeleton-update: + mkdir -p $(ISOLANG) $(auxscript-dir)/texi-langutils.py -d $(outdir) -l $(ISOLANG) --skeleton $(TELY_FILES:$(ISOLANG)/%.tely=../%.tely) $(auxscript-dir)/texi-skeleton-update.py $(ISOLANG) $(outdir) @@ -276,10 +310,10 @@ fix-xrefs: $(DOCUMENTS_INCLUDES) $(auxpython-dir)/manuals_definitions.py check-translation: - ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES) + ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py $(CHECK_TRANSLATION_FLAGS) $(TRANSLATION_FILES) update-translation: - ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(CHECKED_FILES) + ISOLANG=$(ISOLANG) $(auxscript-dir)/check_translation.py --update $(CHECK_TRANSLATION_FLAGS) $(TRANSLATION_FILES) translation-status: make -C po out=www messages diff --git a/Documentation/css/lilypond-web.css b/Documentation/css/lilypond-web.css index 3b3994905f..0507b1fca9 100644 --- a/Documentation/css/lilypond-web.css +++ b/Documentation/css/lilypond-web.css @@ -503,9 +503,10 @@ div#language { #verifier_texinfo { position: absolute; - top: 0; + bottom: 0; right: 0; left: 50%; + width: 50%; } #verifier_texinfo h3 { diff --git a/Documentation/fr/macros.itexi b/Documentation/fr/macros.itexi index 9180519f02..b06d76f843 100644 --- a/Documentation/fr/macros.itexi +++ b/Documentation/fr/macros.itexi @@ -176,6 +176,16 @@ @ref{\TEXT\,,\DISPLAY\,notation-big-page,Manuel de notation} @end macro +@macro ressay{TEXT} +@vindex \TEXT\ +@ref{\TEXT\,,,essay-big-page,Essay} +@end macro + +@macro ressaynamed{TEXT,DISPLAY} +@vindex \TEXT\ +@ref{\TEXT\,,\DISPLAY\,essay-big-page,Essay} +@end macro + @macro rprogram{TEXT} @vindex \TEXT\ @ref{\TEXT\,,,application-big-page,Manuel d'utilisation du programme} @@ -242,6 +252,16 @@ @ref{\TEXT\,,\DISPLAY\,notation,Manuel de notation} @end macro +@macro ressay{TEXT} +@vindex \TEXT\ +@ref{\TEXT\,,,essay,Essay} +@end macro + +@macro ressaynamed{TEXT,DISPLAY} +@vindex \TEXT\ +@ref{\TEXT\,,\DISPLAY\,essay,Essay} +@end macro + @macro rprogram{TEXT} @vindex \TEXT\ @ref{\TEXT\,,,application,Manuel d'utilisation du programme} @@ -320,6 +340,16 @@ @ref{\TEXT\,,\DISPLAY\,notation.fr,Manuel de notation} @end macro +@macro ressay{TEXT} +@vindex \TEXT\ +@ref{\TEXT\,,,lilypond-essay,Essay} +@end macro + +@macro ressaynamed{TEXT,DISPLAY} +@vindex \TEXT\ +@ref{\TEXT\,,\DISPLAY\,lilypond-essay,Essay} +@end macro + @macro rprogram{TEXT} @lilyvindex{\TEXT\} @ref{\TEXT\,,,application.fr,Manuel d'utilisation du programme} diff --git a/Documentation/fr/notation.tely b/Documentation/fr/notation.tely index 8adc46eadd..8f1162b8e9 100644 --- a/Documentation/fr/notation.tely +++ b/Documentation/fr/notation.tely @@ -7,7 +7,7 @@ @end ignore @documentencoding UTF-8 -@setfilename lilypond.info +@setfilename lilypond-notation.info @settitle GNU LilyPond -- Manuel de notation @include macros.itexi diff --git a/Documentation/general.texi b/Documentation/general.texi index f152ce03db..a7a9dc3dc7 100644 --- a/Documentation/general.texi +++ b/Documentation/general.texi @@ -6,8 +6,8 @@ version that you are working on. See TRANSLATION for details. @end ignore -@setfilename lilypond.info -@settitle GNU LilyPond New Website +@setfilename general.info +@settitle LilyPond -- Music notation for everyone @documentencoding UTF-8 @documentlanguage en @@ -18,8 +18,8 @@ @ifnottex @node Top -@top GNU LilyPond --- Web site -@chapheading The music typesetter +@top +@chapheading @end ifnottex @@ -27,7 +27,7 @@ @titlepage @title LilyPond -@subtitle The music typesetter +@c @subtitle The music typesetter @titlefont{New Website} @author The LilyPond development team @@ -73,10 +73,13 @@ Free Documentation License''. @divId{quickSummary} @subheading What is LilyPond? -LilyPond is a free open-source music engraving program, devoted to +LilyPond is an open-source music engraving program, devoted to producing the highest-quality sheet music possible. We bring the aesthetics of traditionally engraved music to computer printouts. +LilyPond is Free Software and part of the +@uref{http://@/www@/.gnu@/.org/, GNU} project. + @divClass{align-right} Read more in our @ref{Introduction}! @divEnd @@ -88,7 +91,7 @@ FIXME: process news items like the old web site: select first 4 items to insert here, and generate RSS. -@c @include news-front.itexi +@include news-front.itexi @divClass{float-right} (@ref{Old news}) diff --git a/Documentation/web-texi2html.init b/Documentation/web-texi2html.init index 9ea38e8c1d..f266657c8d 100644 --- a/Documentation/web-texi2html.init +++ b/Documentation/web-texi2html.init @@ -719,6 +719,7 @@ sub print_lilypond_page_foot($) # Do not include language selection in div#main print $fh "\n\n\n"; + if (0) { print $fh "\n\n"; print $fh "
\n"; print $fh "
\n"; @@ -726,6 +727,7 @@ sub print_lilypond_page_foot($) print $fh "

Deutsch, Español, Français, Magyar.

\n"; print $fh "

About automatic language selection.

\n"; print $fh "
\n"; + } print $fh "
\n"; print $fh "

Validation

\n"; diff --git a/make/doc-i18n-root-rules.make b/make/doc-i18n-root-rules.make index e63acb4f65..c7d8d4a99c 100644 --- a/make/doc-i18n-root-rules.make +++ b/make/doc-i18n-root-rules.make @@ -1,20 +1,23 @@ +$(outdir)/%.texi: %.texi + cp -p $< $@ + $(top-build-dir)/Documentation/$(outdir)/%/index.$(ISOLANG).html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map $(TRANSLATION_LILY_IMAGES) mkdir -p $(dir $@) mkdir -p $(outdir)/$* - $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$(outdir)/$* --prefix=index --split=section $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) $(TEXI2HTML_SPLIT) --output=$(outdir)/$* $< find $(outdir)/$* -name '*.html' | xargs grep -L --label="" 'UNTRANSLATED NODE: IGNORE ME' | sed 's!$(outdir)/!!g' | xargs $(buildscript-dir)/mass-link --prepend-suffix .$(ISOLANG) hard $(outdir) $(top-build-dir)/Documentation/$(outdir) - $(top-build-dir)/Documentation/$(outdir)/%-big-page.$(ISOLANG).html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map $(TRANSLATION_LILY_IMAGES) - $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) -D bigpage $(TEXI2HTML_FLAGS) --output=$@ $(TEXI2HTML_INIT) $< + echo foebar + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) -D bigpage --output=$@ $< $(top-build-dir)/Documentation/$(outdir)/%.$(ISOLANG).html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map $(outdir)/version.itexi - $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) $(TEXI2HTML_FLAGS) --output=$@ $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$@ $< $(top-build-dir)/Documentation/$(outdir)/%.$(ISOLANG).pdf: $(outdir)/%.texi cd $(outdir) && \ - texi2pdf $(TEXI2PDF_FLAGS) $(TEXINFO_PAPERSIZE_OPTION) $*.texi && \ - mkdir -p $(dir $@) && mv $*.pdf $@ + texi2pdf $(TEXI2PDF_FLAGS) $(TEXINFO_PAPERSIZE_OPTION) $*.texi && \ + mkdir -p $(dir $@) && mv $*.pdf $@ $(outdir)/version.%: $(top-src-dir)/VERSION echo '@macro version'> $@ @@ -26,6 +29,7 @@ $(outdir)/%.png: $(top-build-dir)/Documentation/$(outdir)/%.png $(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(buildscript-dir)/extract_texi_filenames -o $(XREF_MAPS_DIR) $(XREF_MAP_FLAGS) --master-map-file=$(XREF_MAPS_DIR)/$*.xref-map $< + touch -r $^ $@ $(MASTER_TEXI_FILES): $(ITELY_FILES) $(ITEXI_FILES) $(outdir)/pictures @@ -37,4 +41,12 @@ $(TRANSLATION_LILY_IMAGES): $(MASTER_TEXI_FILES) find $(outdir) \( -name 'lily-*.png' -o -name 'lily-*.ly' \) | sed 's!$(outdir)/!!g' | xargs $(buildscript-dir)/mass-link hard $(outdir) $(top-build-dir)/Documentation/$(outdir) touch $@ +$(outdir)/lilypond-%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi + $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< + +$(outdir)/lilypond.info: $(outdir)/general.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi + $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< + +$(outdir)/general/index.html: $(outdir)/macros.itexi $(outdir)/common-macros.itexi + .SECONDARY: diff --git a/make/doc-i18n-root-vars.make b/make/doc-i18n-root-vars.make index ed68660f74..4219dbf393 100644 --- a/make/doc-i18n-root-vars.make +++ b/make/doc-i18n-root-vars.make @@ -9,15 +9,20 @@ LANGS = $(shell $(PYTHON) $(buildscript-dir)/langdefs.py) CSS_SOURCE_FILES = $(shell ls $(top-src-dir)/Documentation/lilypond*.css) TELY_FILES := $(call src-wildcard,*.tely) -MASTER_TEXI_FILES := $(TELY_FILES:%.tely=$(outdir)/%.texi) +TEXI_FILES := $(call src-wildcard,*.texi) +MASTER_TEXI_FILES := $(TEXI_FILES) $(TELY_FILES:%.tely=$(outdir)/%.texi) -SPLITTED_HTML_MANUALS = $(foreach manual, $(TELY_FILES:%.tely=%),\ +TEXINFO_MANUALS =\ + $(TELY_FILES:%.tely=%)\ + $(TEXI_FILES:%.texi=%) + +SPLITTED_HTML_MANUALS = $(foreach manual, $(TEXINFO_MANUALS),\ $(if $(findstring $(manual), $(UNSPLITTED_HTML_MANUALS)),,$(manual))) OUT_HTML_FILES += $(UNSPLITTED_HTML_MANUALS:%=$(top-build-dir)/Documentation/$(outdir)/%.$(ISOLANG).html) BIG_PAGE_HTML_FILES := $(SPLITTED_HTML_MANUALS:%=$(top-build-dir)/Documentation/$(outdir)/%-big-page.$(ISOLANG).html) DEEP_HTML_FILES := $(SPLITTED_HTML_MANUALS:%=$(top-build-dir)/Documentation/$(outdir)/%/index.$(ISOLANG).html) -PDF_FILES := $(TELY_FILES:%.tely=$(top-build-dir)/Documentation/$(outdir)/%.$(ISOLANG).pdf) +#PDF_FILES := $(TEXINFO_MANUALS:%=$(top-build-dir)/Documentation/$(outdir)/%.$(ISOLANG).pdf) ITELY_FILES := $(call src-wildcard,*.itely) ITEXI_FILES := $(call src-wildcard,*.itexi) @@ -31,18 +36,38 @@ MAKEINFO_FLAGS += --force --enable-encoding $(DOCUMENTATION_INCLUDES) MAKEINFO = LANG= $(MAKEINFO_PROGRAM) $(MAKEINFO_FLAGS) # texi2html xref map files -XREF_MAPS_DIR=$(top-build-dir)/out/xref-maps -XREF_MAPS_FILES=$(TELY_FILES:%.tely=$(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map) +# FIXME: duplicated in stepake/texinfo-vars.make make/doc-i18n-root-vars.make +XREF_MAPS_DIR=$(top-build-dir)/$(outbase)/xref-maps +XREF_MAPS_FILES=$(TEXINFO_MANUALS:%=$(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map) XREF_MAP_FLAGS += -I $(outdir) -# texi2html flags -TEXI2HTML_INIT= --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init -TEXI2HTML_LANG=--lang=$(ISOLANG) -TEXI2HTML_FLAGS += $(TEXI2HTML_LANG) $(DOCUMENTATION_INCLUDES) \ - -I $(XREF_MAPS_DIR) -TEXI2HTML = PERL_UNICODE=SD LANG= $(TEXI2HTML_PROGRAM) +WEB_MANUALS=general + +########### +ifneq ($(ISOLANG),) +TEXI2HTML_LANG = --lang=$(ISOLANG) +endif + +DOC_TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init +WEB_TEXI2HTML_INIT =--init-file=$(top-src-dir)/Documentation/web-texi2html.init +TEXI2HTML_INIT = $(DOC_TEXI2HTML_INIT) + +DOC_TEXI2HTML_SPLIT = --prefix=index --split=section +WEB_TEXI2HTML_SPLIT = --prefix=index --split=node --node-files +TEXI2HTML_SPLIT = $(DOC_TEXI2HTML_SPLIT) + +$(top-build-dir)/Documentation/$(outdir)/general/index.$(ISOLANG).html:\ + TEXI2HTML_INIT = $(WEB_TEXI2HTML_INIT) +$(top-build-dir)/Documentation/$(outdir)/general/index.$(ISOLANG).html:\ + TEXI2HTML_SPLIT := $(WEB_TEXI2HTML_SPLIT) + +TEXI2HTML_INCLUDES += $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR) +TEXI2HTML_FLAGS += $(TEXI2HTML_INCLUDES) $(TEXI2HTML_INIT) $(TEXI2HTML_LANG) +TEXI2HTML = PERL_UNICODE=SD $(TEXI2HTML_PROGRAM) $(TEXI2HTML_FLAGS) +########### TEXI2PDF_FLAGS += --batch $(DOCUMENTATION_INCLUDES) +TEXI2PDF_FLAGS += -I $(LYS_OUTPUT_DIR) ifdef QUIET_BUILD TEXI2PDF_FLAGS += -q diff --git a/python/auxiliar/buildlib.py b/python/auxiliar/buildlib.py index 5ec022e16a..b0bf9cfcc5 100644 --- a/python/auxiliar/buildlib.py +++ b/python/auxiliar/buildlib.py @@ -28,8 +28,9 @@ renames_map = { 'changes.tely': 'topdocs/NEWS.tely', } +# FIXME: Hardcoded file names!? manuals_subdirectories_re = \ - re.compile ('(application|essay|learning|notation)/') + re.compile ('(application|essay|general|learning|notation)/') def add_old_name (file_path): for new_path in renames_map: diff --git a/python/auxiliar/manuals_definitions.py b/python/auxiliar/manuals_definitions.py index 4b548f11e1..d0542b073f 100644 --- a/python/auxiliar/manuals_definitions.py +++ b/python/auxiliar/manuals_definitions.py @@ -6,6 +6,8 @@ references_dict = { 'notation': 'ruser', 'learning': 'rlearning', 'application': 'rprogram', + 'essay': 'ressay', 'snippets': 'rlsr', 'music-glossary': 'rglos', - 'internals': 'rinternals' } + 'internals': 'rinternals', + } diff --git a/python/auxiliar/postprocess_html.py b/python/auxiliar/postprocess_html.py index 3db9fda8d1..9e624e2de2 100644 --- a/python/auxiliar/postprocess_html.py +++ b/python/auxiliar/postprocess_html.py @@ -44,6 +44,12 @@ footer = '''

''' + +web_footer = ''' + +''' + footer_name_version = _doc ('This page is for %(package_name)s-%(package_version)s (%(branch_str)s).') # ugh, must not have "_doc" in strings because it is naively replaced with "_" in hacked gettext process footer_report_links = _doc ('Your suggestions for the documentation are welcome, please report errors to our bug list.') @@ -342,7 +348,10 @@ def process_html_files (package_name = '', ### add footer if footer_tag_re.search (s) == None: - s = add_footer (s, footer_tag + footer) + if 'general' in file_name: + s = add_footer (s, footer_tag + web_footer) + else: + 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) diff --git a/scripts/auxiliar/texi-langutils.py b/scripts/auxiliar/texi-langutils.py index d5666becf8..e9798a6191 100755 --- a/scripts/auxiliar/texi-langutils.py +++ b/scripts/auxiliar/texi-langutils.py @@ -32,7 +32,7 @@ node_blurb = '''@untranslated ''' doclang = '' head_committish = read_pipe ('git rev-parse HEAD') -intro_blurb = '''@c -*- coding: utf-8; mode: texinfo%(doclang)s -*- +intro_blurb = '''\\input texinfo @c -*- coding: utf-8; mode: texinfo%(doclang)s -*- @c This file is part of %(topfile)s @ignore Translation of GIT committish: %(head_committish)s @@ -49,6 +49,8 @@ for x in optlist: if x[0] == '-o': # -o NAME set PO output file name to NAME output_name = x[1] elif x[0] == '-d': # -d DIR set working directory to DIR + print 'FIXME: this is evil. use cd DIR && texi-langutils ...' + # even better, add a sane -o option os.chdir (x[1]) elif x[0] == '-b': # -b BLURB set blurb written at each node to BLURB node_blurb = x[1] @@ -57,7 +59,7 @@ for x in optlist: elif x[0] == '-l': # -l ISOLANG set documentlanguage to ISOLANG doclang = '; documentlanguage: ' + x[1] -texinfo_with_menus_re = re.compile (r"^(\*) +([^:\n]+)::.*?$|^@(include|menu|end menu|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *(.*?)$|@(rglos){(.+?)}", re.M) +texinfo_with_menus_re = re.compile (r"^(\*) +([^:\n]+)::.*?$|^@(afourpaper|author|bye|contents|copying|end copying|divClass|divEnd|divId|documentencoding|documentlanguage|finalout|ifnottex|end ifnottex|imageFloat|imageId|include|menu|end menu|node|quotation|end quotation|ref|rgloss|setfilename|settitle|set|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|titlefont|titlepage|end titlepage|title|subtitle|top|vskip|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading|c) *(([^ \n].*)|$)", re.M) 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) @@ -119,7 +121,10 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu elif item[2] == 'end menu': g.write ('@end menu\n\n') else: - g.write ('@' + item[2] + ' ' + item[3] + '\n') + space = ' ' + if item[3].startswith ('{') or not item[3].strip (): + space = '' + g.write ('@' + item[2] + space + item[3] + '\n') if node_trigger: g.write (n_blurb) node_trigger = False @@ -162,7 +167,15 @@ if make_gettext: node_list.write ('# -*- coding: utf-8 -*-\n') for texi_file in texi_files: # Urgly: scan ly comments and variable names only in English doco - is_english_doc = 'Documentation/user' in texi_file + is_english_doc = ( + True + and not 'Documentation/de/' in texi_file + and not 'Documentation/es/' in texi_file + and not 'Documentation/fr/' in texi_file + and not 'Documentation/ja/' in texi_file + and not 'Documentation/nl/' in texi_file + and not 'Documentation/po/' in texi_file + ) process_texi (texi_file, intro_blurb, node_blurb, make_skeleton, os.path.basename (texi_file), node_list, scan_ly=is_english_doc) diff --git a/scripts/build/extract_texi_filenames.py b/scripts/build/extract_texi_filenames.py index 36adb50ea2..f91bae3982 100644 --- a/scripts/build/extract_texi_filenames.py +++ b/scripts/build/extract_texi_filenames.py @@ -60,6 +60,8 @@ for opt in options_list: if o == '-I' or o == '--include': if os.path.isdir (a): include_path.append (a) + else: + print 'NOT A DIR from: ', os.getcwd (), a elif o == '-o' or o == '--output': outdir = a elif o == '-s' or o == '--split': @@ -93,7 +95,7 @@ def expand_includes (m, filename): filepath = os.path.join (directory, m.group(1)) if os.path.exists (filepath): return extract_sections (filepath)[1] - print "Unable to locate include file " + filepath + print 'No such file: ' + filepath return '' lang_re = re.compile (r'^@documentlanguage (.+)', re.M) diff --git a/scripts/build/www_post.py b/scripts/build/www_post.py index b329390a5d..2df5b38468 100644 --- a/scripts/build/www_post.py +++ b/scripts/build/www_post.py @@ -39,7 +39,7 @@ dirs, symlinks, files = mirrortree.walk_tree ( tree_roots = doc_dirs, process_dirs = outdir, exclude_dirs = '(^|/)((' + \ - r'po|out|out-test|out-cov|.*?[.]t2d|\w*?-root)|^Documentation/(' + \ + r'po|xref-maps|out|out-test|out-cov|.*?[.]t2d|\w*?-root)|^Documentation/(' + \ '|'.join ([l.code for l in langdefs.LANGUAGES]) + '))(/|$)', find_files = r'.*?\.(?:midi|html|pdf|png|txt|i?ly|signature|css|zip)$|VERSION', exclude_files = r'lily-[0-9a-f]+.*\.(pdf|txt)') diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 97256f4c62..5bc1b16848 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -23,32 +23,25 @@ ifneq ($(INFO_IMAGES_DIR),) endif touch $@ -$(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi - $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< - -$(outdir)/lilypond-%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi - $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< +$(outdir)/%.texi: %.texi + cp -p $< $@ -$(outdir)/lilypond.info: general.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi +$(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< $(outdir)/%-big-page.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi - $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) -D bigpage --output=$@ $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) -D bigpage --output=$@ $< $(outdir)/%.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi - $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$@ $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$@ $< $(outdir)/%/index.html: $(outdir)/%.texi $(XREF_MAPS_DIR)/%.xref-map $(outdir)/version.itexi $(outdir)/%.html.omf mkdir -p $(dir $@) - $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$(dir $@) --prefix=index --split=section $(TEXI2HTML_INIT) $< + $(TEXI2HTML) --I=$(src-dir) --I=$(outdir) --output=$(dir $@) $(TEXI2HTML_SPLIT) $< cp $(top-src-dir)/Documentation/css/*.css $(dir $@) - -$(outdir)/%.html.omf: %.texi - $(call GENERATE_OMF,html) - -$(outdir)/%.pdf.omf: %.texi - $(call GENERATE_OMF,pdf) +$(outdir)/%.info: %.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir-dep $(outdir)/version.itexi + $(MAKEINFO) -I$(src-dir) -I$(outdir) --output=$@ $< $(outdir)/%.pdf: $(outdir)/%.texi $(outdir)/version.itexi $(outdir)/%.pdf.omf cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) -I $(abs-src-dir) --batch $(TEXINFO_PAPERSIZE_OPTION) $( $@ diff --git a/stepmake/stepmake/texinfo-vars.make b/stepmake/stepmake/texinfo-vars.make index 1db4b06ef5..c6104cc359 100644 --- a/stepmake/stepmake/texinfo-vars.make +++ b/stepmake/stepmake/texinfo-vars.make @@ -16,18 +16,30 @@ MAKEINFO_FLAGS += --enable-encoding $(DOCUMENTATION_INCLUDES) MAKEINFO = LANG= $(MAKEINFO_PROGRAM) $(MAKEINFO_FLAGS) # texi2html xref map files -XREF_MAPS_DIR = $(top-build-dir)/out/xref-maps +# FIXME: duplicated in stepake/texinfo-vars.make make/doc-i18n-root-vars.make +XREF_MAPS_DIR = $(top-build-dir)/$(outbase)/xref-maps XREF_MAPS_FILES += $(TEXI_FILES:%.texi=$(XREF_MAPS_DIR)/%.xref-map) \ $(TELY_FILES:%.tely=$(XREF_MAPS_DIR)/%.xref-map) XREF_MAP_FLAGS += -I $(outdir) -# texi2html flags +########### ifneq ($(ISOLANG),) TEXI2HTML_LANG = --lang=$(ISOLANG) endif -TEXI2HTML_FLAGS += $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR) -TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init -TEXI2HTML = PERL_UNICODE=SD $(TEXI2HTML_PROGRAM) $(TEXI2HTML_FLAGS) $(TEXI2HTML_LANG) + +DOC_TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init +WEB_TEXI2HTML_INIT =--init-file=$(top-src-dir)/Documentation/web-texi2html.init +TEXI2HTML_INIT = $(DOC_TEXI2HTML_INIT) + +DOC_TEXI2HTML_SPLIT = --prefix=index --split=section +WEB_TEXI2HTML_SPLIT = --prefix=index --split=node --node-files +TEXI2HTML_SPLIT = $(DOC_TEXI2HTML_SPLIT) + +TEXI2HTML_INCLUDES += $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR) +TEXI2HTML_FLAGS += $(TEXI2HTML_INCLUDES) $(TEXI2HTML_INIT) $(TEXI2HTML_LANG) +TEXI2HTML = PERL_UNICODE=SD $(TEXI2HTML_PROGRAM) $(TEXI2HTML_FLAGS) +########### + TEXI2PDF_FLAGS += $(DOCUMENTATION_INCLUDES)