Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - Lein / lein new support #194

Open
sdedovic opened this issue Jan 18, 2025 · 4 comments
Open

Question - Lein / lein new support #194

sdedovic opened this issue Jan 18, 2025 · 4 comments

Comments

@sdedovic
Copy link

I am picking this library up as I work through SICM. In the repl, everything works as expected. But when I want to try out the interactive notebook, it seems you have converged on deps and deps-new. Is there any plan to support Leiningen and/or lein new for template generation? I feel like using Emmy with Clerk is two steps back and one step forward for me.

This is less of a feature request and more of a general inquiry.

@sritchie
Copy link
Member

@sdedovic I think our published artifacts should work just fine with Lein, yeah? via [org.mentat/emmy "0.32.0"]?

I'd take a PR for sure making lein new easy, I just don't currently have the space to work on it.

@sdedovic
Copy link
Author

sdedovic commented Jan 19, 2025

Ok cool, I'll check it out. What confused me is the following section in the Emmy docs:

Using Emmy with Nextjournal's Clerk gives you the ability to write notebooks like this one.

Doing this requires that you generate a custom ClojureScript build for your Clerk project. The easiest way to do this for an existing project is with the clerk-utils project. Follow the instructions on the clerk-utils guide for custom ClojureScript.

If this is your first time using Clerk, use the emmy/clerk template described below to generate a new project with all steps described in "Emmy via SCI" already completed.

and how this pertains to using Leiningen

@sdedovic
Copy link
Author

An update - I was able to generate the template using deps-new and then convert it to a Leiningen project, A few caveats:

  • lein can only target artifacts published to clojars / maven central / etc. not github dependencies
  • in order for things to work smoothly I had to upgrade com.taoensso/timbre to 6.6.1 due to some bug in the transitive dependency on encore. Didn't spend too much time figuring out why it was bugged for me, but that upgrade fixed everything.

As for making a lein template,

  • similarly, a lein template must be published to (preferably) clojars in order to use it
  • templates are just mustache files and some clojure code (leiningen.new/render) and it can be bundled with Emmy, if you'd like.

This means adding some code to this repo with the templates and a new leiningen.new package to execute the template. If that's something you want added to this repo, I'm happy to open a PR, it will probably save me time in the future as I work through SICM and some of my other projects.

@sdedovic
Copy link
Author

I think our published artifacts should work just fine with Lein, yeah? via [org.mentat/emmy "0.32.0"]?

yeah, that's my understanding as well. The only templates i've written are standalone repos but no reason that won't just work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants