Improved integration into Leiningen for better help summary and message.
This commit is contained in:
parent
c8d94fd092
commit
78b8b4c0f1
2 changed files with 9 additions and 25 deletions
|
@ -1,31 +1,15 @@
|
||||||
(ns leiningen.marg
|
(ns leiningen.marg
|
||||||
"# Leiningen plugin for running marginalia against your project.
|
"Run Marginalia against your project source files."
|
||||||
|
|
||||||
## 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. "
|
|
||||||
(:use [leiningen.compile :only [eval-in-project]]
|
(:use [leiningen.compile :only [eval-in-project]]
|
||||||
marginalia.core))
|
marginalia.core))
|
||||||
|
|
||||||
(defn marg [project & args]
|
(defn marg [project & args]
|
||||||
(eval-in-project project
|
(eval-in-project project
|
||||||
`(do
|
`(marginalia.core/run-marginalia (list ~@args))
|
||||||
(require 'marginalia.core)
|
nil
|
||||||
(marginalia.core/run-marginalia (list ~@args)))))
|
nil
|
||||||
|
'(require 'marginalia.core)))
|
||||||
;; 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
|
|
||||||
|
|
||||||
|
|
||||||
|
(.setMeta #'marg
|
||||||
|
(assoc (.meta #'marg)
|
||||||
|
:doc (with-out-str (run-marginalia (list "-h")))))
|
||||||
|
|
|
@ -212,7 +212,7 @@
|
||||||
(defn run-marginalia [args]
|
(defn run-marginalia [args]
|
||||||
(with-command-line args
|
(with-command-line args
|
||||||
(str "Leiningen plugin for running marginalia against your project.\n\n"
|
(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"]
|
[[dir d "Directory into which the documentation will be written" "./docs"]
|
||||||
[file f "File into which the documentation will be written" "uberdoc.html"]
|
[file f "File into which the documentation will be written" "uberdoc.html"]
|
||||||
sources]
|
sources]
|
||||||
|
|
Loading…
Reference in a new issue