New plugin hooks: extra_css_urls() and extra_js_urls()

Closes #214
This commit is contained in:
Simon Willison 2018-04-17 20:12:21 -07:00
commit 1c36d07dd4
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
6 changed files with 117 additions and 7 deletions

View file

@ -113,6 +113,19 @@ def prepare_connection(conn):
"select convert_units(100, 'm', 'ft');"
return (amount * ureg(from_)).to(to_).to_tuple()[0]
conn.create_function('convert_units', 3, convert_units)
@hookimpl
def extra_css_urls():
return ['https://example.com/app.css']
@hookimpl
def extra_js_urls():
return [{
'url': 'https://example.com/app.js',
'sri': 'SRIHASH',
}]
'''
TABLES = '''