-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use an inline html template for search results and search result customization #117
Comments
It shouldn't, this pattern would be usable as a standalone library as well. It would be a good way to provide more general support for templating the results, though not the only way to accomplish this. |
@agjohnson but we won't be able to use the sphinx's template engine or do you mean something like a string template? |
Not a string template, but an isolated virtual DOM. That is, the default template might be an HTML file loaded through Webpack, and the customized template would be through a In the case of Sphinx, but without playing with this, I can't say how we both expose this as a template and inject it in |
The other day I found out that HTML has the |
Yup both work for this, the two options are rather comparable. |
In #116 Underscore was removed, and the pattern was shifted to native DOM manipulation.
One potential pattern to consider for future releases could be to use an HTML template inline in the output, as a Sphinx template. Effectively:
This gives a template that can be targeted by our search JS, and manipulation of the template would happen with some data binding logic, or a more simple DOM search and replace.
The benefit here is that it is customizable at the Sphinx theme/template level, and can incorporate localization during the Sphinx build. Currently the search window will always be English. Localization is also possible in the JS now, but would have to be an additional step to be hooked into during building.
The text was updated successfully, but these errors were encountered: