The current SpecialSearch code is ~1400 lines long, and has a rather hard to follow execution path. To start cleaning this up lets extract some sort of SearchResultHtmlRenderer (name tbd) that can be instantiated and will return the necessary HTML for the result set. Ideally we should be able to have multiple implementations, so that we can swap them out to test new ways of showing things.
Some possible variations from the 'default' render:
- The top 3 items might have images added to them
- We might be rendering interwiki results which are a only a list of titles, rather than the full title+snippet+metadata
- We might be rendering interwiki results that have full metadata, but are shown in a sidebar
- We might be rendering some sort of image view, which displays a grid of images instead of a list
I don't know if it makes sense to try and build this with OOUI, or just wing it with the Html class.