Improved integration into Leiningen for better help summary and message.

This commit is contained in:
Nicolas Buduroi 2011-01-17 16:44:44 -05:00
parent c8d94fd092
commit 78b8b4c0f1
2 changed files with 9 additions and 25 deletions

View file

@ -1,31 +1,15 @@
(ns leiningen.marg
"# Leiningen plugin for running marginalia against your project.
## Usage
1. Add `[marginalia \"<current version number>\"]` to your project.clj's `:dev-dependencies` section.
2. run `lein marg` from your project's root directory. "
"Run Marginalia against your project source files."
(:use [leiningen.compile :only [eval-in-project]]
marginalia.core))
(defn marg [project & args]
(eval-in-project project
`(do
(require 'marginalia.core)
(marginalia.core/run-marginalia (list ~@args)))))
;; You can pass a file, directory, multiple files and/or directories to marginalia like so:
;;
;; $ lein marg # runs marginalia on all the cljs found in your ./src dir.
;; $ lein marg ./path/to/files # runs marginalia on all cljs found in ./path/to/files
;; $ lein marg ./path/to/file.clj # runs marginalia on ./path/to/file.clj only.
;; $ lein marg ./path/to/one.clj ./path/to/another.clj
;; $ lein marg ./path/to/dir ./path/to/some/random.clj
;;
;; This allows you to control the order in which sections appear in the generated
;; documentation. For example, in marginalia's docs, the leiningen.marg namespace
;; forced to the bottom of the namespace ordering by using this command:
;;
;; $ lein marg ./src/marginalia ./src/leiningen
`(marginalia.core/run-marginalia (list ~@args))
nil
nil
'(require 'marginalia.core)))
(.setMeta #'marg
(assoc (.meta #'marg)
:doc (with-out-str (run-marginalia (list "-h")))))

View file

@ -212,7 +212,7 @@
(defn run-marginalia [args]
(with-command-line args
(str "Leiningen plugin for running marginalia against your project.\n\n"
"Usage: marginalia <options?> <src1> ... <src-n>\n")
"Usage: lein marg <options?> <src1> ... <src-n>\n")
[[dir d "Directory into which the documentation will be written" "./docs"]
[file f "File into which the documentation will be written" "uberdoc.html"]
sources]