click-default-group>=1.2.3 (#2173)

* click-default-group>=1.2.3

Now available as a wheel:
- https://github.com/click-contrib/click-default-group/issues/21

* Fix for blacken-docs
This commit is contained in:
Simon Willison 2023-09-05 19:50:09 -07:00 committed by GitHub
commit 05707aa16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -343,6 +343,7 @@ To define additional hooks, add a file to the plugin called ``datasette_your_plu
hookspec = HookspecMarker("datasette")
@hookspec
def name_of_your_hook_goes_here(datasette):
"Description of your hook."
@ -366,10 +367,13 @@ Within your plugin code you can trigger the hook using this pattern:
from datasette.plugins import pm
for plugin_return_value in pm.hook.name_of_your_hook_goes_here(
for (
plugin_return_value
) in pm.hook.name_of_your_hook_goes_here(
datasette=datasette
):
# Do something with plugin_return_value
pass
Other plugins will then be able to register their own implementations of your hook using this syntax:
@ -377,6 +381,7 @@ Other plugins will then be able to register their own implementations of your ho
from datasette import hookimpl
@hookimpl
def name_of_your_hook_goes_here(datasette):
return "Response from this plugin hook"