Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.docs

Embedded documentation subsystem.

Any artifact on the classpath may ship docs by placing markdown under resources/vis-docs/ with a resources/vis-docs/vis-docs.edn manifest:

{:site {:title "Vis" :tagline "…" :repo "https://…"} ; optional, site-level :pages [{:file "index.md" :title "Introduction" :section nil :order 0} {:file "x.md" :title "X" :section "Runtime" :order 30}]}

Every vis-docs/vis-docs.edn on the classpath is discovered (the same per-artifact auto-discovery native-image config uses), so an extension adds a page by dropping a markdown file + a manifest entry — no central registry.

One renderer, two outputs:

  • build-site! writes a static, themed HTML bundle (for GitHub Pages).
  • handle serves the same pages live (HTMX nav), mountable on the gateway via its :gateway.slot/http-routes slot.

Markdown → HTML uses commonmark-java (already a dependency); the theme is an enterprise-grade docs layout (sticky header, sidebar, on-this-page rail) in the VIS palette (cobalt on white, Hanken Grotesk + JetBrains Mono).

Embedded documentation subsystem.

Any artifact on the classpath may ship docs by placing markdown under
`resources/vis-docs/` with a `resources/vis-docs/vis-docs.edn` manifest:

  {:site  {:title "Vis" :tagline "…" :repo "https://…"}   ; optional, site-level
   :pages [{:file "index.md" :title "Introduction" :section nil :order 0}
           {:file "x.md"     :title "X"            :section "Runtime" :order 30}]}

Every `vis-docs/vis-docs.edn` on the classpath is discovered (the same
per-artifact auto-discovery native-image config uses), so an extension adds a
page by dropping a markdown file + a manifest entry — no central registry.

One renderer, two outputs:
  * `build-site!` writes a static, themed HTML bundle (for GitHub Pages).
  * `handle` serves the same pages live (HTMX nav), mountable on the gateway
    via its `:gateway.slot/http-routes` slot.

Markdown → HTML uses commonmark-java (already a dependency); the theme is an
enterprise-grade docs layout (sticky header, sidebar, on-this-page rail) in
the VIS palette (cobalt on white, Hanken Grotesk + JetBrains Mono).
raw docstring

*live-reload?*clj

When true, handle re-collects the docs (re-reads the markdown from the classpath) on EVERY request, so editing resources/vis-docs/*.md during development shows on a browser refresh — no gateway restart. Cheap (a handful of small markdown files) and docs traffic is tiny. Bind false to serve the frozen site-cache snapshot if you ever want it.

When true, `handle` re-`collect`s the docs (re-reads the markdown from the
classpath) on EVERY request, so editing `resources/vis-docs/*.md` during
development shows on a browser refresh — no gateway restart. Cheap (a handful
of small markdown files) and docs traffic is tiny. Bind false to serve the
frozen `site-cache` snapshot if you ever want it.
sourceraw docstring

build-site!clj

(build-site! out-dir)

Render the discovered docs to a static themed HTML bundle under out-dir.

Render the discovered docs to a static themed HTML bundle under `out-dir`.
sourceraw docstring

collectclj

(collect)

Discover every vis-docs manifest on the classpath → {:site {…} :pages [{:slug :title :section :order :md :html :toc} …]}, sorted by (section, order, title); slug "index" is always first.

Discover every vis-docs manifest on the classpath →
{:site {…} :pages [{:slug :title :section :order :md :html :toc} …]}, sorted
by (section, order, title); slug "index" is always first.
sourceraw docstring

handleclj

(handle {:keys [uri headers] :or {uri ""}})

Ring handler for the docs site. Returns nil for paths it does not own (so the gateway can fall through). Owns /docs, /docs/<slug>, /docs/assets/**.

Ring handler for the docs site. Returns nil for paths it does not own (so the
gateway can fall through). Owns `/docs`, `/docs/<slug>`, `/docs/assets/**`.
sourceraw docstring

md->htmlclj

(md->html md)
source

page-htmlclj

(page-html {:keys [site] :as site-data}
           {:keys [slug title html toc] :as _page}
           mode)

Full HTML document for one page. mode ∈ #{:static :live}.

Full HTML document for one page. `mode` ∈ #{:static :live}.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close