# quickblog.api
## `clean`
``` clojure
(clean opts)
```
Removes cache and output directories
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L580-L586)
## `debug`
``` clojure
(debug & xs)
```
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L277-L279)
## `migrate`
``` clojure
(migrate opts)
```
Migrates from `posts.edn` to post-local metadata
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L588-L599)
## `new`
``` clojure
(new opts)
```
Creates new `file` in posts dir.
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L524-L578)
## `quickblog`
``` clojure
(quickblog opts)
```
Alias for `render`
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L515-L518)
## `refresh-templates`
``` clojure
(refresh-templates opts)
```
Updates to latest default templates
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L601-L604)
## `render`
``` clojure
(render opts)
```
Renders posts declared in `posts.edn` to `out-dir`.
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L475-L513)
## `serve`
``` clojure
(serve opts)
(serve opts block?)
```
Runs file-server on `port`. If `block?` is falsey, returns a zero-arity
`stop-server!` function that will stop the server when called.
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L606-L624)
## `unwatch`
``` clojure
(unwatch watchers)
```
Stops each watcher in the list of `watchers`.
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L712-L717)
## `update-cache-dir`
``` clojure
(update-cache-dir opts)
```
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L190-L198)
## `watch`
``` clojure
(watch opts)
```
Watches posts, templates, and assets for changes. Runs file server using
`serve` (unless the `:serve` opt is `false`). If the `:block` opt is `false`,
returns a list of watchers that can be passed to `unwatch` to stop watching.
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/api.clj#L628-L710)
# quickblog.cli
## `-main`
``` clojure
(-main & args)
```
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/cli.clj#L144-L145)
## `dispatch`
``` clojure
(dispatch)
(dispatch default-opts & args)
```
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/cli.clj#L128-L134)
## `run`
``` clojure
(run default-opts)
```
Meant to be called using `clj -M:quickblog`; see Quickstart > Clojure in README
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/cli.clj#L136-L142)
# quickblog.internal.frontmatter
## `flatten-metadata`
``` clojure
(flatten-metadata metadata)
```
Given a list of maps which contain a single key/value, flatten them all into
a single map with all the leading spaces removed. If an empty list is provided
then return nil.
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/internal/frontmatter.clj#L20-L39)
## `parse-edn-metadata-headers`
``` clojure
(parse-edn-metadata-headers lines-seq)
```
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/internal/frontmatter.clj#L67-L77)
## `parse-metadata-headers`
``` clojure
(parse-metadata-headers lines-seq)
```
Given a sequence of lines from a markdown document, attempt to parse a
metadata header if it exists. Accepts wiki, yaml, and edn formats.
Returns the parsed headers number of lines the metadata spans
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/internal/frontmatter.clj#L79-L95)
## `parse-metadata-line`
``` clojure
(parse-metadata-line line)
```
Given a line of metadata header text return either a list containing a parsed
and normalizd key and the original text of the value, or if no header is found
(this is a continuation or new value from a pervious header key) simply
return the text. If a blank or invalid line is found return nil.
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/internal/frontmatter.clj#L6-L18)
## `parse-wiki-metadata-headers`
``` clojure
(parse-wiki-metadata-headers lines-seq)
```
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/internal/frontmatter.clj#L42-L49)
## `parse-yaml-metadata-headers`
``` clojure
(parse-yaml-metadata-headers lines-seq)
```
[source](https://github.com/borkdude/quickblog/blob/main/src/quickblog/internal/frontmatter.clj#L53-L65)