Copy results as Markdown feature
simonw opened this issue · 3 comments
simonw commented
I often find myself using this tool to find examples of something that needs to be changed - so being able to copy and paste the results of a search into a GitHub issue as markdown would be really useful.
Example where I could have benefited from this: simonw/datasette#1432 (comment)
simonw commented
Ideally this would include copying permalinks to the source code on GitHub, but I don't currently have enough information to calculate those since the plugin doesn't have a way to know which GitHub repo (and which exactly SHA1 hash) the code it is searching refers to.
simonw commented
If this is GitHub flavored markdown I can do this:
<ol start="93">
<li><code>@pytest.mark.asyncio</code></li>
<li><code>async def test_notebook_no_csv(db_path)</code></li>
<li><code><strong> datasette = Datasette([db_path], config={"allow_csv_stream": False})</code></strong></li>
<li><code> response = await datasette.client.get("/db/big.Notebook")</code></li>
<li><code> assert ".csv" not in response.text</code></li>
</ol>
Renders as:
@pytest.mark.asyncio
async def test_notebook_no_csv(db_path)
datasette = Datasette([db_path], config={"allow_csv_stream": False})
response = await datasette.client.get("/db/big.Notebook")
assert ".csv" not in response.text
simonw commented
Maybe the options are copy as plaintext and copy as GitHub flavored markdown.