highlight.js icon indicating copy to clipboard operation
highlight.js copied to clipboard

hljs playground

Open Hirse opened this issue 4 years ago • 3 comments

Adding a playground as a public version of tools/developer.html to be added to the website. Currently does not include the localstorage, so not a complete replacement. Generated using the same process as the demo page. Working version (using CDN sources): https://codesandbox.io/s/hljs-playground-jomgi

playground

Hirse avatar Oct 29 '21 05:10 Hirse

This type of idea has come up in the past - I also think we already have our own (much simpler) take on this for the new website (that's not yet published). I also have concerns whether we want this [the FULL utility] to be user facing for ALL users of the library - whether that's it's own support burden or not. I feel like at the very least if we went this direction (fully public tool) it would need it's own small dedicated page of docs, etc.

I'll discuss with @highlightjs/core.

joshgoebel avatar Nov 03 '21 03:11 joshgoebel

Another idea (if we go this more ambitious route) is constantly saving the code into the URL (vs local storage) as a #hashtag so that problematic code can be tested, then the URL copied right into a GitHub issue, etc... which would link to the developer tool with that snippet already loaded (and the correct language, theme, etc)... might reduce the need for the JSFiddle we currently use for such things.

joshgoebel avatar Nov 03 '21 03:11 joshgoebel

Another idea (if we go this more ambitious route) is constantly saving the code into the URL (vs local storage) as a #hashtag so that problematic code can be tested, then the URL copied right into a GitHub issue, etc... which would link to the developer tool with that snippet already loaded (and the correct language, theme, etc)... might reduce the need for the JSFiddle we currently use for such things.

Yes, I had that idea too, but wanted to showcase my current version before spending more time on it.

I'd be happy to work more on it if you decide to go this direction.

Hirse avatar Nov 03 '21 05:11 Hirse

I think the new website makes this redundant, yes?

https://highlightjs-web.herokuapp.com/demo

joshgoebel avatar Sep 12 '22 00:09 joshgoebel

I think the new website makes this redundant, yes?

https://highlightjs-web.herokuapp.com/demo

Yeah, looks like it. :)

Hirse avatar Sep 12 '22 18:09 Hirse

Sorry this took so long to resolve - please don't feel bad. (I'm glad you're smiling) If you see room for improvement on the new site's similar feature I'm sure we'd be open to ideas/PRs.

joshgoebel avatar Sep 12 '22 23:09 joshgoebel