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 and Citum contributors
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(crate) mod markup;
30pub mod org;
31pub mod plain;
32pub mod rich_text;
33pub mod typst;
34
35#[cfg(test)]
36#[allow(
37    clippy::unwrap_used,
38    clippy::expect_used,
39    clippy::panic,
40    clippy::indexing_slicing,
41    clippy::todo,
42    clippy::unimplemented,
43    clippy::unreachable,
44    clippy::get_unwrap,
45    reason = "Panicking is acceptable and often desired in tests."
46)]
47mod test_formats;
48
49pub use bibliography::{
50    refs_to_string, refs_to_string_slice_with_format, refs_to_string_with_format,
51};
52pub use citation::{citation_to_string, citation_to_string_with_format};
53pub use component::{
54    ProcEntry, ProcTemplate, ProcTemplateComponent, render_component,
55    render_component_with_format_and_renderer,
56};
57pub use rich_text::render_djot_inline;