Skip to main content

citum_engine/render/
mod.rs

1/*
2SPDX-License-Identifier: MIT OR Apache-2.0
3SPDX-FileCopyrightText: © 2023-2026 Bruce D'Arcus
4*/
5
6//! Rendering utilities for Citum templates.
7//!
8//! This module provides the logic to transform processed template components
9//! into formatted strings. It supports multiple output formats through a
10//! pluggable architecture defined by the [`crate::render::format::OutputFormat`] trait.
11//!
12//! ## Modules
13//! - `format`: Defines the core [`crate::render::format::OutputFormat`] trait.
14//! - `plain`, `html`, `djot`, `latex`, `typst`: Concrete renderer implementations.
15//! - `component`: Logic for rendering individual template components.
16//! - `citation`: Logic for joining components into full citations.
17//! - `bibliography`: Logic for rendering bibliographies.
18
19/// Bibliography-level rendering and output assembly helpers.
20pub mod bibliography;
21/// Citation-level rendering and output assembly helpers.
22pub mod citation;
23/// Component-level rendering primitives shared by citations and bibliographies.
24pub mod component;
25pub mod djot;
26pub mod format;
27pub mod html;
28pub mod latex;
29pub mod org;
30pub mod plain;
31pub mod rich_text;
32pub mod typst;
33
34#[cfg(test)]
35#[allow(
36    clippy::unwrap_used,
37    clippy::expect_used,
38    clippy::panic,
39    clippy::indexing_slicing,
40    clippy::todo,
41    clippy::unimplemented,
42    clippy::unreachable,
43    clippy::get_unwrap,
44    reason = "Panicking is acceptable and often desired in tests."
45)]
46mod test_formats;
47
48pub use bibliography::{refs_to_string, refs_to_string_with_format};
49pub use citation::{citation_to_string, citation_to_string_with_format};
50pub use component::{
51    ProcEntry, ProcTemplate, ProcTemplateComponent, render_component,
52    render_component_with_format_and_renderer,
53};
54pub use rich_text::render_djot_inline;