]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.64
authorfred <fred>
Sun, 24 Mar 2002 20:11:50 +0000 (20:11 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:11:50 +0000 (20:11 +0000)
Documentation/Makefile
bin/table-to-html.py [new file with mode: 0755]

index c3cf69814f6c12d3f9c274a0a0a39a4b640fd894..e8fe751ce96a2fdd846bbc78e8319634991afac6 100644 (file)
@@ -22,10 +22,10 @@ include ./$(depth)/make/Docrules.make
 
 
 #
+DATAFILES = $(wildcard *.data)
 TEXTFILES = $(OUTPODFILES:.pod=$(DOTTEXT))
 GROFFFILES = $(OUTPODFILES:.pod=.1)
-HTMLFILES = $(OUTPODFILES:.pod=.html)
-
+HTMLFILES = $(OUTPODFILES:.pod=.html) $(datafiles)
 
 default: do-doc
 
@@ -37,24 +37,21 @@ giffiles = $(addprefix $(outdir)/,$(XPMS:.xpm=.gif))
 
 gifs: $(giffiles)
 
-EXTRA_DISTFILES = $(XPMS)   vocabulary-data vocabulary-forms.el  automake.urgh\
+datafiles = $(addprefix $(outdir)/,$(DATAFILES:.data=.html))
+
+EXTRA_DISTFILES = $(XPMS) vocabulary.data vocabulary-forms.el  automake.urgh\
        gnu-music-history
 
 # don't do DVI files. They can only be made if lily is installed
-do-doc: ugh-mutopia $(TEXTFILES)
+do-doc: $(TEXTFILES)
 
 readme-topfiles:
        cd $(depth); for i in $(README_TOPFILES); do \
-       ln -f $$i Documentation/$(outdir); done
-
-$(outdir)/%$(DOTTEXT): $(depth)/%$(DOTTEXT)
-       rm -f $@
-       ln $< $@
+       ln -f $$i Documentation/$(outdir)/$$i$(DOTTEXT); done
 
 README_TOPFILES=NEWS DEDICATION TODO ANNOUNCE-0.1
 README_TXTFILES=$(addprefix $(outdir)/,$(addsuffix $(DOTTEXT), $(README_TOPFILES)))
 
-#local-WWW: $(HTMLFILES) $(README_TXTFILES)  $(giffiles)
 local-WWW: $(HTMLFILES) readme-topfiles $(README_TXTFILES) $(giffiles)
 
 # generic targets and rules:
@@ -63,10 +60,8 @@ include $(depth)/make/Targets.make
 include $(depth)/make/Rules.make
 
 # ugh
-check-doc-deps:
-       @echo hi
+check-doc-deps: do-doc
+       @echo hi
 
 doc: do-doc
 
-ugh-mutopia: $(outdir)/mutopia.1
-       troff -man -Tascii $< | grotty -b -u -o > $(outdir)/mutopia$(DOTTEXT)
diff --git a/bin/table-to-html.py b/bin/table-to-html.py
new file mode 100755 (executable)
index 0000000..bc4bc71
--- /dev/null
@@ -0,0 +1,92 @@
+#!@PYTHON@
+
+# 
+# table-to-html.py -- convert char-separated table to html table
+# 
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 1998 Jan Nieuwenhuizen <jan@digicash.com>
+# 
+
+import getopt
+from string import *
+import regex
+import regsub
+import os
+import sys
+import time
+
+version = '0.1'
+
+lilypath =''
+try:
+       lilypath = os.environ['LILYPOND_SOURCEDIR'] + '/'
+except KeyError:
+       try:
+               lilypath = os.environ['top_srcdir'] + '/'
+       except KeyError:
+           print 'Please set LILYPOND_SOURCEDIR to the toplevel source, eg LILYPOND_SOURCEDIR=/home/foobar/lilypond-1.2.3/'
+
+lilypath = lilypath + '/bin/'
+sys.path.append (lilypath)
+from flower import *
+
+def program_id ():
+    return 'table-to-html.py version ' + version;
+
+def identify ():
+    sys.stdout.write (program_id () + '\n')
+    
+def help ():
+    sys.stdout.write ("Usage: table-to-html [options] TABLE_FILE HTML_FILE\n"
+                + "Generate mozarella metrics table from preparated feta log\n\n"
+                + "Options:\n"
+                + "  -h, --help             print this help\n"
+                + "  -s, --separator=SEP    specify separator [:]\n")
+    sys.exit (0)
+
+
+def header (html):
+    html.write ('<body><table cellspacing=10>')
+
+def footer (html):
+    html.write ('</table></body>')
+
+def convert (inname, outname, separator):
+    table = File (inname)
+    # ugh
+    html = File (outname, 'w')
+
+    header (html)
+    while not table.eof ():
+       line = table.readline ()
+       columns = split (line, separator)
+       html_line = '<tr><td>' + join (columns, '</td><td>') + '</td></tr>'
+       html.write (html_line)
+    table.close ()
+    footer (html)
+    html.close ()
+
+
+def main ():
+    identify ()
+    (options, files) = getopt.getopt (
+       sys.argv[1:], 'hs:', ['help','separator='])
+
+    separator = ':'
+    for opt in options:
+       o = opt[0]
+       a = opt[1]
+       if o == '--separator' or o == '-s':
+           separator = a
+       elif o== '--help' or o == '-h':
+           help ()
+       else:
+           print o
+           raise getopt.error
+
+    convert (files[0], files[1], separator)
+
+main ()
+