We used to only look for examples in a few (sometimes arbitrary) places, and we didn't support showing several examples in most cases. This is intended to fix this. In the process we try to deduplicate code to make sure that we use the same logic everywhere.
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>