From aa173e6500da51f4de34d331547d182a59e5dcf1 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 18 Aug 2010 15:36:57 +0100 Subject: [PATCH] Build: bib2html+html2texi => bib2texi. Partial fix for 1162. --- Documentation/GNUmakefile | 29 ++++---- .../essay/{html-long.bst => texi-long.bst} | 66 ++++++++++--------- scripts/build/{bib2html.py => bib2texi.py} | 12 ++-- 3 files changed, 55 insertions(+), 52 deletions(-) rename Documentation/essay/{html-long.bst => texi-long.bst} (95%) rename scripts/build/{bib2html.py => bib2texi.py} (88%) diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 62db037332..ac3ee69fc0 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -111,24 +111,25 @@ $(outdir)/ROADMAP: $(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 \ +$(outdir)/colorado.itexi: + BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \ + -o $(outdir)/colorado.itexi \ $(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 \ + +$(outdir)/computer-notation.itexi: + BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \ + -o $(outdir)/computer-notation.itexi \ $(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 \ + +$(outdir)/engravingbib.itexi: + BSTINPUTS=$(src-dir)/essay $(buildscript-dir)/bib2texi \ + -o $(outdir)/engravingbib.itexi \ $(src-dir)/essay/engravingbib.bib - $(buildscript-dir)/html-to-texi \ - < $(outdir)/engravingbib.html > $(outdir)/engravingbib.itexi -$(outdir)/essay.texi: $(outdir)/engravingbib.itexi +$(outdir)/essay.texi: \ + $(outdir)/colorado.itexi \ + $(outdir)/computer-notation.itexi \ + $(outdir)/engravingbib.itexi ########### diff --git a/Documentation/essay/html-long.bst b/Documentation/essay/texi-long.bst similarity index 95% rename from Documentation/essay/html-long.bst rename to Documentation/essay/texi-long.bst index e01f1fa51a..112ac042e1 100644 --- a/Documentation/essay/html-long.bst +++ b/Documentation/essay/texi-long.bst @@ -1,5 +1,9 @@ +% 18/aug/2010: +% - changed into texi-long.bst by Graham Percival for GNU LilyPond +% - only a minimum of changes were made; some html remains in +% this file, but it does not appear in our output % BibTeX bibliography style `html-long' -% spits out HTML-formatted bibliography in place of bbl output +% spits out texinfo-formatted bibliography in place of bbl output % by David Kotz dfk@cs.dartmouth.edu % $Id: html-long.bst,v 1.4 2005/07/21 21:29:50 hjunes Exp $ % modified from @@ -95,19 +99,18 @@ FUNCTION {output.check} } % DFK changed to use cite$ for the label -% DFK changed to HTML, and use URL to make cite key a link +% DFK changed to texinfo, and use URL to make cite key a link FUNCTION {output.bibitem} { newline$ URL empty$ - { "
" * cite$ * ":
" * write$ + { "@item @code{[" cite$ * "]} " * write$ newline$ } - { "
" * cite$ * ":
" * write$ } if$ newline$ - "
" write$ newline$ +% "" write$ newline$ "" before.all 'output.state := } @@ -131,7 +134,7 @@ FUNCTION {fin.entry} ">" * later * "." * write$ newline$ } if$ - "
" write$ newline$ +% "" write$ newline$ } FUNCTION {new.block} @@ -209,19 +212,19 @@ FUNCTION {field.or.null} if$ } -% DFK changed to HTML +% DFK changed to texinfo FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } - { "" swap$ * "" * } + { "@emph{" swap$ * "}" * } if$ } -% DFK added for HTML strong emphasis +% DFK added for texinfo strong emphasis FUNCTION {strong} { duplicate$ empty$ { pop$ "" } - { "" swap$ * "" * } + { "@strong{" swap$ * "}" * } if$ } @@ -234,14 +237,14 @@ FUNCTION {author.title.purify} { 't := "" { t empty$ not } - { t #1 #1 substring$ "{" = + { t #1 #1 substring$ "{" = t #1 #1 substring$ "}" = or - 'skip$ + 'skip$ { t #1 #1 substring$ "~" = - { " " * } - { t #1 #1 substring$ * } - if$ - } + { " " * } + { t #1 #1 substring$ * } + if$ + } if$ t #2 global.max$ substring$ 't := } @@ -533,7 +536,8 @@ FUNCTION {format.article.crossref} } { "In " key * } if$ - " \cite{" * crossref * "}" * +% " \cite{" * crossref * "}" * + " [" * crossref * "]" * } FUNCTION {format.crossref.editor} @@ -579,7 +583,8 @@ FUNCTION {format.book.crossref} } { format.crossref.editor * } if$ - " \cite{" * crossref * "}" * +% " \cite{" * crossref * "}" * + " [" * crossref * "]" * } FUNCTION {format.incoll.inproc.crossref} @@ -600,7 +605,8 @@ FUNCTION {format.incoll.inproc.crossref} } { "In " format.crossref.editor * } if$ - " \cite{" * crossref * "}" * +% " \cite{" * crossref * "}" * + " [" * crossref * "]" * } @@ -617,12 +623,12 @@ FUNCTION {format.quotedParagraph} % DFK added, to support comment, private, keyword, etc % next-to-top is field name (eg, "Comment") % top is field value (eg, value of comment) -% both are popped; resulting top is either empty, +% both are popped; resulting top is either empty, % or string describing field FUNCTION {format.dfkfield} { duplicate$ empty$ { pop$ pop$ "" } - { swap$ + { swap$ " " swap$ * ": " * swap$ * } if$ } @@ -1348,13 +1354,10 @@ ITERATE {forward.pass} REVERSE {reverse.pass} % DFK removed code about et.al.char -% DFK changed to HTML +% DFK changed to texinfo FUNCTION {begin.bib} -{ "" write$ newline$ - " Bibliography " write$ newline$ - "" write$ newline$ - "" write$ newline$ - "
" write$ newline$ +{ "@c bib -> itexi intro" write$ newline$ + "@itemize" write$ newline$ } EXECUTE {begin.bib} @@ -1363,12 +1366,11 @@ EXECUTE {init.state.consts} ITERATE {call.type$} -% DFK changed to HTML +% DFK changed to texinfo FUNCTION {end.bib} { newline$ - "
" write$ newline$ - "" write$ newline$ - "" write$ newline$ + "@end itemize" write$ newline$ + "@c bib -> itexi end" write$ newline$ } EXECUTE {end.bib} diff --git a/scripts/build/bib2html.py b/scripts/build/bib2texi.py similarity index 88% rename from scripts/build/bib2html.py rename to scripts/build/bib2texi.py index 8434cbfb54..51b7d7b6f4 100644 --- a/scripts/build/bib2html.py +++ b/scripts/build/bib2texi.py @@ -10,7 +10,7 @@ def usage (): (options, files) = getopt.getopt (sys.argv[1:], 's:o:', []) -output = 'bib.html' +output = 'bib.itexi' style = 'long' for (o,a) in options: @@ -45,13 +45,13 @@ for f in files: files = ','.join (nf) -tmpfile = tempfile.mkstemp ('bib2html')[1] +tmpfile = tempfile.mkstemp ('bib2texi')[1] open (tmpfile + '.aux', 'w').write (r''' -\relax +\relax \citation{*} -\bibstyle{html-%(style)s} -\bibdata{%(files)s}''' % vars ()) +\bibstyle{texi-%(style)s} +\bibdata{%(files)s}''' % vars ()) tmpdir = tempfile.gettempdir () @@ -63,7 +63,7 @@ if stat <> 0: sys.exit(1) -#TODO: do tex -> html on output +#TODO: do tex -> itexi on output bbl = open (tmpfile + '.bbl').read () -- 2.39.2