datasette/datasette/hookspecs.py
Simon Willison 510e01f224
render_cell(value) plugin hook
Still needs performance testing before I merge this into master
2018-07-30 08:55:26 -07:00

35 lines
743 B
Python

from pluggy import HookimplMarker
from pluggy import HookspecMarker
hookspec = HookspecMarker('datasette')
hookimpl = HookimplMarker('datasette')
@hookspec
def prepare_connection(conn):
"Modify SQLite connection in some way e.g. register custom SQL functions"
@hookspec
def prepare_jinja2_environment(env):
"Modify Jinja2 template environment e.g. register custom template tags"
@hookspec
def extra_css_urls():
"Extra CSS URLs added by this plugin"
@hookspec
def extra_js_urls():
"Extra JavaScript URLs added by this plugin"
@hookspec
def publish_subcommand(publish):
"Subcommands for 'datasette publish'"
@hookspec(firstresult=True)
def render_cell(value):
"Customize rendering of HTML table cell values"