Bazel rules
The rules are loaded from @rinx//:defs.bzl:
They work like cc_library and cc_binary. A rinx_library parses a
set of documents, and a rinx_site assembles libraries into one HTML site.
Each document is parsed and rendered by an action of its own, so Bazel rebuilds
only what an edit affects.
rinx_library
Parses a set of reStructuredText documents. Its output is a parsed form of each
document that a rinx_site renders, not HTML.
Attribute |
Description |
|---|---|
|
The |
|
Other |
|
Files the documents read while they are parsed: the file behind a
|
|
The pictures |
|
Whether the documents may hold PlantUML diagrams ( |
|
The project's entity schema, which declares directives such as
|
|
Whether the |
|
A dictionary of names a Jinja-rendered document may read, like Sphinx's
|
|
The domain unprefixed directives and roles such as |
rinx_site
Assembles a site from rinx_library targets: it indexes every document the
libraries bring in (transitively), renders one page per document, compiles the
diagrams, and copies the images and the stylesheet. The output is the directory
<name>_site_out. The site also writes an objects.inv, the inventory
other Sphinx or rinx sites link into it through, available as the target's
inventory output group.
Attribute |
Description |
|---|---|
|
The |
|
A |
|
The MiniJinja HTML template every page is rendered into. Defaults to the bundled one. |
|
The stylesheet copied into the site. Defaults to the bundled one. |
|
The same schema file the libraries name, if they name one. |
|
Per-type HTML templates a schema's |
|
|
|
If |
The configuration file
The site's config is a TOML file holding metadata only. It never contains
paths: those are attributes of the rule, so that Bazel can move files around
freely.
= "My Project"
= "1.2"
= "index"
= "python"
[]
= "skinparam monochrome true"Key |
Meaning |
|---|---|
|
The name shown in the sidebar and in each page's title. |
|
The version shown in the sidebar. |
|
The document every other one hangs off, without |
|
The language of code blocks that name none, like Sphinx's setting of the same name. A name that matches no language fails the build. |
|
Whether an entity's details are folded behind a disclosure. On by default. |
|
Whether |
|
Named PlantUML preambles a diagram selects with |
rinx_inventory
Declares another site's objects.inv that a rinx_site may link into,
Sphinx's intersphinx. Nothing is downloaded while building: the file is
vendored, pinned by an http_file with a sha256, or produced by another
rinx_site. See Linking between documentation sites.
Attribute |
Description |
|---|---|
|
The |
|
Where that site's pages are published: an absolute URL, or a path relative to the consuming site's root for a site deployed next to it. Required. |
|
The name documents select this inventory by, as in
|
rinx_doctest_tests
Runs the .. doctest:: and .. testcode:: blocks of one library's
documents as a Bazel test, on the Python toolchain rinx brings along. Building
a site never runs them; bazel test does. A test's result stays cached until
the code in the blocks changes. Prose edits do not re-run it.
Argument |
Description |
|---|---|
|
The name of the generated |
|
The |
|
|
|
A |
|
Passed on to the generated |
Every document of a library runs in one interpreter, and a change to one document's code re-runs the whole library's test. To narrow that, put the documents with doctests in a library of their own.