Skip to main content

Module docgen

Module docgen 

Source
Expand description

The parts of the docs written from the code, and the one place that writes them.

Each Generated is a whole page or a marked region of one. gen_docs write writes them all; the_generated_docs_are_current fails while a committed copy differs. The renderers are plain functions over the registries (options, settings, environment, formats, keys), so a manpage can render the same sources as roff.

A region sits between two comments, which mdBook and GitHub hide:

<!-- generated: NAME -->
...
<!-- end generated: NAME -->

In a Jinja template the comments are {# generated: NAME #}, and in TOML, Ruby and desktop files # generated: NAME, so they stay out of what the file renders.

Structs§

Generated
A page, or a region of one, written from the code.

Constants§

GENERATED
Every generated part of the docs.

Functions§

doc_title
A format’s name in the docs: its title, or the containers for audio.
format_count_sentence
“datui reads 27 formats: Parquet, CSV, … and binary formats you describe in a format spec.” Counted from the descriptors, so the number cannot go stale.
format_page
The family page and heading that describe a format, from docs/formats/.
read_file
A repository file’s text, by its path from the root, line endings as LF.
render_all
What each generated file should hold: the file and its text, every region filled. The manpages are whole files, after the docs.
render_formats_markdown
The formats overview’s table: how a file of each format is read, from its descriptor. One row per format, then an Arrow IPC stream and a format spec.
render_public_catalog
The bundled catalog for the docs: its header comment as a quote, the rest as a block. A block’s comment lines read as headings in some outlines, so the header’s rules are prose here.
render_python_options_markdown
The keywords datui.view() and DatuiOptions take, from the option registry: the open’s own options, then the config keys’, then config.
repo_root
The repository’s root, from this crate’s manifest directory.
short_title
A format’s name in a list of them: its title, or a plain name for audio and text.
splice
text, the contents of file, with region name replaced by content. An error when the region’s markers are missing.
write_all
Write every generated part. Returns the files that changed.