{"html_url": "https://github.com/simonw/datasette/issues/1191#issuecomment-761703022", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1191", "id": 761703022, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTcwMzAyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-17T00:20:00Z", "updated_at": "2021-01-17T00:20:00Z", "author_association": "OWNER", "body": "Plugins that want to provide extra context to the template can already do so using the `extra_template_vars()` plugin hook.\r\n\r\nSo this hook could work by returning a list of template filenames to be included. Those templates can be bundled with the plugin. Since they are included they will have access to the template context and to any `extra_template_vars()` values.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 787098345, "label": "Ability for plugins to collaborate when adding extra HTML to blocks in default templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1191#issuecomment-761703232", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1191", "id": 761703232, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTcwMzIzMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-17T00:21:31Z", "updated_at": "2021-01-17T00:21:54Z", "author_association": "OWNER", "body": "I think this ends up being a whole collection of new plugin hooks, something like:\r\n\r\n- `include_table_top`\r\n- `include_table_bottom`\r\n- `include_row_top`\r\n- `include_row_bottom`\r\n- `include_database_top`\r\n- `include_database_bottom`\r\n- `include_query_bottom`\r\n- `include_query_bottom`\r\n- `include_index_bottom`\r\n- `include_index_bottom`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 787098345, "label": "Ability for plugins to collaborate when adding extra HTML to blocks in default templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1191#issuecomment-761703368", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1191", "id": 761703368, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTcwMzM2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-17T00:22:46Z", "updated_at": "2021-01-17T00:22:46Z", "author_association": "OWNER", "body": "I'm going to prototype this in a branch.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 787098345, "label": "Ability for plugins to collaborate when adding extra HTML to blocks in default templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1181#issuecomment-761703555", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1181", "id": 761703555, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTcwMzU1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-17T00:24:20Z", "updated_at": "2021-01-17T00:24:40Z", "author_association": "OWNER", "body": "Here's the incomplete sketch of a test - to go at the bottom of `test_cli.py`.\r\n\r\n```python\r\n@pytest.mark.parametrize(\r\n \"filename\", [\"test-database (1).sqlite\", \"database (1).sqlite\"]\r\n)\r\ndef test_weird_database_names(ensure_eventloop, tmpdir, filename):\r\n # https://github.com/simonw/datasette/issues/1181\r\n runner = CliRunner()\r\n db_path = str(tmpdir / filename)\r\n sqlite3.connect(db_path).execute(\"vacuum\")\r\n result1 = runner.invoke(cli, [db_path, \"--get\", \"/\"])\r\n assert result1.exit_code == 0, result1.output\r\n homepage_html = result1.output\r\n assert False\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 781262510, "label": "Certain database names results in 404: \"Database not found: None\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1191#issuecomment-761705076", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1191", "id": 761705076, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTcwNTA3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-17T00:35:13Z", "updated_at": "2021-01-17T00:37:51Z", "author_association": "OWNER", "body": "I'm going to try using Jinja macros to implement this: https://jinja.palletsprojects.com/en/2.11.x/templates/#macros\r\n\r\nMaybe using one of these tricks to auto-load the macro? http://codyaray.com/2015/05/auto-load-jinja2-macros", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 787098345, "label": "Ability for plugins to collaborate when adding extra HTML to blocks in default templates"}, "performed_via_github_app": null}