Skip to content

Can not use the new static search in PyDPF #564

@jorgepiloto

Description

@jorgepiloto

In this pull-request on PyDPF, the CI/CD complains about:

 Handler <function create_search_index at 0x000001AA03F281F0> for event 'build-finished' threw an exception (exception: unsupported operand type(s) for /: 'str' and 'str')

This is strange because in:

def create_search_index(app, exception):
"""
Generate search index at the end of the Sphinx build process.
Parameters
----------
app : Sphinx
Sphinx application instance.
exception : Exception
Exception raised during the build process, if any.
"""
if exception:
return
search_index_list = []
for document in app.env.found_docs:
search_index = SearchIndex(document, app)
search_index.build_sections()
search_index_list.extend(search_index.indices)
search_index_path = app.builder.outdir / "_static" / "search.json"
with search_index_path.open("w", encoding="utf-8") as index_file:
json.dump(search_index_list, index_file, ensure_ascii=False, indent=4)

The object:

search_index_path = app.builder.outdir / "_static" / "search.json"

Extends from the pathlib.Path object.

Metadata

Metadata

Assignees

Labels

bugDefects or glitches reported by users or developers

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions