From 7843f51909dd4d8612da356675a7ae22404a4dda Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 20:10:58 +0000 Subject: [PATCH] lilypond-0.1.61 --- Documentation/tex/Makefile | 7 +++-- bin/ls-latex.py | 64 +++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 10 deletions(-) diff --git a/Documentation/tex/Makefile b/Documentation/tex/Makefile index 8d2ea583d9..34befe747b 100644 --- a/Documentation/tex/Makefile +++ b/Documentation/tex/Makefile @@ -11,5 +11,8 @@ EXTRA_DISTFILES= $(BIBFILES) $(DOCFILES) dvi: $(DVIFILES) -local-WWW: $(OUTDOCFILES:.doc=.ps.gz) - ls-latex --extension .ps.gz $(DOCFILES) > $(outdir)/index.html +local-WWW: $(OUTDOCFILES:.doc=.ps.gz) $(addprefix $(outdir)/, $(BIBFILES)) + ls-latex --title 'LaTeX documents about LilyPond' --extension .ps.gz $(BIBFILES) $(DOCFILES) > $(outdir)/index.html + +$(outdir)/%.bib: %.bib + ln $< $@ diff --git a/bin/ls-latex.py b/bin/ls-latex.py index 1f53bb81f5..13b413fc7b 100644 --- a/bin/ls-latex.py +++ b/bin/ls-latex.py @@ -47,24 +47,63 @@ def read_latex_header (fn): if latex_title_re.search (s) == -1: raise 'huh?' header.title = latex_title_re.group (1) + header.outfile = regsub.gsub ('\.doc+$', '.ps.gz', fn) return header + +bib_author_re = regex.compile('% *AUTHOR *= *\(.*\)$') +bib_title_re = regex.compile('% *TITLE *= *\(.*\)$') + +def bib_header (fn): + s = gulp_file (fn) + if bib_author_re.search (s) == -1 : + raise 'huh?' + + header = Latex_head() + header.filename= fn; + header.author = bib_author_re.group (1) + if bib_title_re.search (s) == -1: + raise 'huh?' + header.title = bib_title_re.group (1) + header.outfile = fn + return header + + +def read_pod_header (fn): + header = Latex_head () + s = gulp_file (fn) + i = regex.search( '[^\n \t]', s) + s = s[i:] + i = regex.search( '\n\n', s) + s = s[i+2:] + if i < 0: + raise 'huh?' + i = regex.search( '\n\n', s) + header.title = s[:i] + header.filename = fn + header.outfile = regsub.gsub ('\.pod$', '.html', fn) + return header + + def print_html_head (l,o,h): - (pre, ext) = o - out = regsub.gsub ('\.[^.]+$', ext, h.filename) - l.write ('
  • %s

    by %s

    ' % (pre + out, h.title, h.author )) - l.write ('
  • ') + pre =o + + l.write ('
  • %s' % (pre + h.outfile, h.title )) + if h.author: + l.write ('

    by %s

    ' % h.author) + l.write ('
  • \n') import getopt (cl_options, files) = getopt.getopt(sys.argv[1:], - 'e:h', ['help', 'prefix=' ,'extension=']) + 'e:h', ['help', 'prefix=' ,'extension=' + , 'title=']) tex = '' output ='' pre = '' - +title = '' for opt in cl_options: o = opt[0] a = opt[1] @@ -72,11 +111,20 @@ for opt in cl_options: ext = a if o == '--prefix' or o == '-p': pre = a + if o == '--title' or o == '-t': + title = a l = sys.stdout -l.write ('TeX documents

    TeX documents