{"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747034481", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747034481, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAzNDQ4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:17:05Z", "updated_at": "2020-12-16T21:17:05Z", "author_association": "MEMBER", "body": "I'm just going to add `q` for the moment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747031608", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747031608, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAzMTYwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:15:18Z", "updated_at": "2020-12-16T21:15:18Z", "author_association": "MEMBER", "body": "Should I pass any other details to the `display_sql` here as well?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747030964", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747030964, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAzMDk2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:14:54Z", "updated_at": "2020-12-16T21:14:54Z", "author_association": "MEMBER", "body": "To do this I'll need the search term to be passed to the `display_sql` SQL query:\r\nhttps://github.com/dogsheep/dogsheep-beta/blob/4890ec87b5e2ec48940f32c9ad1f5aae25c75a4d/dogsheep_beta/__init__.py#L164-L171", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747029636", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747029636, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAyOTYzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:14:03Z", "updated_at": "2020-12-16T21:14:03Z", "author_association": "MEMBER", "body": "I think I can do this as a cunning trick in `display_sql`. Consider this example query: https://til.simonwillison.net/tils?sql=select%0D%0A++path%2C%0D%0A++snippet%28til_fts%2C+-1%2C+%27b4de2a49c8%27%2C+%278c94a2ed4b%27%2C+%27...%27%2C+60%29+as+snippet%0D%0Afrom%0D%0A++til%0D%0A++join+til_fts+on+til.rowid+%3D+til_fts.rowid%0D%0Awhere%0D%0A++til_fts+match+escape_fts%28%3Aq%29%0D%0A++and+path+%3D+%27asgi_lifespan-test-httpx.md%27%0D%0A&q=pytest\r\n\r\n```sql\r\nselect\r\n path,\r\n snippet(til_fts, -1, 'b4de2a49c8', '8c94a2ed4b', '...', 60) as snippet\r\nfrom\r\n til\r\n join til_fts on til.rowid = til_fts.rowid\r\nwhere\r\n til_fts match escape_fts(:q)\r\n and path = 'asgi_lifespan-test-httpx.md'\r\n```\r\nThe `and path = 'asgi_lifespan-test-httpx.md'` bit means we only get back a specific document - but the snippet highlighting is applied to it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-712266834", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 712266834, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjI2NjgzNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T16:01:23Z", "updated_at": "2020-10-19T16:01:23Z", "author_association": "MEMBER", "body": "Might just be a documented pattern for how to configure this in YAML templates.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null}