From ed1f57993dc189eedd1aad38cefab57910d0625f Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 14 Aug 2009 16:00:54 +0200 Subject: [PATCH] Doc: fix search box. Feel very grateful for Python. Remember why we banned perl [apart from the fact that is parses (and thus can crash on) comments]. It took me more than an hour to translate '
  • ' + open ('file').read () to seven lines of perl before it worked, including two magic variables, with several solutions failing silently. Ugh. --- Documentation/css/lilypond-web.css | 5 +++++ Documentation/search-box.html | 13 +++++++++++++ Documentation/web-texi2html.init | 23 +++++++++++++++++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 Documentation/search-box.html diff --git a/Documentation/css/lilypond-web.css b/Documentation/css/lilypond-web.css index 0507b1fca9..25035a8c49 100644 --- a/Documentation/css/lilypond-web.css +++ b/Documentation/css/lilypond-web.css @@ -134,6 +134,11 @@ div#tocframe { -webkit-border-bottom-right-radius: 20px; } +#tocframe li form input[type="hidden"] { + visibility: hidden; + background: #f00; +} + #tocframe li a { float: left; width: 18%; diff --git a/Documentation/search-box.html b/Documentation/search-box.html new file mode 100644 index 0000000000..961b6af1d0 --- /dev/null +++ b/Documentation/search-box.html @@ -0,0 +1,13 @@ +
    + + + +
    diff --git a/Documentation/web-texi2html.init b/Documentation/web-texi2html.init index 822f5beaa4..b1d924c9ad 100644 --- a/Documentation/web-texi2html.init +++ b/Documentation/web-texi2html.init @@ -1,6 +1,9 @@ #!/usr/bin/env perl # -*- coding: utf-8; -*- +### WTF, perl cannot read a file? +###use File::Slurp qw( read_file ); + ### texi2html customization script for LilyPond ### Author: Reinhold Kainhofer , 2008. ### Some code parts copied from texi2html and adapted. These functions @@ -619,8 +622,24 @@ sub lilypond_generate_page_toc_body($) push (@toc_entries, generate_ly_toc_entries($_, \%parentelements, $page_toc_depth)); } if (!exists($main::value{'shallow_toc'})) { -# FIXME: add search entry box - push (@toc_entries, "
  • \n"); +# WTF, perl needs 6 lines of magic to do: ' ' + open ('file-name').read ()? + local $/=undef; + my $name = 'search-box.html'; + open FILE, $name or open FILE, "../$name" or die die "no such file: $name: $!"; + +# All these also seems to work, but fail silently. Great, it runs! +# It's late already, let's this broken site. + +# push (@toc_entries, '
  • \n' + + '
  • \n'); +# push (@toc_entries, '
  • \n' . . '
  • \n'); +# my $string = '
  • \n' + + '
  • \n'; +# my $string = '
  • \n' + + '
  • \n'; +# my $string = '
  • \n' . . '
  • \n'; + my $string = ; +# $string = '
  • \n' + $string + '
  • \n'; + $string = "
  • \n" . $string . "
  • \n"; + push (@toc_entries, $string); + close FILE; } push (@toc_entries, "\n"); #FIXME -- 2.39.5