slate icon indicating copy to clipboard operation
slate copied to clipboard

Hyperlink in json tab

Open nastradamus39 opened this issue 8 years ago • 7 comments

Hello.

Is it possible to render active hyperlink in json tab? Like this image And i want to scroll to needed target by clicking this hyperlink. Is it possible?

nastradamus39 avatar Feb 15 '17 17:02 nastradamus39

Not currently AFAIK, and I think this is actually perhaps something we should consider as a possible direction to think about, since you can't just use HTML to plop that in, unless you want to write the syntax highlighting classes yourself manually.

lord avatar Feb 15 '17 19:02 lord

I solved this problem by add to index.md this code

In Json tab i use this

{
    "Id": 1,
    "Place": "LNK[Link title](#some_link_url)",
    "Users": [ ]
}

When page will be loaded

"LNK[Link title](#some_link_url)"

will be replaced to hyperlink.

nastradamus39 avatar Feb 17 '17 13:02 nastradamus39

Ah, that's a decent solution! Probably wouldn't want to put it into everyone's Slate, in case somebody's API has a bunch of LNK things in the responses, so probably going to keep searching for a more general solution. If others have suggestions, feel free to continue to comment, and I'll keep this issue open!

lord avatar Feb 18 '17 22:02 lord

Maybe the page top options could include something like this:

parse_markdown_links:
  - json

And then in json blocks, any text matching [..](url) would be turned into a hyperlink by JS?

crabmusket avatar Apr 05 '18 14:04 crabmusket

I'd love to be able to do this too :) Our sdk can be used with multiple languages, and I'd like to use the language tab to link to a specific API specification.

nathlaroche avatar Apr 25 '18 21:04 nathlaroche

Has there been any updates regarding this functionality? I am wanting to have language specific hyperlinks to different sdk methods. But there doesn't seem to be a way to add links to the right hand column. I tried nastradamus39's solution but it through off the layout and stripped the all the characters except what was enclosed within the square brackets.

JaxomCS avatar Aug 24 '18 02:08 JaxomCS

To be frank — unlikely to get support here any time soon! If there was a Ruby markdown parser that had better support for this kind of thing, that would probably be the best path forward to getting something like this in, instead of us hacking it in ourselves.

lord avatar Sep 26 '18 08:09 lord