Skip to main content

QuillConfig

Struct QuillConfig 

Source
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: String

Quill package name

§description: String

Human-readable description of the quill itself (parsed from quill.description). Distinct from main.description, which describes the main leaf’s schema.

§main: LeafSchema

The 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: String

Backend to use for rendering (e.g., “typst”, “html”)

§version: String

Version of the Quillmark spec

§author: String

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

Source

pub fn blueprint(&self) -> String

Generate an annotated Markdown blueprint for this quill. See module docs for the annotation grammar; the function is total over any valid QuillConfig.

Source§

impl QuillConfig

Source

pub fn leaf_kind(&self, name: &str) -> Option<&LeafSchema>

Returns a named leaf-type schema by name.

Source

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.

Source

pub fn coerce_frontmatter( &self, frontmatter: &IndexMap<String, QuillValue>, ) -> Result<IndexMap<String, QuillValue>, CoercionError>

Coerce typed frontmatter fields (IndexMap, no LEAVES/BODY keys).

Source

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.

Source

pub fn validate_document( &self, doc: &Document, ) -> Result<(), Vec<ValidationError>>

Validate a typed crate::document::Document against this configuration.

Source

pub fn from_yaml( yaml_content: &str, ) -> Result<Self, Box<dyn StdError + Send + Sync>>

Parse QuillConfig from YAML content

Source

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

Source

pub fn schema_yaml(&self) -> Result<String, Error>

YAML encoding of QuillConfig::schema.

Trait Implementations§

Source§

impl Clone for QuillConfig

Source§

fn clone(&self) -> QuillConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QuillConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for QuillConfig

Source§

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 PartialEq for QuillConfig

Source§

fn eq(&self, other: &QuillConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for QuillConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for QuillConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,