]> git.donarmstrong.com Git - lilypond.git/commitdiff
Build: hackily add bibliography.
authorGraham Percival <graham@percival-music.ca>
Fri, 22 Jan 2010 00:18:18 +0000 (00:18 +0000)
committerGraham Percival <graham@percival-music.ca>
Fri, 22 Jan 2010 18:45:35 +0000 (18:45 +0000)
This is quite yucky, but it's taken over an hour and frankly
nobody's complained that the bibliography has been broken for a
year, so I'm inclined just to go with this.

Documentation/GNUmakefile
Documentation/essay/literature.itely
scripts/build/html-to-texi.py [new file with mode: 0644]

index 9592e548c513145fb4adc656e0b8fe436fddc1d7..d2a4eb2f58345f5ccb5c9cf1bb0eb6750079a998 100644 (file)
@@ -100,6 +100,26 @@ $(outdir)/ROADMAP:
        cp $(top-src-dir)/ROADMAP $(outdir)
 $(outdir)/contributor.texi: $(outdir)/ROADMAP
 
+### bad hack for badly-integrated bibliography
+$(outdir)/engravingbib.itexi:
+       BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2html \
+               -o $(outdir)/colorado.html \
+               $(src-dir)/essay/colorado.bib
+       $(buildscript-dir)/html-to-texi \
+               < $(outdir)/colorado.html > $(outdir)/colorado.itexi
+       BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2html \
+               -o $(outdir)/computer-notation.html \
+               $(src-dir)/essay/computer-notation.bib
+       $(buildscript-dir)/html-to-texi \
+               < $(outdir)/computer-notation.html > $(outdir)/computer-notation.itexi
+       BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2html \
+               -o $(outdir)/engravingbib.html \
+               $(src-dir)/essay/engravingbib.bib
+       $(buildscript-dir)/html-to-texi \
+               < $(outdir)/engravingbib.html > $(outdir)/engravingbib.itexi
+
+$(outdir)/essay.texi: $(outdir)/engravingbib.itexi
+
 
 ###########
 ### Targets
index 3479046b4ab4965cc9b9491c6b4a5c02b373ee46..2ebc7a300da37b8f85db94f1d5445748eed89f3c 100644 (file)
 @node Literature list
 @chapter Literature list
 
+FIXME: blah
+
+@menu
+* Short literature list::
+* Long literature list::
+@end menu
+
+@node Short literature list
+@section Short literature list
+
+
 If you need to know more about music notation, here are some
 interesting titles to read.
 
@@ -69,17 +80,19 @@ practices.
 
 @end table
 
-The source archive includes a more elaborate Bib@TeX{} bibliography of
-over 100 entries in
-@ifhtml
-@ifset bigpage
-@uref{../bibliography/index.html, the bibliography}.
-@end ifset
-@ifclear bigpage
-@uref{../../bibliography/index.html, the bibliography}.
-@end ifclear
-@end ifhtml
-@ifnothtml
-@file{Documentation/@/bibliography/}.
-@end ifnothtml
+
+@node Long literature list
+@section Long literature list
+
+@subheading Colorado
+
+@include colorado.itexi
+
+@subheading Computer notation
+
+@include computer-notation.itexi
+
+@subheading Engraving
+
+@include engravingbib.itexi
 
