pub struct QuillConfig {
pub name: String,
pub description: String,
pub main: LeafSchema,
pub leaf_kinds: Vec<LeafSchema>,
pub backend: String,
pub version: String,
pub author: String,
pub example_file: Option<String>,
pub example_markdown: Option<String>,
pub plate_file: Option<String>,
pub backend_config: HashMap<String, QuillValue>,
}Expand description
Top-level configuration for a Quillmark project
Fields§
§name: StringQuill package name
description: StringHuman-readable description of the quill itself (parsed from
quill.description). Distinct from main.description, which describes
the main leaf’s schema.
main: LeafSchemaThe entry-point leaf schema (parsed from the Quill.yaml main: section).
leaf_kinds: Vec<LeafSchema>Named, composable leaf-type schemas (parsed from the Quill.yaml
leaf_kinds: section). Does not include main.
backend: StringBackend to use for rendering (e.g., “typst”, “html”)
version: StringVersion of the Quillmark spec
Author of the project
example_file: Option<String>Example data file for preview
example_markdown: Option<String>Loaded markdown example content from Quill.example/Quill.example_file
plate_file: Option<String>Plate file (template)
backend_config: HashMap<String, QuillValue>Backend-specific configuration parsed from the top-level YAML section
whose key matches backend (e.g. [typst], [html]).
Implementations§
Source§impl QuillConfig
impl QuillConfig
Source§impl QuillConfig
impl QuillConfig
Sourcepub fn leaf_kind(&self, name: &str) -> Option<&LeafSchema>
pub fn leaf_kind(&self, name: &str) -> Option<&LeafSchema>
Returns a named leaf-type schema by name.
Sourcepub fn schema(&self) -> Value
pub fn schema(&self) -> Value
Full schema including ui hints.
main.fields is prefixed with a required QUILL entry (const = name@version);
each leaf_kinds[<name>].fields is prefixed with a required KIND entry
(const = <name>). Identity (name, version, etc.) and the bundled
example live elsewhere on the host’s metadata surface.
Sourcepub fn coerce_frontmatter(
&self,
frontmatter: &IndexMap<String, QuillValue>,
) -> Result<IndexMap<String, QuillValue>, CoercionError>
pub fn coerce_frontmatter( &self, frontmatter: &IndexMap<String, QuillValue>, ) -> Result<IndexMap<String, QuillValue>, CoercionError>
Coerce typed frontmatter fields (IndexMap, no LEAVES/BODY keys).
Sourcepub fn coerce_leaf(
&self,
leaf_tag: &str,
fields: &IndexMap<String, QuillValue>,
) -> Result<IndexMap<String, QuillValue>, CoercionError>
pub fn coerce_leaf( &self, leaf_tag: &str, fields: &IndexMap<String, QuillValue>, ) -> Result<IndexMap<String, QuillValue>, CoercionError>
Coerce typed fields for a single leaf (IndexMap, no KIND/BODY keys).
Returns the input unchanged when the leaf tag is unknown.
Sourcepub fn validate_document(
&self,
doc: &Document,
) -> Result<(), Vec<ValidationError>>
pub fn validate_document( &self, doc: &Document, ) -> Result<(), Vec<ValidationError>>
Validate a typed crate::document::Document against this configuration.
Sourcepub fn from_yaml(
yaml_content: &str,
) -> Result<Self, Box<dyn StdError + Send + Sync>>
pub fn from_yaml( yaml_content: &str, ) -> Result<Self, Box<dyn StdError + Send + Sync>>
Parse QuillConfig from YAML content
Sourcepub fn from_yaml_with_warnings(
yaml_content: &str,
) -> Result<(Self, Vec<Diagnostic>), Vec<Diagnostic>>
pub fn from_yaml_with_warnings( yaml_content: &str, ) -> Result<(Self, Vec<Diagnostic>), Vec<Diagnostic>>
Parse QuillConfig from YAML content while collecting non-fatal warnings.
Returns Ok((config, warnings)) on success, or Err(errors) containing all
parse/validation errors when the config is invalid. Errors are always collected
exhaustively — callers see every problem, not just the first.
Source§impl QuillConfig
impl QuillConfig
Sourcepub fn schema_yaml(&self) -> Result<String, Error>
pub fn schema_yaml(&self) -> Result<String, Error>
YAML encoding of QuillConfig::schema.
Trait Implementations§
Source§impl Clone for QuillConfig
impl Clone for QuillConfig
Source§fn clone(&self) -> QuillConfig
fn clone(&self) -> QuillConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuillConfig
impl Debug for QuillConfig
Source§impl<'de> Deserialize<'de> for QuillConfig
impl<'de> Deserialize<'de> for QuillConfig
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>,
Source§impl PartialEq for QuillConfig
impl PartialEq for QuillConfig
Source§fn eq(&self, other: &QuillConfig) -> bool
fn eq(&self, other: &QuillConfig) -> bool
self and other values to be equal, and is used by ==.