codehike icon indicating copy to clipboard operation
codehike copied to clipboard

Editable code blocks with live preview

Open DanielFGray opened this issue 3 years ago • 2 comments

I accomplished this with @codesandbox/sandpack but it would be great to have codehike's beautiful code blocks instead of a different highlighting/rendering engine

I wonder if this could be accomplished by layering a transparent textarea over the top of the code block? And then sending the new code to sandpack renderer, or react-runner, react-live, whatever works

Just to kick around an idea onto your back burner

DanielFGray avatar Jun 12 '22 18:06 DanielFGray

Using code hike to re-render the edited code would be hard, right now code hike does all the syntax highlighting on the server when the MDX is transformed to JSX.

So, right now this is out of scope, but maybe we could add something like this in the future.

pomber avatar Jun 14 '22 12:06 pomber

I'd also like to find a way to integrate https://github.com/viebel/klipse someday if I use CH heavily 🤞

Examples:

  • https://blog.klipse.tech/clojure/2020/09/10/new-way-html-css.html
  • https://blog.klipse.tech/clojure/2019/02/17/reframe-tutorial.html
  • https://book.klipse.tech/

texastoland avatar Jun 29 '23 22:06 texastoland