Back

doc (clj)

(source)

macro

(doc name)
Prints documentation for a var or special form given its name, or for a spec if given a keyword

Examples

babashka/babashka
(require '[clojure.repl])

(defmacro random-doc []
  (let [sym (-> (ns-publics 'clojure.core) keys rand-nth)]
    (if (:doc (meta (resolve sym)))
      `(clojure.repl/doc ~sym)
      `(random-doc))))

(random-doc)
cognitect-labs/aws-api
(ns s3-examples
  (:require [clojure.core.async :as a]
            [clojure.spec.alpha :as s]
            [clojure.spec.gen.alpha :as gen]
            [clojure.java.io :as io]
            [clojure.repl :as repl]
            [cognitect.aws.client.api :as aws]))

  ;; op doc-data
  (-> (aws/ops s3) :CreateBucket)
  ;; a little more friendly
  (aws/doc s3 :CreateBucket)

  ;; see how submit works
  (repl/doc aws/invoke)

  ;; see how submit works w/ async
  (clojure.repl/doc aws/invoke-async)
PrecursorApp/precursor
(ns pc.repl
  "Utility functions to make repl access more convenient.
   Also serves as a guide for how nses should be aliased"
  (:require [cemerick.url :as url]
            [cheshire.core :as json]
            [clj-http.client :as http]
            [clj-time.core :as time]
            [clojure.core.async :as async]
            [clojure.java.javadoc :refer (javadoc)]
            [clojure.repl :refer :all]
            [datomic.api :as d]
            [pc.billing :as billing]
            [pc.datomic :as pcd]
            [pc.datomic.web-peer :as web-peer]
            [pc.email :as email]
            [pc.http.plan :as plan-http]
            [pc.http.sente :as sente]
            [pc.models.chat :as chat-model]
            [pc.models.cust :as cust-model]
            [pc.models.doc :as doc-model]
            [pc.models.flag :as flag-model]
            [pc.models.issue :as issue-model]
            [pc.models.layer :as layer-model]
            [pc.models.permission :as permission-model]
            [pc.models.plan :as plan-model]
            [pc.models.team :as team-model]
            [pc.stripe :as stripe]
            [slingshot.slingshot :refer (try+ throw+)]))

(defmacro java-doc [x]
  `(do
     (require 'clojure.java.javadoc)
     (clojure.java.javadoc/javadoc ~x)))