(defhandler
  :path "/sx/api/spec-detail"
  :method :get
  :returns "element"
  (&key)
  (let
    ((filename (helper "request-arg" "file" ""))
      (def-name (helper "request-arg" "name" "")))
    (if
      (or (= filename "") (= def-name ""))
      (div
        (~tw :tokens "text-sm text-stone-400 p-2")
        "Missing file or name parameter")
      (let
        ((d (spec-explore-define filename def-name)))
        (if
          d
          (~specs-explorer/spec-explorer-define-detail :d d :filename filename)
          (div
            (~tw :tokens "text-sm text-stone-400 p-2")
            (str "Definition '" def-name "' not found in " filename)))))))
