pub struct RenderContext {
pub title: String,
pub language: Option<String>,
pub description: Option<String>,
pub authors: Vec<String>,
pub creator: Option<String>,
pub producer: Option<String>,
pub creation_date: Option<DateTime>,
pub date_string: Option<String>,
pub vars: HashMap<String, String>,
pub external_tagrefs: HashMap<String, ExternalTagref>,
}Expand description
Caller-supplied context that the renderer can interpolate into header/footer template strings and surface as PDF document metadata.
Fields§
§title: StringDocument title — substituted as {title} in header/footer
templates and emitted as the PDF’s /Title metadata.
language: Option<String>Document language code (e.g. "en-us"). Required by PDF/A.
description: Option<String>Document description / abstract.
Authors (combined into PDF /Author metadata).
creator: Option<String>Application that created the document.
producer: Option<String>Library / pipeline that wrote the PDF bytes (/Producer).
Defaults to krilla’s own string when None. Set this to
e.g. "markdoc-pdf 0.1.0" so support tooling can identify
which version of the renderer produced a given file.
creation_date: Option<DateTime>Document creation date for the PDF metadata. If None, the
renderer falls back to the current system time so PDF/A docs
always carry a valid /CreationDate. Use dates::parse_iso
to convert from a frontmatter ISO date string, or
dates::now() to stamp the build time.
date_string: Option<String>String used for the {date} header/footer template variable.
Defaults to today’s date in YYYY-MM-DD form. Override to
supply a localised or differently-formatted date (e.g.
"3 May 2026").
vars: HashMap<String, String>Caller-supplied template variables, looked up by name in
header/footer and cover-page template strings ({my_var}) after
the built-in tokens. Lets a caller surface arbitrary frontmatter
(version, hardware revision, a pre-computed copyright year span,
…) without the renderer knowing those field names. Unknown names
are left as literal {name} so typos are visible.
external_tagrefs: HashMap<String, ExternalTagref>Website pages for {% tag %} ids. A {% tagref %} whose target
is not declared in this PDF becomes a link to url.
Trait Implementations§
Source§impl Clone for RenderContext
impl Clone for RenderContext
Source§impl Debug for RenderContext
impl Debug for RenderContext
Auto Trait Implementations§
impl Forget for RenderContext
impl Freeze for RenderContext
impl Move for RenderContext
impl RefUnwindSafe for RenderContext
impl Send for RenderContext
impl Sync for RenderContext
impl Unpin for RenderContext
impl UnsafeUnpin for RenderContext
impl UnwindSafe for RenderContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.