mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Start of the plugin system, based on pluggy (#210)
Uses https://pluggy.readthedocs.io/ originally created for the py.test project We're starting with two plugin hooks: prepare_connection(conn) This is called when a new SQLite connection is created. It can be used to register custom SQL functions. prepare_jinja2_environment(env) This is called with the Jinja2 environment. It can be used to register custom template tags and filters. An example plugin which uses these two hooks can be found at https://github.com/simonw/datasette-plugin-demos or installed using `pip install datasette-plugin-demos` Refs #14
This commit is contained in:
parent
efbb4e8337
commit
33c7c53ff8
4 changed files with 29 additions and 2 deletions
5
setup.py
5
setup.py
|
|
@ -1,5 +1,5 @@
|
|||
from setuptools import setup, find_packages
|
||||
from datasette import __version__
|
||||
from datasette.version import __version__
|
||||
import os
|
||||
|
||||
|
||||
|
|
@ -28,7 +28,8 @@ setup(
|
|||
'Sanic==0.7.0',
|
||||
'Jinja2==2.10',
|
||||
'hupper==1.0',
|
||||
'pint==0.8.1'
|
||||
'pint==0.8.1',
|
||||
'pluggy>=0.1.0,<1.0',
|
||||
],
|
||||
entry_points='''
|
||||
[console_scripts]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue