Janet Notes and Examples


In the repl:

(doc math/sqrt)

# Find all the bindings with "push" in its name:
(doc "push")

# Find all the bindings in the "array" module:
(doc "array/")  # Note trailing slash.

(def f math/sqrt)
(doc f)    # Nope.
(doc-of f) # There we go.

To add a docstring to a module:

(setdyn :doc ```This is a module-level docstring```)

# ... the rest of the module.

and read it as you’d expect:

repl> (import my-module)
repl> (doc my-module)