Hi,

I'm playing around with devpi themes.
My goal is to create a nice theme for my company.
I'd like to add extra information to some pages, like the index page or the main page.
I added a snippet of code which produces an "index inheritance diagram" on each index page display.

Because the company I work for is not that small, these diagrams can get strange.
A sample diagram: index inheritance diagram. Each box is an index, I intentionally removed all user and index names, except for root/pypi.
It's not my indices, please don't judge me for the design :)

I'm concerned about performance here. First of all, currently I generate those on display action, which doesn't seem the way to go.
Could devpi provide a hook so that I'm able to regenerate a diagram on an index update event?



Additionally, I'd like to add more information to an index page and the root pages. So the question is: Could functions in devpi_web.views expose more data in get_index() and root()? Potentially other functions?
I know I can always get the data with python snippets in the templates, but it all takes precious time.

For instance, in my company, some indices are regular user indices, some of them are project indices.
I'd like to sort the list of indices on the root page: display the project ones first, and user indices below.

The way I would see this is the custom_data property of an index.

The bottom line: I think people could easily create fancier themes if the devpi web views functions exposed more data to the templates, even if that data is not used in the default theme.
It would be great to get the full indexconfig json structure for each index in both get_index() and root() functions from devpi_web.views module.

Now I'm not sure how much more data others might want to get there.
I hope these things make sense.

Any thoughts?