mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
render_cell(value) plugin hook, closes #352
New plugin hook for customizing the way cells values are rendered in HTML. The first full example of this hook in use is https://github.com/simonw/datasette-json-html
This commit is contained in:
parent
295d005ca4
commit
4ac9132240
10 changed files with 150 additions and 30 deletions
17
datasette/plugins.py
Normal file
17
datasette/plugins.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import importlib
|
||||
import pluggy
|
||||
from . import hookspecs
|
||||
|
||||
default_plugins = (
|
||||
"datasette.publish.heroku",
|
||||
"datasette.publish.now",
|
||||
)
|
||||
|
||||
pm = pluggy.PluginManager("datasette")
|
||||
pm.add_hookspecs(hookspecs)
|
||||
pm.load_setuptools_entrypoints("datasette")
|
||||
|
||||
# Load default plugins
|
||||
for plugin in default_plugins:
|
||||
mod = importlib.import_module(plugin)
|
||||
pm.register(mod, plugin)
|
||||
Loading…
Add table
Add a link
Reference in a new issue