Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra_ plugin hooks should take the same arguments #939

Closed
4 tasks done
simonw opened this issue Aug 16, 2020 · 6 comments
Closed
4 tasks done

extra_ plugin hooks should take the same arguments #939

simonw opened this issue Aug 16, 2020 · 6 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Aug 16, 2020

  • extra_css_urls(template, database, table, datasette)
  • extra_js_urls(template, database, table, datasette)
  • extra_body_script(template, database, table, view_name, datasette)
  • extra_template_vars(template, database, table, view_name, request, datasette)

Originally posted by @simonw in #938 (comment)

@simonw simonw added the plugins label Aug 16, 2020
@simonw
Copy link
Owner Author

simonw commented Aug 16, 2020

They should all take:

template, database, table, view_name, request, datasette, columns

columns is new, see #938.

@simonw
Copy link
Owner Author

simonw commented Aug 16, 2020

They should also be next to each other in the documentation - right now they're a bit scattered in terms of page order:

Plugin_hooks_—_Datasette_documentation

@simonw
Copy link
Owner Author

simonw commented Aug 16, 2020

I'm going to implement this first as a single commit, then implement columns from #938 as a separate change.

@simonw
Copy link
Owner Author

simonw commented Aug 16, 2020

Also: they should all be able to return async def inner functions. At the moment only extra_template_vars supports that pattern.

@simonw
Copy link
Owner Author

simonw commented Aug 16, 2020

And the docs need to be updated too.

@simonw
Copy link
Owner Author

simonw commented Aug 16, 2020

Docs also need to note that request may be None for all of these hooks.

@simonw simonw closed this as completed in e363924 Aug 16, 2020
simonw added a commit that referenced this issue Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant