Skip to content

Commit

Permalink
Make more of the internal implementation details private
Browse files Browse the repository at this point in the history
to avoid polluting the namespace of those who use this.
  • Loading branch information
Andy Fingerhut committed Dec 3, 2011
1 parent 9577ad6 commit def265f
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/cd_client/core.clj
Expand Up @@ -7,16 +7,16 @@




;; For testing purposes use localhost:8080 ;; For testing purposes use localhost:8080
(def ^:dynamic *clojuredocs-root* "http://api.clojuredocs.org") (def ^:private ^:dynamic *clojuredocs-root* "http://api.clojuredocs.org")
;;(def ^:dynamic *clojuredocs-root* "http://localhost:8080") ;;(def ^:private ^:dynamic *clojuredocs-root* "http://localhost:8080")


(def ^:dynamic *examples-api* (str *clojuredocs-root* "/examples/")) (def ^:private ^:dynamic *examples-api* (str *clojuredocs-root* "/examples/"))
(def ^:dynamic *search-api* (str *clojuredocs-root* "/search/")) (def ^:private ^:dynamic *search-api* (str *clojuredocs-root* "/search/"))
(def ^:dynamic *comments-api* (str *clojuredocs-root* "/comments/")) (def ^:private ^:dynamic *comments-api* (str *clojuredocs-root* "/comments/"))
(def ^:dynamic *seealso-api* (str *clojuredocs-root* "/see-also/")) (def ^:private ^:dynamic *seealso-api* (str *clojuredocs-root* "/see-also/"))




(def ^:dynamic *debug-flags* (ref #{})) (def ^:private ^:dynamic *debug-flags* (ref #{}))


(defn enable-debug-flags [& keywords] (defn enable-debug-flags [& keywords]
(dosync (alter *debug-flags* (dosync (alter *debug-flags*
Expand All @@ -31,7 +31,7 @@


;; Use one of the functions set-local-mode! or set-web-mode! below to ;; Use one of the functions set-local-mode! or set-web-mode! below to
;; change the mode, and show-mode to show the current mode. ;; change the mode, and show-mode to show the current mode.
(def ^:dynamic *cd-client-mode* (ref {:source :web})) (def ^:private ^:dynamic *cd-client-mode* (ref {:source :web}))




(defn set-local-mode! [fname] (defn set-local-mode! [fname]
Expand Down Expand Up @@ -83,7 +83,7 @@
\| "%7C" })) \| "%7C" }))




(defn remove-markdown (defn- remove-markdown
"Remove basic markdown syntax from a string." "Remove basic markdown syntax from a string."
[text] [text]
(-> text (-> text
Expand Down Expand Up @@ -152,6 +152,15 @@
`(examples-core ~ns ~name))) `(examples-core ~ns ~name)))




;; Can we make pr-examples-core private, to avoid polluting namespace
;; of those who wish to use this namespace? Trying defn- or defn
;; ^:private instead of defn for pr-examples-core, then this fails:
;;
;; (require '[cd-client.core :as c])
;; (c/pr-examples *)
;;
;; saying that cd-client.core/pr-examples-core is not public.

(defn pr-examples-core (defn pr-examples-core
"Given a namespace and name (as strings), pretty-print all the examples for it "Given a namespace and name (as strings), pretty-print all the examples for it
from clojuredocs" from clojuredocs"
Expand Down

0 comments on commit def265f

Please sign in to comment.