You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2025. It is now read-only.
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:
This may interfere with the goal of making this a standalone js lib #67.
But I'd be +1 on trying to create a small helper, we have a lot of nesting and could be confusing in the code... but I'd also love to simplify that #118.
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.
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 <script type="text/html"> block. Our manipulation of the template wouldn't be string operations though, but would be DOM operations. With a virtual DOM, it's even possible to do lightweight data binding and templating with something like Rivets.js.
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 <head>. But hopefully the answer isn't a large hack.
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: