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

Add option to have source links open in a new tab #169

Open
tripl3dogdare opened this issue Jan 12, 2018 · 3 comments
Open

Add option to have source links open in a new tab #169

tripl3dogdare opened this issue Jan 12, 2018 · 3 comments

Comments

@tripl3dogdare
Copy link

I'd really like to have this in my own documentation - oftentimes, I want to check the source of something, but when I click the source link, it opens in the same tab, closing the documentation. This leads to some (admittedly slight) annoyance with having to recover my place or remember to manually open it in a new tab.

I had attempted to work around this by appending to my source-uri property, as such:

:source-uri "http://source/link/here\" target=\"_blank\""

However, this results in the following error:

Exception in thread "main" java.net.URISyntaxException: Illegal character in fragment at index 82

If there's another workaround for this, please let me know; however, I would still like to submit this as a feature request regardless. It'd be nice to have a simple, standard way to do this.

@weavejester
Copy link
Owner

weavejester commented Jan 12, 2018

This might be possible with HTML transformations.

@tripl3dogdare
Copy link
Author

I'm unfamiliar with how those work, exactly, could you give an example of how I might do that? From a quick glance at the section you linked, it seems like I can only really modify the entire tag, and it doesn't appear that I can access the original with :substitute or the like.

@weavejester
Copy link
Owner

It looks like it isn't currently possible, since Enlive doesn't have a syntax for attributes without using functions. Of course, one could use this to add in Javascript that does the job, but it would probably be better to have an option for this.

I think a :source-link-target key in the :html map would be the best way of handling it.

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

No branches or pull requests

2 participants