Index entry and definition parsing should be implemented by filetype plugins.
Each one should provide a get_index_entries() that returns an iterable of (entry, ref)
Index entries are easily cacheable, since the index for a wiki at a given commit sha is the union of the index entries in all blobs in that commit, so it's simply a matter of storing (blobsha, term, location) in a database, listing all the blob shas in the current head, then doing a SELECT ... WHERE sha IN (...).
The only circumstance in which entries would become invalid is if the implementation in the renderer changes, in which case the cache should be cleared as part of upgrade instructions.
Maybe we could make each plugin include a 'index version string', append them all, sort them, and include them in the cache key?
The database should be used as a proper cache, with code calculating nonpresent values on demand, to reduce migration time and not waste never-used disk space
see #11
The actual display of indexes and definitions should be handled by a +-page (/+index, /bananas/+dictionary), rendered using a template that's part of the theme.
get_index_entries()
that returns an iterable of (entry, ref)SELECT ... WHERE sha IN (...)
./+index
,/bananas/+dictionary
), rendered using a template that's part of the theme.