[SOLVED] Clickable custom protocol link


#1

Thanks for Atom: I enjoy it, but just getting back to it.

My question is, is there was way to configure Atom so that interprets Custom Protocol URLs as clickable from within the text editor?

I have a registered protocol that works fine if I paste it into a browser address bar, but would like to have something like the following in my code:
/*
my-app://link_to_resource
*/

Is there a way to do that (I’ve searched and searched, but most of the posts seem to be for packages)?


#2

I am referring here to Ubuntu. You do not specify your environment.

I launch url protocol handlers using …

xdg-open ‘app://gedit’

Here is one dated article referring …
https://askubuntu.com/questions/330937/is-it-possible-to-open-an-ubuntu-app-from-html

This is useful for posting hyperlinks which launch local desktop applications but they can be a security risk if source is not trusted.


#3

Thanks for the thought. Yes, I neglected to say I’m on Windows.

Launching the URI is not an issue outside of Atom. What I can’t figure out is how to make it a clickable link within Atom (e.g. within the comment section of a file for example).


#4

If the file is markdown (extension *.md) then if you have markdown-preview-enhanced package installed you can preview clickable url protocol handler links. But I gather that you are trying to do the same in code blocks.


#5

Correct. PHP initially, but if I can figure it out it will be useful in other areas.

I did think about markdown, but php isn’t displayed.


#6

Here is php-markdown … perhaps worth trying.

After thought … it would be much easier if you simply have a README.md file in the root of your php (or other) files. That is what I do to keep dev notes for each project. The README,md has links to documents, applications.


#7

Yes, that’s what I was beginning to think… thanks


#8

You will indeed use a package if you decide that you ultimately want to make this happen. I have hyperclick and path-hyperclick installed (you need both) and if I have a directory structure like you see below, I can type ./src/index.html in readme.md, then press ctrl-shift and click on the path and Atom will open the file in a new tab.

Folder/
+-src/
| +-index.html
+-readme.md

#9

Thanks! that’s a great suggestion, and works well, except the protocol is still not consumed, but it’s a great addition in any case.

but after a bit of searching: hyperlink-hyperclick is the perfect solution – thanks so much for the pointer!