From 0bd050d75a4c992ea90eb81f5e166179ad1ba0c8 Mon Sep 17 00:00:00 2001 From: fogus Date: Tue, 18 Nov 2014 12:43:18 -0500 Subject: [PATCH] First cut at parsing the project.clj file too. --- project.clj | 2 +- src/marginalia/core.clj | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/project.clj b/project.clj index 5977e8e..a4d0a22 100644 --- a/project.clj +++ b/project.clj @@ -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/)" ;; :main marginalia.main :dependencies diff --git a/src/marginalia/core.clj b/src/marginalia/core.clj index ca2485a..b1164c2 100644 --- a/src/marginalia/core.clj +++ b/src/marginalia/core.clj @@ -247,7 +247,7 @@ If no source files are found, complain with a usage message." [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 ["-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"] @@ -260,8 +260,14 @@ If not given will be taken from project.clj."] ["-j" "--js" "Additional javascript resources ;;... If not given will be taken from project.clj"] - ["-m" "--multi" "Generate each namespace documentation as a separate file" :flag true]) - sources (distinct (format-sources (seq files)))] + ["-m" "--multi" "Generate each namespace documentation as a separate file" :flag true] + ["-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 (do (println "Wrong number of arguments passed to Marginalia.") @@ -273,7 +279,8 @@ choose #(or %1 %2) marg-opts (merge-with choose {:css (when css (.split css ";")) - :javascript (when js (.split js ";"))} + :javascript (when js (.split js ";")) + :leiningen leiningen} (:marginalia project-clj)) opts (merge-with choose {:name name