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

Handle lein-exec scripts #121

Closed
eigenhombre opened this issue Nov 27, 2013 · 2 comments
Closed

Handle lein-exec scripts #121

eigenhombre opened this issue Nov 27, 2013 · 2 comments

Comments

@eigenhombre
Copy link

For short little programs, I often don't bother with project.clj and use the marvelous lein-exec plugin instead. For example,

#!/usr/bin/env lein-exec

(require 'leiningen.exec)
(leiningen.exec/deps '[[clj-time "0.4.3"]])
(use '[clojure.string  :only [split]])
(defn main [arg] (println arg))
(main (second *command-line-args*))

Because these scripts can implement nice little self-contained analyses, I would love the ability to use Marginalia to annotate, explain and share them without the extra baggage of project.clj.

How hard would it be to get Marginalia to annotate such simple Clojure code without all the extra project.clj foofaraw?

@gdeer81
Copy link
Collaborator

gdeer81 commented Jan 6, 2017

I was thinking about making a command line flag so you could tell marg that your documenting a lein-exec script, but then I thought this would be the only case where you wouldn't have a project.clj file. I did some experimenting and then Boot came out. So with my spike code would treat boot projects like a lein-exec project.

So now I'm going back to the drawing board and I'm thinking that it would be best to be explicit and say that you must pass in a flag to have marg process your code as a lein-exec project

@tsmacdonald
Copy link
Collaborator

As far as I know, lein-exec isn't used any more. Using tools.deps, you can do the same sort of thing with an alias like this:

  ;; Generate a single file's docs with
  ;;   clojure -M:marginalia/one src/metabase/some/namespace.clj
  ;; which creates `backend-docs/metabase.some.namespace.html`
  :marginalia/one
  {:extra-deps
   {marginalia/marginalia {:mvn/version "0.9.2"}}
   :main-opts ["-m" "marginalia.main" "-m" "-n" "Metabase" "-d" "backend-docs" "-D"
               "The simplest, fastest way to get business intelligence and analytics to everyone in your company 😋"]}

I'm closing this as "not planned", but if there's a big contingent of lein-exec users hanging around then I can reopen the issue and take it more seriously.

@tsmacdonald tsmacdonald closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
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

3 participants