diff --git a/scripts/build/html-to-texi.py b/scripts/build/html-to-texi.py
new file mode 100644 (file)
index 0000000..520c3ec
--- /dev/null
@@ -0,0 +1,94 @@
+#! @PYTHON@
+
+import re
+import sys
+
+header = '''
+'''
+
+print header
+
+body = sys.stdin.read ()
+body = re.sub ('(?ms)<!--\s*\n*(.*?)FILL-IN(.*?)\s*\n*!?-->', '', body)
+body = re.sub ('(?ms)\n*\s*<!--\s*\n*(.*?)\s*\n*!?-->', r'@ignore\n\1\n@end ignore', body)
+body = re.sub ('(?ms)<a(?:\s|\n)*href="([^"]*)"\s*>(.*?)</a>', r'@ref{\1,\2}', body)
+
+body = re.sub ('(?ms)<a(?:\s|\n)*name="([^"]*)"\s*> *</a>', r'@node \1 ', body)
+body = re.sub ('(?ms)<h1>(.*?)</h1>', r'@chapheading \1', body)
+body = re.sub ('(?ms)<h2>(.*?)</h2>', r'@unnumberedsec \1', body)
+#body = re.sub ('(?ms)<a(?:\s|\n)*name="([^"]*)"\s*> *</a>', '', body)
+#body = re.sub ('(?ms)<h2>(.*?)</h2>', r'@node \1\n@unnumberedsec \1', body)
+
+body = re.sub ('(?ms)<img(?:\s|\n)*[^>]*src="*([^">]*)(.png|.jpeg)"*.*?>', r'@image{\1,,,\2}', body)
+body = re.sub ('\n*<br>\s*\n*', r'@*\n', body)
+body = re.sub ('\n*<br[^>]*>\s*\n*', r'@*\n', body)
+body = re.sub ('(?ms)<em>(.*?)</em>', r'@emph{\1}', body)
+body = re.sub ('(?ms)<blockquote>(.*?)</blockquote>', r'@quote{\1}', body)
+body = re.sub ('(?ms)<tt>(.*?)</tt>', r'@code{\1}', body)
+body = re.sub ('(?ms)<li>(.*?)(</li>)', r'@item\n\1\n', body)
+body = re.sub ('(?ms)<li>(.*?)(<li>)', r'@item\n\1\n\2', body)
+body = re.sub ('(?ms)<li>(.*?)(<li>)', r'@item\n\1\n\2', body)
+body = re.sub ('(?ms)<li>(.*?)(<li>)', r'@item\n\1\n\2', body)
+body = re.sub ('(?ms)<li>(.*?)(<li>)', r'@item\n\1\n\2', body)
+body = re.sub ('(?ms)<li>(.*?)(<li>)', r'@item\n\1\n\2', body)
+body = re.sub ('(?ms)<li>(.*?)(</(?:u|o)l>)', r'@item\n\1\n\2', body)
+body = re.sub ('(?ms)<ul>', r'@itemize', body)
+body = re.sub ('(?ms)</ul>', r'@end itemize', body)
+
+# added for the bib => bib2html => html2texinfo chain.  -gp
+body = re.sub ('(?ms)<HTML>', r'', body)
+body = re.sub ('(?ms)<HEAD>(.*?)(</HEAD>)', r'', body)
+body = re.sub ('(?ms)<BODY(.*?)>', r'', body)
+body = re.sub ('(?ms)</BODY>', r'', body)
+body = re.sub ('(?ms)</HTML>', r'', body)
+
+body = re.sub ('(?ms)<DL>', r'@table @emph', body)
+body = re.sub ('(?ms)</DL>', r'@end table', body)
+
+body = re.sub ('(?ms)<DT> <A NAME="(.*?)">(.*?)(</DT>)', r'@item \1', body)
+body = re.sub ('(?ms)<A(.*?)>', r'', body)
+body = re.sub ('(?ms):</A>', r'', body)
+body = re.sub ('(?ms)<DD>(.*?)(</DD>)', r'\1', body)
+
+body = re.sub ('(?ms)<STRONG>(.*?)(</STRONG>)', r'@strong{\1}', body)
+body = re.sub ('(?ms)<EM>(.*?)(</EM>)', r'@emph{\1}', body)
+
+body = re.sub ('(?ms)&nbsp', r'@tie{}', body)
+
+body = re.sub ('(?ms)\cite{(.*?)}', r'[\1]', body)
+body = re.sub ('(?ms)\cite{(.*?)}', r'[\1]', body)
+
+# dangerous rule, but with the spaces should be ok
+body = re.sub ('(?ms) {(.*?)} ', r' @q{\1} ', body)
+
+# end stuff added for the bib => bib2html => html2texinfo chain -gp
+# the other lines in the file can _probably_ be trimmed.
+
+
+body = re.sub ('(?ms)<ol>', r'@enumerate POSITIVE-INTEGER', body)
+body = re.sub ('(?ms)<ol\s+start="*(.*?)"*>', r'@enumerate \1', body)
+body = re.sub ('(?ms)</ol>', r'@end enumerate', body)
+
+body = re.sub ('&ldquo;(.*?)&rdquo;', r'@qq{\1}', body)
+body = re.sub ('&auml;', '@"a', body)
+body = re.sub ('(?ms)\s*<p>\s*', '\n\n', body)
+body = re.sub ('\n*\s*</p>\s*\n*', '\n\n', body)
+body = re.sub ('(?ms)</?font\s*.*?>', '', body)
+body = re.sub ('(?ms)<code>(.*?)</code>', r'@code{\1}', body)
+body = re.sub ('(?ms)<em>(.*?)</em>', r'@emph{\1}', body)
+body = re.sub ('(?ms)<b>(.*?)</b>', r'@strong{\1}', body)
+body = re.sub ('(?ms)<pre>(.*?)</pre>', r'@verbatim\n\1\n@end verbatim', body)
+body = re.sub ('(?ms)<PRE>(.*?)</PRE>', r'@verbatim\n\1\n@end verbatim', body)
+
+body = re.sub ('(?ms)<table>', r'@table asis', body)
+body = re.sub ('(?ms)<table [^>]*>', r'@table asis', body)
+body = re.sub ('(?ms)</table>', r'@end table', body)
+body = re.sub ('(?ms)<tr>(.*?)</tr>', r'@item\n\1\n', body)
+body = re.sub ('(?ms)<th>(.*?)</th>', r'@item\n\1\n', body)
+body = re.sub ('(?ms)<td[^>]*>(.*?)</td>', r'@tab\n\1\n', body)
+
+#body = re.sub ('(?ms)\s*<p align="(center|left|right)">\s*((?:.|\n)*)\n\n', '@divClass{float-\\1}\n\\2\n@divEnd', body)
+body = re.sub ('(?ms)\s*<p align="(center|left|right)"\s*>\s*', '\n\n@divClass{float-\\1}\n@divEnd\n', body)
+
+print body
+