Indicate return value when appropriate

This commit is contained in:
oakes
2014-03-31 01:14:44 -04:00
parent 499ecf3fc7
commit 1628bca0cd
2 changed files with 8 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
[marginalia.core :as marg]
[play-clj-doclet.html :as html])
(:import [com.sun.javadoc ClassDoc ConstructorDoc Doc ExecutableMemberDoc
FieldDoc Parameter RootDoc]))
FieldDoc MethodDoc Parameter RootDoc]))
(def targets (-> "targets.edn" io/resource slurp edn/read-string))
@@ -37,6 +37,9 @@
{:name n})
(when (> (count (.commentText d)) 0)
{:text (.commentText d)})
(when (and (isa? (type d) MethodDoc)
(not= (-> d .returnType .typeName) "void"))
{:type (-> d .returnType .typeName)})
(cond
(isa? (type d) ExecutableMemberDoc)
{:args (->> d .parameters (map parse-param) vec)}

View File

@@ -10,13 +10,15 @@
param-name]))
(defn item
[{:keys [name text args]}]
[{:keys [name text type args]}]
[:div
[:p
[:b (str name)]
" "
(string/join ", " (map param args))]
(when text [:i text])])
(cond
text [:i text]
type [:i (str "Returns a " type)])])
(defn create-from-file
[parsed-file]