use crate::options::AndOptions;
use crate::{
tc_date, tc_number, tc_title,
template::{
ContributorForm, ContributorRole, LabelForm, NumberVariable, TemplateComponent,
TemplateContributor, TemplateNumber, WrapPunctuation,
},
};
pub fn citation() -> Vec<TemplateComponent> {
vec![tc_number!(CitationNumber, wrap = WrapPunctuation::Brackets)]
}
pub fn bibliography() -> Vec<TemplateComponent> {
vec![
tc_number!(
CitationNumber,
wrap = WrapPunctuation::Brackets,
suffix = " "
),
TemplateComponent::Contributor(TemplateContributor {
contributor: ContributorRole::Author,
form: ContributorForm::Long,
and: Some(AndOptions::Text),
rendering: crate::template::Rendering {
suffix: Some(", ".to_string()),
..Default::default()
},
..Default::default()
}),
tc_title!(Primary, quote = true, suffix = " "),
tc_title!(ParentSerial, emph = true, suffix = ", "),
tc_number!(Volume, prefix = "vol. ", suffix = ", "),
tc_number!(Issue, prefix = "no. ", suffix = ", "),
TemplateComponent::Number(TemplateNumber {
number: NumberVariable::Pages,
label_form: Some(LabelForm::Short),
rendering: crate::template::Rendering {
suffix: Some(", ".to_string()),
..Default::default()
},
..Default::default()
}),
tc_date!(Issued, Year, suffix = "."),
]
}