# (chibi doc)

A library for generating SXML docs from Scribble, directly or extracted from literate docs.

#### `(ansi->sxml str)`

Replace ansi escape sequences in a `str` with the corresponding sxml.

#### `(print-module-docs mod-name [out])`

Extract the literate Scribble docs for module `mod-name` and print them to `out`, rendered with `render` which defaults to `sxml-display-as-text`.

#### `(print-module-binding-docs mod-name var [out])`

Extract the literate Scribble docs for just the binding for `var` in module `mod-name`, and print them as in `print-module-docs`.

#### `(procedure-docs proc)`

Extract the literate Scribble docs for `proc` which should be a procedure and return them as sxml.

#### `(print-procedure-docs proc [out])`

Extract the literate Scribble docs for `proc` which should be a procedure and render them as in `print-module-docs`.

#### `(make-default-doc-env)`

Return a new document environment suitable for passing to `expand-docs`, with default rules for sections, code blocks, procedure and macro signatures, etc.

#### `(make-module-doc-env mod-name)`

Return a new document environment as in `make-default-doc-env`, with an `example-env` binding mapped to an environment importing `(scheme base)` and the module `mod-name`. This binding is used when expanding examples in the docs.

#### `(expand-docs sxml env)`

Given the sxml document `sxml`, expands macros defined in the document environment `env` into standard html tags.

#### `(fixup-docs sxml)`

Resolves paragraphs and adds a header to convert `sxml` to a standalone document renderable in html.

#### `(generate-docs sxml [env])`

Composes `expand-docs` and `fixup-docs`.

#### `(get-optionals-signature ls body)`

#### `(extract-file-docs mod file all-defs strict? . o)`

Extract inline Scribble documentation (with the ;;> prefix) from the source file `file`, associating any signatures from the provided defs when available and not overridden in the docs.

#### `(extract-module-docs mod-name strict? . o)`

Extract the literate Scribble docs from module `mod-name` and return them as sxml. If `strict?` is true ignore docs for unexported values, defined by the optional `exports` which defaults to all the module exports.

#### `(extract-module-file-docs file strict? . o)`

As above, but extracts docs for the module defined in `file`, which need not be in the search path.