pub struct Template {
pub meta: TemplateMeta,
pub page: Option<PageStyle>,
pub styles: IndexMap<String, PartialStyle>,
pub markdown_mapping: Option<MarkdownMapping>,
}Expand description
A complete YAML template.
Contains metadata, page settings, style definitions, and markdown mappings.
§Example YAML
meta:
name: government_proposal
version: 1.0.0
description: Korean government proposal template
page:
width: 210mm
height: 297mm
margin_top: 20mm
margin_bottom: 20mm
margin_left: 20mm
margin_right: 20mm
styles:
body:
char_shape:
font: 한컴바탕
size: 10pt
para_shape:
alignment: Left
markdown_mapping:
body: body
heading1: h1Fields§
§meta: TemplateMetaTemplate metadata.
page: Option<PageStyle>Page settings (optional).
styles: IndexMap<String, PartialStyle>Style definitions (name → PartialStyle).
markdown_mapping: Option<MarkdownMapping>Markdown element mappings (optional).
Implementations§
Source§impl Template
impl Template
Sourcepub fn from_yaml(yaml: &str) -> BlueprintResult<Self>
pub fn from_yaml(yaml: &str) -> BlueprintResult<Self>
Parses a template from YAML string.
§Errors
Returns BlueprintError::YamlParse if the YAML is invalid.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Template
impl<'de> Deserialize<'de> for Template
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Template
impl JsonSchema for Template
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnwindSafe for Template
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
Mutably borrows from an owned value. Read more