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

feature: Option to toggle between Link Text only and Link Text + URL … #204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deicon
Copy link

@deicon deicon commented Nov 17, 2022

Preparing glamour to be configured to render links using the link text only or the Link text and url.

Ideally in another PR this would be extended to display clickable Link Texts whenever possible.
When using glow as a quick reader of markdown files, it seems natural to hide the urls, as this is the expected behaviour of a markdown viewer.

@deicon
Copy link
Author

deicon commented Nov 18, 2022

Maybe some help for #178

@markusbkk
Copy link

Just tested your feature addition (I'm working on a man(1) alternative and have chosen Glamour to power it).

Thus far, it only prints the text sans the link. Is there a plan to make it so the text can actually be clicked/is acting as the link?

@deicon
Copy link
Author

deicon commented Nov 20, 2022

I would love to add the link feature as feature. If this change makes it through, I would look into it as well.

@deicon
Copy link
Author

deicon commented Nov 23, 2022

@markusbkk In fact github.com/muesli/termenv already contains all there is to it to enable clickable links as far as I can tell.

https://github.com/muesli/termenv/blob/5670c9af724c0f24acef0a7a8d811f6cc9290b83/hyperlink.go

@T3sT3ro
Copy link

T3sT3ro commented Mar 14, 2024

Clickable links are made simply with OSC8 escape sequence

This can be a super simple change

@aymanbagabas
Copy link
Member

I would have a LinkStyler type that can customize how a link is rendered instead of having a fixed option WithLinkTextOnly. Then we could have a WithLinkStyler that take a LinkStyler. We can have some sane defaults like FullLinkStyler and TextLinkStyler.

This can also fix #260, #82, and #261

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

Successfully merging this pull request may close these issues.

4 participants