python-discord / bot

The community bot for the Python Discord community
https://pythondiscord.com
MIT License
1.38k stars 675 forks source link

Code snippets for paste service links #2679

Open DownDev opened 1 year ago

DownDev commented 1 year ago

The new paste service offers the ability to select specific line when someone sends a link to a paste service with a selected line. In such cases, you can replace the selected line with a code block like its already done for github etc.

Althrough i still did not find a way to select more than one line

shtlrs commented 1 year ago

In such cases, you can replace the selected line with a code block like its already done for github etc. I'm not sure I follow what's exactly meant here.

Are you asking whether it's possible to highlight a specific line range like in Github ?

AFAIK, pinnwand allows to highlight a single line and not a range.

Relevant issue: https://github.com/supakeen/pinnwand/issues/39 Relevant PR: https://github.com/supakeen/pinnwand/pull/104

DownDev commented 1 year ago

Are you asking whether it's possible to highlight a specific line range like in Github ?

Yes, i couldnt find a way to select more than one line Its possible now: supakeen/pinnwand#170

But still if only 1 line is possible it could send codeblock with only one line anyways. So do we add support for code snippets for paste service now?

HassanAbouelela commented 1 year ago

Issue approved, please leave a comment if you'd like to work on it.

DownDev commented 1 year ago

I can work on this when supakeen/pinnwand#194 is done and merged.

ChrisLovering commented 6 months ago

We have now forked pinnwand and pushed the latest changes to paste.pythondiscord.com

https://paste.pythondiscord.com/api/v1/paste/{id} can be used to get the paste data, and lexer for the code block.

EG https://paste.pythondiscord.com/api/v1/paste/NCXY2ZKJ2TT2E6RBEZHMTJ52VQ