pub struct BibliographySpec {
pub options: Option<BibliographyOptions>,
pub template_ref: Option<TemplateReference>,
pub template: Option<Vec<TemplateComponent>>,
pub locales: Option<Vec<LocalizedTemplateSpec>>,
pub type_variants: Option<IndexMap<TypeSelector, TemplateVariant>>,
pub sort: Option<GroupSortEntry>,
pub groups_enabled: bool,
pub groups: Option<Vec<BibliographyGroup>>,
pub custom: Option<HashMap<String, Value>>,
pub unknown_fields: BTreeMap<String, Value>,
}Expand description
Bibliography specification.
Fields§
§options: Option<BibliographyOptions>Bibliography-specific option overrides merged over the style config.
template_ref: Option<TemplateReference>Reference to an embedded template preset or external template.
If both template-ref and template are present, template takes precedence.
template: Option<Vec<TemplateComponent>>The default template for bibliography entries. Default template for entries when no localized override is selected.
locales: Option<Vec<LocalizedTemplateSpec>>Locale-specific template overrides checked before the default template.
type_variants: Option<IndexMap<TypeSelector, TemplateVariant>>Type-specific template overrides. When present, replaces the default template for entries of the specified types. Keys are reference type names (e.g., “chapter”, “article-journal”).
sort: Option<GroupSortEntry>Optional global bibliography sorting specification.
When present, used for sorting the flat bibliography or as default for groups that don’t specify their own sort.
groups_enabled: boolWhether to apply manual groups: bibliography grouping.
Defaults to true. Set to false to disable the groups: configuration
and render a flat bibliography instead. Automatic sort-partition sections
are unaffected by this toggle.
groups: Option<Vec<BibliographyGroup>>Optional bibliography grouping specification.
When present, divides the bibliography into labeled sections with optional per-group sorting. Items match the first group whose selector evaluates to true (first-match semantics). Omit for flat bibliography.
See BibliographyGroup for examples.
custom: Option<HashMap<String, Value>>Custom user-defined fields for extensions.
unknown_fields: BTreeMap<String, Value>Forward-compat: captures unknown keys when an older engine reads a
style produced by a newer schema. Empty by default; treated as a
SoftDegrade signal. See docs/specs/FORWARD_COMPATIBILITY.md.
Implementations§
Source§impl BibliographySpec
impl BibliographySpec
Sourcepub fn resolve_template(&self) -> Option<Vec<TemplateComponent>>
pub fn resolve_template(&self) -> Option<Vec<TemplateComponent>>
Resolve the effective template for this bibliography.
Returns the explicit template if present, otherwise resolves template-ref.
Returns None if neither is specified.
Sourcepub fn resolve_template_for_language(
&self,
language: Option<&str>,
) -> Option<Vec<TemplateComponent>>
pub fn resolve_template_for_language( &self, language: Option<&str>, ) -> Option<Vec<TemplateComponent>>
Resolve the template for a language by checking localized overrides, then the localized default, then the base template or preset.
Trait Implementations§
Source§impl Clone for BibliographySpec
impl Clone for BibliographySpec
Source§fn clone(&self) -> BibliographySpec
fn clone(&self) -> BibliographySpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more