From bf229c9bd88179c8ec16bd65fd4fb28ab4241c2e Mon Sep 17 00:00:00 2001 From: Russ Garrett Date: Fri, 3 May 2019 14:12:19 +0100 Subject: [PATCH] Pass view_name to extra_body_script hook (#443) At the moment it's not easy to tell whether the hook is being called in (for example) the row or table view, as in both cases the `database` and `table` parameters are provided. This passes the `view_name` added in #441 to the `extra_body_script` hook. --- datasette/hookspecs.py | 2 +- datasette/views/base.py | 1 + docs/plugins.rst | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/datasette/hookspecs.py b/datasette/hookspecs.py index 4dc6338e..61523a31 100644 --- a/datasette/hookspecs.py +++ b/datasette/hookspecs.py @@ -26,7 +26,7 @@ def extra_js_urls(template, database, table, datasette): @hookspec -def extra_body_script(template, database, table, datasette): +def extra_body_script(template, database, table, view_name, datasette): "Extra JavaScript code to be included in