summaryrefslogtreecommitdiff
path: root/scripts/build/www_post.py
diff options
context:
space:
mode:
authorReinhold Kainhofer <reinhold@kainhofer.com>2010-04-11 18:21:05 +0200
committerGraham Percival <graham@percival-music.ca>2010-05-28 11:40:56 +0100
commite80874f5c742381c834772cc13ca8c2fa115a712 (patch)
treea0435bd071bf69f16639484dcb3fdf5682e41766 /scripts/build/www_post.py
parent3720c7a19661ccec86ae05e0b6421620690ec4a2 (diff)
Docs: Add AJAX search field to the docs
-) Add a search field to the toc pane in our docs. If the user types three letters or more, an AJAX request is sent to the server to perform a search. The AJAX part is implemented in JS, the search part itself is implemented in PHP on the server side, which wades through a pre-generated index file (pure text). -) The texi2html init file now has the ability to create our own search index file, currently in pure text (the search script will go through it line for line. -) The search box is shown via JavaScript only if the files are viewed over http. If the user has JavaScript disabled or if the files are viewed as static pages (and not over http), then no search box appears, since it would not work anyway. -) Also, don't show search box when AJAX initialization failed. -) Print nice message if search index can't be opened, don't fail with error -) Install and use language-dependent index files for all known languages -) If we don't have a texinfo index, don't load the JS and don't print out the search box. (Workaround: css_lines is called before init_out, so we need to do the check already in css_lines!) If the index would be empty, don't create an empty .idx file -) If AJAX works and a user presses enter, the same AJAX query is triggered as when entering some letters, and the results appear on the same page. However, if for some reason AJAX does not work (in particular, if the onSubmit action handler isn't called), then a search page is loaded with the same results as the AJAX query...
Diffstat (limited to 'scripts/build/www_post.py')
-rw-r--r--scripts/build/www_post.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/build/www_post.py b/scripts/build/www_post.py
index a9ab88cd3e..17af63109e 100644
--- a/scripts/build/www_post.py
+++ b/scripts/build/www_post.py
@@ -41,7 +41,7 @@ dirs, symlinks, files = mirrortree.walk_tree (
exclude_dirs = '(^|/)((' + \
r'po|xref-maps|out|out-test|out-cov|.*?[.]t2d|\w*?-root)|^Documentation/(' + \
'|'.join ([l.code for l in langdefs.LANGUAGES]) + '))(/|$)',
- find_files = r'.*?\.(?:midi|html|pdf|png|jpe?g|txt|i?ly|signature|css|zip)$|VERSION',
+ find_files = r'.*?\.(?:midi|html|pdf|png|jpe?g|txt|i?ly|signature|css|zip|js|..\.idx|php)$|VERSION',
exclude_files = r'lily-[0-9a-f]+.*\.(pdf|txt)')
# actual mirrorring stuff