bot icon indicating copy to clipboard operation
bot copied to clipboard

Code snippets for paste service links

Open DownDev opened this issue 2 years ago • 5 comments
trafficstars

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

DownDev avatar Jul 12 '23 13:07 DownDev

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

shtlrs avatar Jul 12 '23 16:07 shtlrs

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?

DownDev avatar Jul 12 '23 16:07 DownDev

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

HassanAbouelela avatar Aug 21 '23 03:08 HassanAbouelela

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

DownDev avatar Aug 21 '23 15:08 DownDev

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

ChrisLovering avatar May 13 '24 18:05 ChrisLovering