smalldocs can now make reference pages for three more kinds of code. Before, it read Python only. The
key language in the api section chooses the kind:
rustreads a crate, through the JSON that rustdoc writes. It needs a nightly toolchain of Rust.typescriptreads a package or an app, through the JSON that TypeDoc writes. It needs Node.openapireads the OpenAPI document of an HTTP API, from a file, from a command, or from a FastAPI app.
The pages look like the Python pages, with a heading, a source link, a code block and a table for each
entry. smalldocs api check reports each gap in the comments, as it does for Python. On these sites, a
name in backticks links to its entry when it is a key of _symbols.json, even when it does not look like code.
api can also be a list of sections, for several references in one site. Each section has its own
out folder. smalldocs api build --out NAME builds one section of the list.
Rust, TypeScript and HTTP references says how to set up each one. The front end of cricsdb, in TypeScript, is the first site with one of these references.
What changes for a site that uses none of it
A site whose api is one Python section builds its reference pages as before. Three other changes can
touch any site:
- A key that an
apisection does not read gives a warning. For example,entryin a Python section gives “entry is not read for python; it is for typescript”. Sorender --strictnow fails on such a key, and onpackagebesidepackages. Remove the key, or fix its name. - A sidebar entry
autowith a glob that starts in a folder, such asauto: api/**, makes no section for that folder, and leaves out its index page, as Quarto does. The folders inside it are still sections. To keep the index in the sidebar, list it by name before theautoentry. A glob such ascontents: api/*does not change. - An escaped dash or dot is never part of a dash or an ellipsis, as in Pandoc. The same holds for a character
reference, such as
--. Before, smalldocs made\-\-an en dash and\.\.\.an ellipsis. A heading that has one gets a new id, so a link to it must change. For example, the id of## Head \-\- onewas#head-one, and it is now#head----one.