A Codox writer that generates Markdown documentation instead of HTML, designed for embedding API docs in Clojure library JARs as classpath resources.
Clojure libraries ship source in JARs, but not documentation. codox-md adds Markdown API docs to your JAR at build time, under a namespaced path (docs/<group>/<artifact>/) that avoids conflicts with other libraries. These docs can then be discovered and browsed at runtime using clj-doc-browse.
codox-md provides two things:
codox.writer.markdown — A Codox-compatible writer that emits .md files instead of HTMLcodox.md.build — A build-time helper that integrates with clojure -T:build, using create-basis and DynamicClassLoader to load your project's dependencies and Codox in-process:build alias;; deps.edn
:build {:deps {io.github.clojure/tools.build
{:git/tag "v0.10.10" :git/sha "deedd62"}
slipset/deps-deploy {:mvn/version "0.2.2"}
com.dcj/codox-md {:mvn/version "0.2.0"}}
:ns-default build}
build.clj(ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[codox.md.build :as doc]
[deps-deploy.deps-deploy :as dd]))
(def lib 'com.example/my-lib)
(def version "0.1.0")
(def class-dir "target/classes")
(defn ci [opts]
;; ... (test, delete target, write pom) ...
(let [opts (jar-opts opts)]
(b/write-pom opts)
;; Generate Markdown API docs
(doc/generate-docs {:lib lib :version version
:description (:description opts)
:source-uri (str (get-in opts [:scm :url])
"/blob/{git-commit}/{filepath}#L{line}")})
;; Include generated docs in the JAR
(b/copy-dir {:src-dirs ["resources" "src" "target/doc-resources"]
:target-dir class-dir})
(b/jar opts))
opts)
clojure -T:build ci
Your JAR now contains:
docs/com.example/my-lib/
index.md # Library overview + namespace listing
my.namespace.md # Full API docs per namespace
guides/ # Optional, from doc/ directory
Each namespace file includes:
{git-commit} for stable GitHub URLs)The :source-uri option supports these placeholders:
| Placeholder | Value |
|---|---|
{filepath} | Path relative to project root (e.g. src/my/ns.clj) |
{classpath} | Classpath-relative path (e.g. my/ns.clj) |
{line} | Line number |
{version} | Project version string |
{git-commit} | Current HEAD commit SHA |
DynamicClassLoader for in-process dep loading)Libraries with embedded docs become queryable by AI coding assistants. With Claude Code and clojure-mcp, a /deps-docs skill lets Claude read your dependency docs at the REPL instead of relying on training data or web search.
Create ~/.claude/commands/deps-docs.md with these capabilities:
/deps-docs — list libraries with embedded docs on the classpath/deps-docs some.namespace — fetch API docs for a namespace/deps-docs group/artifact — list documented namespaces in a library/deps-docs search query — full-text search across all docs/deps-docs setup — add clj-doc-browse to a project's :nrepl alias and CLAUDE.mdThe skill uses the clojure-mcp nREPL eval tool to call doc.browse functions. When Claude needs to understand a dependency's API, it can pull the docs directly instead of guessing. This is especially valuable for private or niche libraries that aren't in the model's training data.
See the deps-docs skill source for the full implementation.
If your library embeds Markdown API docs via codox-md, advertise it in your README so downstream consumers (and AI assistants) know (doc.browse/print-doc ...) and the /deps-docs skill will surface it.
Drop this snippet near the top of your README:
[](https://github.com/dcj/codox-md)
This JAR embeds Markdown API documentation at `docs/<group>/<artifact>/` via [codox-md](https://github.com/dcj/codox-md). Browse with [clj-doc-browse](https://github.com/dcj/clj-doc-browse) at the REPL, or the `/deps-docs` skill in [Claude Code](https://claude.com/claude-code).
Use the badge URL verbatim — the convention only works if every consumer's badge links back to this repo, so a clicker lands on documentation explaining what the embedded resources are and how to read them.
Copyright (C) 2026 Clark Communications Corporation
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |