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

Mark line(s) to share highlighted part(s) of the paste #743

Open
Tigerpanzer02 opened this issue Jan 31, 2021 · 6 comments
Open

Mark line(s) to share highlighted part(s) of the paste #743

Tigerpanzer02 opened this issue Jan 31, 2021 · 6 comments

Comments

@Tigerpanzer02
Copy link

Request:
Ability to mark lines on a paste to discuss the paste in a better way with someone else. This means there should be the possibility to click one line and the paste link will redirect to this line if someone else is clicking the shared link.

This is kinda implemented on hastebin/github and would be a nice feature for PrivateBin as it would make discussing more easier and could be easier if you share long pasts with others.

For example, the new link after clicking the line will include #L12 at the end. This link can be shared and the person who is using that link sees the line highlighted and will get scrolled to it. (Also nice would be multiline selection for example #L12#L32 will highlight the part from line 12 to line 32)

Video showing the feature on hastebin server:
https://www.youtube.com/watch?v=hYVd6jZXAEI

Video showing the feature on github:
https://www.youtube.com/watch?v=o3mmqtW-FH4

@Tigerpanzer02 Tigerpanzer02 changed the title Mark lines to share highlighted part(s) of the paste Mark line(s) to share highlighted part(s) of the paste Jan 31, 2021
@Tigerpanzer02
Copy link
Author

Just to let you know, I forked the project and got a working one, feel free to look into it ;)

@elrido
Copy link
Contributor

elrido commented Feb 14, 2021

Hi @Tigerpanzer02, I tried to find the branch in your fork with the changes, but didn't spot them. Could you point me in the right direction, please? Also, pull requests are always very welcome.

@Tigerpanzer02
Copy link
Author

Tigerpanzer02 commented Feb 14, 2021

@elrido I am sorry for the "mess" it is on the organisation where I am part of.
https://github.com/Plugily-Projects/PrivateBin

It just implements it as a fast way and works only for source codes. You can check it out on https://paste.plugily.xyz

I guess you guys can do it way better ;) As you know your project more in depth

@rugk
Copy link
Member

rugk commented Feb 14, 2021

We can always do Pull Request reviews, that's what they are for, so feel free to send a pull request, @Tigerpanzer02. 😃

@9mido
Copy link

9mido commented Apr 1, 2021

@Tigerpanzer02

This is a feature I am also interested in. I tested your result and it is decent but can be improved by adding individual lines plus ranges where they could just keep getting appended onto the URL.

I found some bugs while testing though. I don't always get Scroll Here / Extend Here to work all of the time. I click Scroll Here then try a different line but Extend Here never shows up and only Scroll Here does. It does not do what I want it to all of the time. Another is the Extend Here may become a Scroll Here starting point sometimes.

Hopefully https://dpaste.org/ will still be around for a bit longer so you could see how it works but if you could make it like dpaste instead but add ranges as well like github it would be a lot better.

With dpaste, I like how you can click individual lines and each new line clicked gets appended to the end of the URL and each one of those lines gets highlighted. With github, I like how you can make a range with Shift + click. I would love to be able to combine both of these. Where you could click as many individual lines as you want and create as many ranges as you want and they all get appended to the end of the URL.

I would possibly rename:

Scroll Here -> Start Range Here
Extend Here -> End Range Here
Do Not Scroll Here -> Unmark Here (This should cancel out both individual marks and range marks)

Add a new selector:

Mark Here -> Marks individual lines rather than making a range

I prefer clicking of Dpaste and Shift + click of github rather than menu like selectors but could live with adding another selector of Mark Here and renaming of the others if it makes things easier.

Desired Results:
URL#L1,5,7 -> Lines 1, 5, and 7 individually highlighted
URL#L10-20 -> Lines 10 - 20 highlighted as a range.
URL#L1,5,7,10-20 -> Lines 1, 5, and 7 highlighted individually plus lines 10 - 20 highlighted as a range.
URL#L1,5,7,10-20,25,31,35-40 -> Lines 1, 5, 7, 25, and 31 highlighted individually plus lines 10 - 20 and 35 - 40 highlighted as ranges.

For everyone else, here is the comparison that is now a draft PR:

master...Plugily-Projects:master

@Tigerpanzer02
Copy link
Author

@Tigerpanzer02

This is a feature I am also interested in. I tested your result and it is decent but can be improved by adding individual lines plus ranges where they could just keep getting appended onto the URL.

I found a potential bug while testing though. I don't always get Scroll Here / Extend Here to work all of the time. I click Scroll Here then try a different line but Extend Here never shows up and only Scroll Here does. It does not do what I want it to all of the time.

Hopefully https://dpaste.org/ will still be around for a bit longer so you could see how it works but if you could make it like dpaste instead but add ranges as well like github it would be a lot better.

With dpaste, I like how you can click individual lines and each new line clicked gets appended to the end of the URL and each one of those lines gets highlighted. With github, I like how you can make a range with Shift + click. I would love to be able to combine both of these. Where you could click as many individual lines as you want and create as many ranges as you want and they all get appended to the end of the URL.

I would possibly rename:

Scroll Here -> Start Range Here
Extend Here -> End Range Here
Do Not Scroll Here -> Unmark Here

Add a new selector:

Mark Here -> Marks individual lines rather than making a range

I prefer clicking of Dpaste and Shift + click of github rather than menu like selectors but could live with adding another selector of Mark Here and renaming of the others if it makes things easier.

Desired Results:
URL#L1,5,7 -> Lines 1, 5, and 7 individually highlighted
URL#L10-20 -> Lines 10 - 20 highlighted as a range.
URL#L1,5,7,10-20 -> Lines 1, 5, and 7 highlighted individually plus lines 10 - 20 highlighted as a range.
URL#L1,5,7,10-20,25,31,35-40 -> Lines 1, 5, 7, 25, and 31 highlighted individually plus lines 10 - 20 and 35 - 40 highlighted as ranges.

For everyone else, here is the comparison that is now a draft PR:

master...Plugily-Projects:master

I agree with you! It's definitely a start point but could be improved and extended. I like your ideas and hope that someone wants to improve and add it to PrivateBin in general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants