First cut at parsing the project.clj file too.
This commit is contained in:
parent
e54a83a28b
commit
0bd050d75a
2 changed files with 12 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
(defproject marginalia "0.8.0"
|
(defproject marginalia "0.8.1-SNAPSHOT"
|
||||||
:description "lightweight literate programming for clojure -- inspired by [docco](http://jashkenas.github.com/docco/)"
|
:description "lightweight literate programming for clojure -- inspired by [docco](http://jashkenas.github.com/docco/)"
|
||||||
;; :main marginalia.main
|
;; :main marginalia.main
|
||||||
:dependencies
|
:dependencies
|
||||||
|
|
|
@ -247,7 +247,7 @@
|
||||||
|
|
||||||
If no source files are found, complain with a usage message."
|
If no source files are found, complain with a usage message."
|
||||||
[args & [project]]
|
[args & [project]]
|
||||||
(let [[{:keys [dir file name version desc deps css js multi]} files help]
|
(let [[{:keys [dir file name version desc deps css js multi leiningen]} files help]
|
||||||
(cli args
|
(cli args
|
||||||
["-d" "--dir" "Directory into which the documentation will be written" :default "./docs"]
|
["-d" "--dir" "Directory into which the documentation will be written" :default "./docs"]
|
||||||
["-f" "--file" "File into which the documentation will be written" :default "uberdoc.html"]
|
["-f" "--file" "File into which the documentation will be written" :default "uberdoc.html"]
|
||||||
|
@ -260,8 +260,14 @@
|
||||||
If not given will be taken from project.clj."]
|
If not given will be taken from project.clj."]
|
||||||
["-j" "--js" "Additional javascript resources <resource1>;<resource2>;...
|
["-j" "--js" "Additional javascript resources <resource1>;<resource2>;...
|
||||||
If not given will be taken from project.clj"]
|
If not given will be taken from project.clj"]
|
||||||
["-m" "--multi" "Generate each namespace documentation as a separate file" :flag true])
|
["-m" "--multi" "Generate each namespace documentation as a separate file" :flag true]
|
||||||
sources (distinct (format-sources (seq files)))]
|
["-l" "--leiningen" "Generate the documentation for a Leiningen project file." :default "./project.clj"])
|
||||||
|
sources (distinct (format-sources (seq files)))
|
||||||
|
sources (if leiningen (cons leiningen sources) sources)]
|
||||||
|
(println "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
|
||||||
|
(println leiningen)
|
||||||
|
(println sources)
|
||||||
|
(println "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
|
||||||
(if-not sources
|
(if-not sources
|
||||||
(do
|
(do
|
||||||
(println "Wrong number of arguments passed to Marginalia.")
|
(println "Wrong number of arguments passed to Marginalia.")
|
||||||
|
@ -273,7 +279,8 @@
|
||||||
choose #(or %1 %2)
|
choose #(or %1 %2)
|
||||||
marg-opts (merge-with choose
|
marg-opts (merge-with choose
|
||||||
{:css (when css (.split css ";"))
|
{:css (when css (.split css ";"))
|
||||||
:javascript (when js (.split js ";"))}
|
:javascript (when js (.split js ";"))
|
||||||
|
:leiningen leiningen}
|
||||||
(:marginalia project-clj))
|
(:marginalia project-clj))
|
||||||
opts (merge-with choose
|
opts (merge-with choose
|
||||||
{:name name
|
{:name name
|
||||||
|
|
Loading…
Reference in a new issue