Liking cljdoc? Tell your friends :D

cljdoc.server.pedestal

Weaves together the various HTTP components of cljdoc.

Routing and HTTP concerns are handled via Pedestal and endpoints are implemented as intereceptors. For more details on routing see cljdoc.server.routes.

The main aspects handlded via HTTP (and thus through this namespace) are:

Weaves together the various HTTP components of cljdoc.

Routing and HTTP concerns are handled via Pedestal and
endpoints are implemented as [intereceptors](http://pedestal.io/reference/interceptors).
For more details on routing see [[cljdoc.server.routes]].

The main aspects handlded via HTTP (and thus through this namespace) are:

- Rendering documentation pages (see [[view]])
- Rendering build logs (see [[show-build]] & [[all-builds]])
- Rendering a sitemap (see [[sitemap-interceptor]])
- Handling build requests (see [[request-build]], [[full-build]] & [[circle-ci-webhook]])
- Redirecting to newer releases (see [[version-resolve-redirect]] & [[jump-interceptor]])
raw docstring

all-buildsclj

(all-builds build-tracker)
source

artifact-data-loaderclj

(artifact-data-loader store cache)

Return an interceptor that loads all data from store that is relevant for the artifact identified via the entity map in :path-params.

Return an interceptor that loads all data from `store` that is
relevant for the artifact identified via the entity map in `:path-params`.
sourceraw docstring

badge-interceptorclj

(badge-interceptor)
source

badge-urlclj

(badge-url status color)
source

build-sitemapclj

(build-sitemap {:keys [last-generated sitemap] :as state} storage)

Build a new sitemap if previous one was built longer than 60 minutes ago.

Build a new sitemap if previous one was built longer than 60 minutes ago.
sourceraw docstring

doc-slug-parserclj

Further process the article-slug URL segment by splitting on / characters.

This is necessary because we want to allow arbitrary nesting in user provided doctrees and Pedestal's router will return a single string for everything that comes after a wildcard path segment.

Further process the `article-slug` URL segment by splitting on `/` characters.

This is necessary because we want to allow arbitrary nesting in user
provided doctrees and Pedestal's router will return a single string
for everything that comes after a wildcard path segment.
sourceraw docstring

etag-interceptorclj

source

index-pageclj

(index-page store render-fn)

Return a list of interceptors suitable to render an group or artifact index page as specified by render-fn.

Return a list of interceptors suitable to render an group or
artifact index page as specified by `render-fn`.
sourceraw docstring

jump-interceptorclj

(jump-interceptor)
source

not-found-interceptorclj

source

offline-bundleclj

Creates an HTTP response with a zip file containing offline docs for the project that has been injected into the context by artifact-data-loader.

Creates an HTTP response with a zip file containing offline docs
for the project that has been injected into the context by [[artifact-data-loader]].
sourceraw docstring

redirect-to-build-pageclj

(redirect-to-build-page ctx build-id)
source

redirect-trailing-slash-interceptorclj

source

render-interceptorclj

This interceptor will render the documentation page for the current route based on the cache-bundle that has been injected into the context previously by the artifact-data-loader interceptor.

If the request is for the root page (e.g. /d/group/artifact/0.1.0) this interceptor will also lookup the first article that's part of the cache-bundle and return a 302 redirecting to that page.

This interceptor will render the documentation page for the current route
based on the cache-bundle that has been injected into the context previously
by the [[artifact-data-loader]] interceptor.

If the request is for the root page (e.g. /d/group/artifact/0.1.0) this interceptor
will also lookup the first article that's part of the cache-bundle and return a 302
redirecting to that page.
sourceraw docstring

request-buildclj

(request-build {:keys [analysis-service build-tracker] :as deps})

Create an interceptor that will initiate documentation builds based on provided form params using analysis-service for analysis and tracking build progress/state via build-tracker.

Create an interceptor that will initiate documentation builds based
on provided form params using `analysis-service` for analysis and tracking
build progress/state via `build-tracker`.
sourceraw docstring

request-build-validateclj

source

route-resolverclj

(route-resolver {:keys [build-tracker storage cache] :as deps}
                {:keys [route-name] :as route})

Given a route name return a list of interceptors to handle requests to that route.

This has been put into place to better separate route-definitions from handler implementation in case route-definitions become interesting for ClojureScript where Pededestal can't go.

For more details see cljdoc.server.routes.

Given a route name return a list of interceptors to handle requests
to that route.

This has been put into place to better separate route-definitions
from handler implementation in case route-definitions become
interesting for ClojureScript where Pededestal can't go.

For more details see `cljdoc.server.routes`.
sourceraw docstring

show-buildclj

(show-build build-tracker)
source

sitemap-interceptorclj

(sitemap-interceptor storage)
source

version-resolve-redirectclj

(version-resolve-redirect)

Intelligently resolve the CURRENT version based on the referer and Clojars releases.

Users may want to link to API docs from their existing non-API (Markdown/Asciidoc) documentation. Since links are usually tied to a specific version this can become cumbersome when updating docs. This interceptor intelligently rewrites any usages of CURRENT in the version part of the URL to use either

  • the version from the referring URL
  • the version of the last release from Clojars
Intelligently resolve the `CURRENT` version based on the referer
and Clojars releases.

Users may want to link to API docs from their existing non-API
(Markdown/Asciidoc) documentation. Since links are usually tied to a
specific version this can become cumbersome when updating docs.
This interceptor intelligently rewrites any usages of `CURRENT` in
the version part of the URL to use either

- the version from the referring URL
- the version of the last release from Clojars
sourceraw docstring

viewclj

(view storage cache route-name)

Combine various interceptors into an interceptor chain for rendering views for route-name.

Combine various interceptors into an interceptor chain for
rendering views for `route-name`.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close