Skip to content

Commit fede2c5

Browse files
authored
[Fix #221] Describe :no-doc metadata (#224)
1 parent 4833ad4 commit fede2c5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.adoc

+34
Original file line numberDiff line numberDiff line change
@@ -2305,6 +2305,40 @@ When talking about vars - items in the same namespace don't need to fully qualif
23052305
NOTE: Many Clojure programming tools will also try to extract references to other vars from the docstring, but it's both
23062306
simpler and more explicit to use the `:see-also` metadata instead.
23072307

2308+
=== `:no-doc`
2309+
2310+
Documentation tools like https://github.com/weavejester/codox#metadata-options[Codox] like https://github.com/cljdoc/cljdoc/blob/master/doc/userguide/for-library-authors.adoc#hiding-namespaces-vars-in-documentation[cljdoc] recognize `:no-doc` metadata.
2311+
When a var or a namespace has `:no-doc` metadata, it indicates to these tools that it should be excluded from generated API docs.
2312+
2313+
To exclude an entire namespace from API docs:
2314+
[source,clojure]
2315+
----
2316+
(ns ^:no-doc my-library.impl
2317+
"Internal implementation details")
2318+
2319+
...
2320+
----
2321+
2322+
To exclude vars within a documented namespace:
2323+
[source,clojure]
2324+
----
2325+
(ns my-library.api)
2326+
2327+
;; private functions do not get documented
2328+
(defn- clearly-private []
2329+
...)
2330+
2331+
;; nor do public functions with :no-doc metadata
2332+
(defn ^:no-doc shared-helper []
2333+
...)
2334+
2335+
;; this function will be documented
2336+
(defn api-fn1
2337+
"I am useful to the public"
2338+
[]
2339+
...)
2340+
----
2341+
23082342
=== Indentation Metadata
23092343

23102344
Unlike other Lisp dialects, Clojure doesn't have a standard metadata format to specify the indentation of macros.

0 commit comments

Comments
 (0)