|
186 | 186 | :description (.text (.select desc-div ".block")) |
187 | 187 | :static? is-static? |
188 | 188 | :clojure-call (clojure-call-syntax class-part signature is-static?)}))) |
189 | | - class-html (.outerHtml ^org.jsoup.nodes.Element class-desc-section) result {:classname class-name |
| 189 | + class-html (when class-desc-section (.outerHtml ^org.jsoup.nodes.Element class-desc-section)) |
| 190 | + result {:classname class-name |
190 | 191 | :class-description-html class-html |
191 | | - :class-description-md (html-to-md class-html) |
| 192 | + :class-description-md (when class-html (html-to-md class-html)) |
192 | 193 | :methods all-methods}] |
193 | 194 | (if method-part |
194 | 195 | (let [filtered (filter-methods all-methods method-part param-tags)] |
195 | 196 | (assoc result :selected-method |
196 | 197 | (mapv #(get-method-detail doc %) filtered))) |
197 | 198 | result))) |
198 | 199 |
|
199 | | -(defn print-javadoc [{:keys [class-description-md selected-method]}] |
200 | | - (let [condense-lines (fn [s] (str/replace s #"\n{3,}" "\n\n"))] |
201 | | - (if selected-method |
202 | | - (doseq [{:keys [method-description-md]} selected-method] |
203 | | - (println (condense-lines method-description-md))) |
204 | | - (println (condense-lines class-description-md))))) |
205 | | - |
206 | | -(defn print-signatures [{:keys [methods selected-method]}] |
| 200 | + (defn print-javadoc [{:keys [classname class-description-md selected-method]}] |
| 201 | + (let [condense-lines (fn [s] (str/replace s #"\n{3,}" "\n\n"))] |
| 202 | + (cond |
| 203 | + selected-method (doseq [{:keys [method-description-md]} selected-method] |
| 204 | + (if method-description-md |
| 205 | + (println (condense-lines method-description-md)) |
| 206 | + (println "No javadoc description available for this method."))) |
| 207 | + class-description-md (println (condense-lines class-description-md)) |
| 208 | + :else (println (str "No javadoc description available for class: " classname))))) |
| 209 | + |
| 210 | +(defn print-signatures [{:keys [classname methods selected-method]}] |
207 | 211 | (let [methods-to-print (or selected-method methods)] |
208 | | - (doseq [{:keys [clojure-call]} methods-to-print] |
209 | | - (println clojure-call)))) |
| 212 | + (if (seq methods-to-print) |
| 213 | + (doseq [{:keys [clojure-call]} methods-to-print] |
| 214 | + (println clojure-call)) |
| 215 | + (println (str "No method signatures available for: " classname))))) |
0 commit comments