Refactor and improve how fields are displayed
This commit is contained in:
@@ -2,35 +2,28 @@
|
||||
(:require [clojure.string :as string]
|
||||
[hiccup.core :refer :all]))
|
||||
|
||||
(defn camel->keyword
|
||||
[s]
|
||||
(->> (string/split (string/replace s "_" "-") #"(?<=[a-z])(?=[A-Z])")
|
||||
(map string/lower-case)
|
||||
(string/join "-")
|
||||
keyword))
|
||||
|
||||
(defn param
|
||||
[[type-name param-name]]
|
||||
(html [:span {}
|
||||
[:span {:class "type-name"} "^" type-name]
|
||||
" "
|
||||
(-> param-name camel->keyword name)]))
|
||||
param-name]))
|
||||
|
||||
(defn item
|
||||
[[name text params]]
|
||||
[{:keys [name text args]}]
|
||||
[:div
|
||||
[:p
|
||||
[:b (str name)]
|
||||
" "
|
||||
(string/join ", " (map param params))]
|
||||
(when (> (count text) 0)
|
||||
[:i text])])
|
||||
(string/join ", " (map param args))]
|
||||
(when text [:i text])])
|
||||
|
||||
(defn create-from-file
|
||||
[parsed-file]
|
||||
(for [group (:groups parsed-file)]
|
||||
[:div
|
||||
[:h1 {} (:name group)]
|
||||
(:docstring group)
|
||||
(for [[name items] (:java group)]
|
||||
[:div
|
||||
(when (not= (:name group) name)
|
||||
|
||||
Reference in New Issue
Block a user