clerk icon indicating copy to clipboard operation
clerk copied to clipboard

VS Code clerk/show!

Open brettrowberry opened this issue 2 years ago • 10 comments

Add VS Code clerk/show! file watcher hotkey instructions.

brettrowberry avatar Jan 23 '23 15:01 brettrowberry

Thanks @mike706574 for helping me figure this out!

brettrowberry avatar Jan 23 '23 15:01 brettrowberry

Hmm, looks like this info is also in https://github.com/nextjournal/clerk#editor-workflow so I'd need to update that too.

brettrowberry avatar Jan 23 '23 15:01 brettrowberry

Hey @brettrowberry,

Thanks a for looking into this, been wanting to have this for a while. Do you think setting up a global shortcut for nextjournal.clerk/show! would also be reasonable? I use alt+enter in Emacs. I'm on the fence if we should include a shortcut for nextjournal.clerk/serve!, maybe leave that as an exercise for the reader?

mk avatar Feb 02 '23 10:02 mk

the show! shortcut from updated book.clj does not work for me in windows, because $file contains escaped characters "C:\U...." that can not be read by the REPL easiest fix would probably be on Calva's side by escaping the path btw thx for your amazing work!

blnote avatar Feb 22 '23 10:02 blnote

$file contains escaped characters "C:\U...." that can not be read by the REPL

Ouch! That needs to be fixed in Calva. Please file an issue there!

PEZ avatar May 08 '23 07:05 PEZ

Thanks for looking into this @PEZ, I've filed https://github.com/BetterThanTomorrow/calva/issues/2184.

mk avatar May 08 '23 07:05 mk

Thanks for the issue, @mk!

@blnote : Here's a build of Calva that should be escaping the file path backslashes. I don't have a Windows machine handy, can you give it a spin?

  • https://output.circle-artifacts.com/output/job/3f508067-675f-493b-8d6b-f75735ce2464/artifacts/0/tmp/artifacts/calva-2.0.358-2184-escape-windows-filenames-d34b218a.vsix

To install it you need to download the VSIX package to your machine (and rename it the extension to .vsix if it downloads as a .zip), then from the Extension pane in VS Code, select Install from VSIX... in the meatballs menu at the top of the pane.

PEZ avatar May 08 '23 14:05 PEZ

This fix is now released, blindly, in Calva v2.0.358. All that is changed is that all \ in $file will be replaced with \\. So, it really should fix the issue...

Another thing. I'd like to mention a new feature in Calva, released with v2.0.356, that might, or might not, be relevant for Clerk notebooks workflow. It's a way to get code called when the file is loaded in the REPL (using Calva's command for Load File). The same substitutions as with the custom command snippets are available here. See: Calva: Auto-evaluate Code at file/namespace load/evaluation for details.

PEZ avatar May 09 '23 07:05 PEZ

Hi Peter, I've sent u an email yesterday but didn't reply to the list, maybe it got lost. I tried it and the issue was fixed for me, so the simple replacement worked. Thanks again, Bastian

Am 09.05.2023 um 11:25 schrieb Peter Strömberg:

This fix is now released, blindly, in Calva v2.0.358. All that is changed is that all || in |$file| will be replaced with |\|. So, it really /should/ fix the issue...

Another thing. I'd like to mention a new feature in Calva, released with v2.0.356, that might, or might not, be relevant for Clerk notebooks workflow. It's a way to get code called when the file is loaded in the REPL (using Calva's command for Load File). The same substitutions as with the custom command snippets are available here. See: Calva: Auto-evaluate Code at file/namespace load/evaluation https://calva.io/customizing-jack-in-and-connect/#auto-evaluate-code-at-filenamespace-loadevaluation for details.

— Reply to this email directly, view it on GitHub https://github.com/nextjournal/clerk/pull/393#issuecomment-1539573416, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZ3CEX4BQMGAORU7RQWRE3XFIESNANCNFSM6AAAAAAUD72BBE. You are receiving this because you were mentioned.Message ID: @.***>

blnote avatar May 09 '23 10:05 blnote

I haven't used Clerk for a long time. Feel free to close or do whatever. Thanks!

brettrowberry avatar Jun 21 '23 13:06 brettrowberry