Liking cljdoc? Tell your friends :D
Clojure only.

dev.arkaitz.web-base.paging

A list in numbered pages, read from the query's page (since 0.18.0). The host counts its rows and reads one page of them; this namespace decides which page that is, and what a page that no longer exists answers. No SQL and no markup: the statement and the pager's words are the host's.

A page goes past the end without anyone typing it: the last row of the last page moves out of a filter, a colleague's move does it, a tab sits open. A well-formed page past the end therefore answers a 303 to the last page, with the rest of the query kept — never a 404 for a link that worked a second ago, and never the last page rendered under a URL that names another. A page nobody could have linked to — junk, zero, a leading zero, sent twice — is a 404.

A list in numbered pages, read from the query's `page` (since 0.18.0). The host counts
its rows and reads one page of them; this namespace decides which page that is, and
what a page that no longer exists answers. No SQL and no markup: the statement and the
pager's words are the host's.

A page goes past the end without anyone typing it: the last row of the last page moves
out of a filter, a colleague's move does it, a tab sits open. A well-formed page past
the end therefore answers a 303 to the last page, with the rest of the query kept —
never a 404 for a link that worked a second ago, and never the last page rendered under
a URL that names another. A `page` nobody could have linked to — junk, zero, a leading
zero, sent twice — is a 404.
raw docstring

pagedclj

(paged request total size f)

(f {:page p :pages m :offset o :limit size}) for the page the query asks of a list of total rows, size to a page, or a 303 to the last page when the one asked is past it. An empty list has one page, empty. A page nobody could have linked to is a 404. The count and the page are the host's two reads: a row that leaves between them makes the last page short, never a redirect.

A :sessionless route is refused: it is answered before the query is parsed, so every page would read as page 1, in silence.

`(f {:page p :pages m :offset o :limit size})` for the page the query asks of a list
of `total` rows, `size` to a page, or a 303 to the last page when the one asked is
past it. An empty list has one page, empty. A `page` nobody could have linked to is a
404. The count and the page are the host's two reads: a row that leaves between them
makes the last page short, never a redirect.

A `:sessionless` route is refused: it is answered before the query is parsed, so every
`page` would read as page 1, in silence.
sourceraw docstring

pathclj

(path request n)

The path of page n of the list request asked for: the path the router matched, so only one of the host's routes can become a Location, with every query parameter but page kept — a filter survives. Page 1 is spelt without page, so a link and a redirect to it agree. A request the router did not answer has no such path, and is refused.

The path of page `n` of the list `request` asked for: the path the router matched, so
only one of the host's routes can become a Location, with every query parameter but
`page` kept — a filter survives. Page 1 is spelt without `page`, so a link and a
redirect to it agree. A request the router did not answer has no such path, and is
refused.
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