summaryrefslogtreecommitdiff
path: root/sphinx/builders
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-04 12:40:19 +0100
committerGeorg Brandl <georg@python.org>2011-01-04 12:40:19 +0100
commit59fd20fdc35e353b362c799b8367ffd78608c40c (patch)
treec00ea96a3fa8d857e3b262d4b33951850dea836a /sphinx/builders
parent77eedbb984a5ba6658625bbe605d9756ce410cb7 (diff)
downloadsphinx-59fd20fdc35e353b362c799b8367ffd78608c40c.tar.gz
#273: Add an API for adding full-text search support for languages other than English. Add support for Japanese.
Based on the implementation by SHIBUKAWA Yoshiki in https://bitbucket.org/shibu/sphinx/.
Diffstat (limited to 'sphinx/builders')
-rw-r--r--sphinx/builders/html.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index f2801499..ace4dd01 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -539,13 +539,18 @@ class StandaloneHTMLBuilder(Builder):
if jsfile:
copyfile(jsfile, path.join(self.outdir, '_static',
'translations.js'))
+
+ # add context items for search function used in searchtools.js_t
+ ctx = self.globalcontext.copy()
+ ctx.update(self.indexer.globalcontext_for_searchtool())
+
# then, copy over theme-supplied static files
if self.theme:
themeentries = [path.join(themepath, 'static')
for themepath in self.theme.get_dirchain()[::-1]]
for entry in themeentries:
copy_static_entry(entry, path.join(self.outdir, '_static'),
- self, self.globalcontext)
+ self, ctx)
# then, copy over all user-supplied static files
staticentries = [path.join(self.confdir, spath)
for spath in self.config.html_static_path]
@@ -558,7 +563,7 @@ class StandaloneHTMLBuilder(Builder):
self.warn('html_static_path entry %r does not exist' % entry)
continue
copy_static_entry(entry, path.join(self.outdir, '_static'), self,
- self.globalcontext, exclude_matchers=matchers)
+ ctx, exclude_matchers=matchers)
# copy logo and favicon files if not already in static path
if self.config.html_logo:
logobase = path.basename(self.config.html_logo)