mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Restore correct parallel search index building (#11192)
Revertb32841e153
to fix parallel search index building The image-related changes were already reverted in2a7c40d07f
, but the search index changes also need to be reverted. It would be nice to support parallel search index building, but the necessary support for merging the search indices produced by each process needs to be added first.
This commit is contained in:
parent
cfd43d4dbe
commit
44684e1654
@ -655,10 +655,6 @@ class StandaloneHTMLBuilder(Builder):
|
||||
}
|
||||
|
||||
def write_doc(self, docname: str, doctree: nodes.document) -> None:
|
||||
title_node = self.env.longtitles.get(docname)
|
||||
title = self.render_partial(title_node)['title'] if title_node else ''
|
||||
self.index_page(docname, doctree, title)
|
||||
|
||||
destination = StringOutput(encoding='utf-8')
|
||||
doctree.settings = self.docsettings
|
||||
|
||||
@ -678,6 +674,9 @@ class StandaloneHTMLBuilder(Builder):
|
||||
def write_doc_serialized(self, docname: str, doctree: nodes.document) -> None:
|
||||
self.imgpath = relative_uri(self.get_target_uri(docname), self.imagedir)
|
||||
self.post_process_images(doctree)
|
||||
title_node = self.env.longtitles.get(docname)
|
||||
title = self.render_partial(title_node)['title'] if title_node else ''
|
||||
self.index_page(docname, doctree, title)
|
||||
|
||||
def finish(self) -> None:
|
||||
self.finish_tasks.add_task(self.gen_indices)
|
||||
|
@ -286,3 +286,10 @@ def test_nosearch(app):
|
||||
assert 'latex' not in index['terms']
|
||||
assert 'zfs' in index['terms']
|
||||
assert index['terms']['zfs'] == [] # zfs on nosearch.rst is not registered to index
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='search', parallel=3, freshenv=True)
|
||||
def test_parallel(app):
|
||||
app.build()
|
||||
index = load_searchindex(app.outdir / 'searchindex.js')
|
||||
assert index['docnames'] == ['index', 'nosearch', 'tocitem']
|
||||
|
Loading…
Reference in New Issue
Block a user