Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy results as Markdown feature #24

Open
simonw opened this issue Aug 13, 2021 · 3 comments
Open

Copy results as Markdown feature #24

simonw opened this issue Aug 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Aug 13, 2021

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 simonw added the enhancement New feature or request label Aug 13, 2021
@simonw
Copy link
Owner Author

simonw commented Aug 13, 2021

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
Copy link
Owner Author

simonw commented Aug 13, 2021

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>&nbsp;&nbsp;&nbsp;&nbsp;datasette = Datasette([db_path], config={"allow_csv_stream": False})</code></strong></li>
  <li><code>&nbsp;&nbsp;&nbsp;&nbsp;response = await datasette.client.get("/db/big.Notebook")</code></li>
  <li><code>&nbsp;&nbsp;&nbsp;&nbsp;assert ".csv" not in response.text</code></li>
</ol>

Renders as:

  1. @pytest.mark.asyncio
  2. async def test_notebook_no_csv(db_path)
  3.     datasette = Datasette([db_path], config={"allow_csv_stream": False})
  4.     response = await datasette.client.get("/db/big.Notebook")
  5.     assert ".csv" not in response.text

@simonw
Copy link
Owner Author

simonw commented Aug 13, 2021

Maybe the options are copy as plaintext and copy as GitHub flavored markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant