output modes¶
Everything that differs between output modes, in one table. Adding a mode, or changing which models it takes, which output functions render it or which template wraps it, happens here.
opm.output_modes ¶
The output modes opm can compile an ODD for, in one table.
Everything that differs between output modes is
recorded here: which ODD models take part, which output functions render them
and with which text handling, whether web components may load, which template
wraps the result and where a project configures it, and how --preview
shows it. The compiler, the generated modules, the transform entry points and
the CLI all look a mode up instead of testing its name.
JSON output records what another channel decided, so besides plain json
(the web channel) there is a json-<channel> mode for each rendering channel,
derived from that channel's entry.
This module imports nothing from the runtime: output functions and text handlers are named by dotted path and imported when a run needs them.
OutputMode
dataclass
¶
OutputMode(
name: str,
accepts: tuple[str, ...],
functions: str,
settings: tuple[tuple[str, str], ...] = (),
stylesheet: str = "css",
webcomponents: bool = True,
records: bool = False,
template: str | None = None,
template_setting: str | None = None,
default_template: str | None = None,
print_css: bool = False,
collects_metadata: bool = False,
packaged: bool = False,
binary: bool = False,
extension: str = "",
preview: str = "text",
scaffold: bool = False,
channel: str | None = None,
compiler: str | None = None,
)
output_mode ¶
output_mode(name: str | None) -> OutputMode
The mode called name (case-insensitive; empty means DEFAULT_MODE).
Source code in src/opm/output_modes.py
module_mode ¶
module_mode(mod: Any) -> OutputMode