codox icon indicating copy to clipboard operation
codox copied to clipboard

Feature: show specs in HTML-documentation

Open n2o opened this issue 8 years ago • 1 comments

Specs appear in the documentation when called in a REPL. It would be great when these specs would appear in the generated HTML files.

Minimal example:

(require '[clojure.spec.alpha :as s]
         '[clojure.repl :refer [doc]])

(s/fdef add
        :args (s/cat :x int? :y int?)
        :ret int?)

(defn add
  "Insecure add."
  [x y] (+ x y))

(doc add)

Prints:

foo.core/add
([x y])
  Insecure add.
Spec
  args: (cat :x int? :y int?)
  ret: int?

n2o avatar Sep 13 '17 14:09 n2o

Seems this was merged and reverted due to some issues with reader in https://github.com/weavejester/codox/pull/134 . Will be great to see this since the core docs display specs with autodoc : https://github.com/tomfaulhaber/autodoc

tirkarthi avatar Apr 26 '18 09:04 tirkarthi