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