From e9e0cf59085cb3b3d77c8a2962fd8b80ac4d0c9d Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 19 Jun 2011 15:43:41 +0000 Subject: [PATCH] Manual: add search box to HTML output. To allow easy searching the HTML (multi page) output add a search box that queries Google. The Google search will get restricted to the location the manual is stored. Google seems to happily accept a subfolder when specifying a domain to search. For this to work the search box has to be created dynamically with the help of a bit JavaScript. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30017 a1c6a512-1295-4272-9138-f99709370657 --- manual/Makefile.pdflatex | 1 + manual/gsearch.js | 11 +++++++++++ manual/rockbox-html.cfg | 11 +++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 manual/gsearch.js diff --git a/manual/Makefile.pdflatex b/manual/Makefile.pdflatex index b5e30dedf6..c351f82fb5 100644 --- a/manual/Makefile.pdflatex +++ b/manual/Makefile.pdflatex @@ -17,6 +17,7 @@ buildmanual: rockbox-build.tex pdf buildhtml: rockbox-build.tex @mkdir -p $(OBJDIR)/html @$(HTLATEX) $(DOCUMENT) "$(HTOPTS1),$(SPLITHTML)" $(HTOPTS2) $(HTOPTS3) + @cp --parent `cat $(OBJDIR)/html/*.html | sed -e '/\.js/!d;s/.*\"\(.*\.js\)\".*/\1/g;/' + + 'Search this manual ' + + '' + + '' + + '' + + ''; +} diff --git a/manual/rockbox-html.cfg b/manual/rockbox-html.cfg index 284bcb36e4..2572125887 100644 --- a/manual/rockbox-html.cfg +++ b/manual/rockbox-html.cfg @@ -12,9 +12,16 @@ div.center { margin-left:auto; margin-right:auto; } .fancyvrb { background-color:\#c6d6f5; } table.multicols { width:95\%; margin-left:auto; margin-right:auto; text-align:justify; } .crosslinks { color:\#ffffff; text-align:center; background-color:\#6887bb; padding:8px; } -div.crosslinks>p>a { color:\#ffffff; } +div.crosslinks>a { color:\#ffffff; } hr { display:none; } } \EndPreamble \Configure{Link}{a}{href=}{name=}{} - +\Configure{@HEAD}{\HCode{}} +\Configure{BODY}{\HCode{}}{\HCode{}} +\Configure{crosslinks*}{next}{up}{prev}{} +\Configure{crosslinks+}% +{\HCode{
Enable JavaScript to show search field.
}}% +{\HCode{}}