mirror of
https://github.com/simonw/datasette.git
synced 2026-06-08 18:16:59 +02:00
extra_body_script module support, closes #1187
This commit is contained in:
parent
fa0c3777b8
commit
c38c42948c
5 changed files with 31 additions and 9 deletions
|
|
@ -781,7 +781,13 @@ class Datasette:
|
|||
datasette=self,
|
||||
):
|
||||
extra_script = await await_me_maybe(extra_script)
|
||||
body_scripts.append(Markup(extra_script))
|
||||
if isinstance(extra_script, dict):
|
||||
script = extra_script["script"]
|
||||
module = bool(extra_script.get("module"))
|
||||
else:
|
||||
script = extra_script
|
||||
module = False
|
||||
body_scripts.append({"script": Markup(script), "module": module})
|
||||
|
||||
extra_template_vars = {}
|
||||
# pylint: disable=no-member
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue