Skip to main content

citum_engine/processor/rendering/
grouped_fallback.rs

1/*
2SPDX-License-Identifier: MIT OR Apache-2.0
3SPDX-FileCopyrightText: © 2023-2026 Bruce D'Arcus and Citum contributors
4*/
5
6//! Shared parameter types for grouped citation rendering.
7
8/// Parameters for grouped citation rendering.
9///
10/// Bundles together related parameters that would otherwise lead to
11/// `too_many_arguments` lint violations. This struct is used to pass
12/// consistent rendering configuration to fallback functions.
13#[derive(Debug)]
14pub struct GroupRenderParams<'a> {
15    /// The citation spec containing templates and configuration.
16    pub spec: &'a citum_schema::CitationSpec,
17    /// The citation mode (integral or non-integral).
18    pub mode: &'a citum_schema::citation::CitationMode,
19    /// Delimiter between items within a citation.
20    pub intra_delimiter: &'a str,
21    /// Whether to suppress author output.
22    pub suppress_author: bool,
23    /// The citation position (e.g., ibid, subsequent).
24    pub position: Option<&'a citum_schema::citation::Position>,
25    /// Optional note-start text-case policy for note-style repeated-note output.
26    pub note_start_text_case: Option<citum_schema::NoteStartTextCase>,
27}
28
29/// Parameters for rendering a template with a citation number.
30///
31/// Bundles all rendering configuration into a single struct so that
32/// `process_template_with_number` and its format-generic variant can
33/// accept a single argument instead of ten, eliminating the need for
34/// `#[allow(clippy::too_many_arguments)]` suppressions.
35#[derive(Debug)]
36pub struct TemplateRenderParams<'a> {
37    /// The template components to render.
38    pub template: &'a [citum_schema::template::TemplateComponent],
39    /// The rendering context (citation or bibliography).
40    pub context: crate::values::RenderContext,
41    /// The citation mode (integral or non-integral).
42    pub mode: citum_schema::citation::CitationMode,
43    /// Whether to suppress the author component.
44    pub suppress_author: bool,
45    /// The citation number for numeric styles.
46    pub citation_number: usize,
47    /// The raw citation locator if present.
48    pub locator_raw: Option<&'a citum_schema::citation::CitationLocator>,
49    /// The citation position (e.g., ibid, subsequent).
50    pub position: Option<&'a citum_schema::citation::Position>,
51    /// Optional note-start text-case policy for citation templates.
52    pub note_start_text_case: Option<citum_schema::NoteStartTextCase>,
53    /// Whether the author was rendered in integral form in the prose anchor.
54    pub integral_name_state: Option<citum_schema::citation::IntegralNameState>,
55    /// Org abbreviation state for org-name formatting.
56    pub org_abbreviation_state: Option<citum_schema::citation::IntegralNameState>,
57}