Template slot family of plugin hooks - top_homepage() and others

New plugin hooks:

top_homepage
top_database
top_table
top_row
top_query
top_canned_query

New datasette.utils.make_slot_function()

Closes #1191
This commit is contained in:
Simon Willison 2024-01-30 19:54:03 -08:00 committed by GitHub
commit c3caf36af7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 324 additions and 7 deletions

View file

@ -22,6 +22,8 @@
{% block content %}
<h1 style="padding-left: 10px; border-left: 10px solid #{{ database_color }}">{{ table }}: {{ ', '.join(primary_key_values) }}{% if private %} 🔒{% endif %}</h1>
{{ top_row() }}
{% block description_source_license %}{% include "_description_source_license.html" %}{% endblock %}
<p>This data as {% for name, url in renderers.items() %}<a href="{{ url }}">{{ name }}</a>{{ ", " if not loop.last }}{% endfor %}</p>