{"html_url": "https://github.com/simonw/datasette/issues/645#issuecomment-560036585", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/645", "id": 560036585, "node_id": "MDEyOklzc3VlQ29tbWVudDU2MDAzNjU4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-12-01T01:28:35Z", "updated_at": "2019-12-01T01:28:35Z", "author_association": "OWNER", "body": "Plugins are currently expected to return this:\r\n```python\r\n@hookimpl\r\ndef register_output_renderer(datasette):\r\n return {\r\n \"extension\": \"test\",\r\n \"callback\": render_test\r\n }\r\n```\r\nWe can add an optional third argument, `\"should_suggest\"`, which takes the same arguments as the callback but simply returns `True` or `False` depending on if the plugin can work for the current set of data.\r\n\r\nIf that dictionary key is omitted, Datasette will treat this test as returning `True`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 530653633, "label": "Mechanism for register_output_renderer to suggest extension or not"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/645#issuecomment-560036740", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/645", "id": 560036740, "node_id": "MDEyOklzc3VlQ29tbWVudDU2MDAzNjc0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-12-01T01:29:58Z", "updated_at": "2019-12-01T01:29:58Z", "author_association": "OWNER", "body": "It should be optionally awaitable - as should the existing `\"callback\"`. Can use the same pattern as this one: \r\n\r\nhttps://github.com/simonw/datasette/blob/8c642f04e0608bf537fdd1f76d64c2367fb04d57/datasette/views/base.py#L124-L135", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 530653633, "label": "Mechanism for register_output_renderer to suggest extension or not"}, "performed_via_github_app": null}