#[non_exhaustive]pub struct QuillConfig {
pub name: String,
pub description: String,
pub main: CardSchema,
pub card_kinds: Vec<CardSchema>,
pub backend: String,
pub version: String,
pub author: String,
pub backend_config: HashMap<String, QuillValue>,
}Expand description
Top-level configuration for a Quillmark project
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringQuill package name
description: StringHuman-readable description of the quill itself (parsed from
quill.description). Distinct from main.description, which describes
the main card’s schema.
main: CardSchemaThe entry-point card schema (parsed from the Quill.yaml main: section).
card_kinds: Vec<CardSchema>Named, composable card-kind schemas (parsed from the Quill.yaml
card_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
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
Sourcepub fn blueprint(&self) -> String
pub fn blueprint(&self) -> String
Generate the canonical annotated Markdown blueprint for this quill:
the authoring surface handed to LLMs and humans, with Unendorsed cells
carrying the !must_fill marker. See module docs for the annotation
grammar; the function is total over any valid QuillConfig.
The “filled-out” twin of the blueprint is seeding
(Quill::seed_document), a committed
Document rather than an annotated string. See
prose/canon/BLUEPRINT.md.
The result is guaranteed schema-valid and parseable (every key
present, every value type-correct). It is not guaranteed to render:
that is the quill authoring contract on plate.typ; see
prose/canon/BLUEPRINT.md §Guarantees.
Source§impl QuillConfig
The document→data compile is a pure config read: coercion, validation,
normalization, and zero-fill consult only the parsed schemas, never the
quill’s file tree. Living on QuillConfig lets a consumer that only
compiles data (e.g. a live session’s apply) retain the config alone
rather than the whole quill with its font/package bytes.
impl QuillConfig
The document→data compile is a pure config read: coercion, validation,
normalization, and zero-fill consult only the parsed schemas, never the
quill’s file tree. Living on QuillConfig lets a consumer that only
compiles data (e.g. a live session’s apply) retain the config alone
rather than the whole quill with its font/package bytes.
Sourcepub fn compile_data(&self, doc: &Document) -> Result<Value, RenderError>
pub fn compile_data(&self, doc: &Document) -> Result<Value, RenderError>
Applies coercion, validation, normalization, and zero-filled render:
every absent schema field is resolved to its authored value, else its
schema default, else its type-empty zero value, in this plate-JSON
projection only, never in the persisted document. A merely incomplete
document compiles fine; only a malformed one (a value that won’t
coerce/validate) errors. A !must_fill placeholder never gates render:
it surfaces as a non-fatal warning from validate. See
prose/canon/SCHEMAS.md.
Sourcepub fn compile_checked(&self, doc: &Document) -> Result<Value, RenderError>
pub fn compile_checked(&self, doc: &Document) -> Result<Value, RenderError>
compile_data behind the $quill pairing check:
the render door’s whole preamble, in the one place that owns it. Every
door that turns a document into plate data for this schema goes
through here (Quillmark::open for a session’s first compile,
LiveSession::update for each edit), so
the pairing cannot be checked at one and skipped at the other.
compile_data stays available unchecked for a
caller that wants the plate alone (the CLI’s --output-data), where no
render follows and the pairing is the caller’s to assert.
Source§impl QuillConfig
impl QuillConfig
Sourcepub fn new(
name: String,
backend: String,
version: String,
main: CardSchema,
) -> QuillConfig
pub fn new( name: String, backend: String, version: String, main: CardSchema, ) -> QuillConfig
The four fields Quill.yaml requires. description, author,
card_kinds, and backend_config start empty.
This bypasses Self::from_yaml_with_warnings and its validation, so a
config built here can hold shapes the parser refuses. Loading a quill
goes through that path; this one is for a caller assembling a schema in
memory.
Source§impl QuillConfig
impl QuillConfig
Sourcepub fn card_kind(&self, name: &str) -> Option<&CardSchema>
pub fn card_kind(&self, name: &str) -> Option<&CardSchema>
Returns a named card-kind schema by name.
Sourcepub fn schema(&self) -> Value
pub fn schema(&self) -> Value
Full schema including ui hints.
Describes the user-fillable fields of the main card and each named
card kind. The quill reference (constructed as name@version from
quill metadata) and card-kind discriminators are document-level
metadata, not fields, so they do not appear here.
Key order is the ordering contract: fields, nested properties, and card
kinds all emit in declaration order (preserve_order end-to-end), so a
consumer walking the maps in key order renders the authored layout.
Sourcepub fn coerce_payload(
&self,
payload: &IndexMap<String, QuillValue>,
) -> Result<IndexMap<String, QuillValue>, CoercionError>
pub fn coerce_payload( &self, payload: &IndexMap<String, QuillValue>, ) -> Result<IndexMap<String, QuillValue>, CoercionError>
Coerce typed payload fields (IndexMap of user fields only).
Sourcepub fn coerce_card(
&self,
card_kind: &str,
fields: &IndexMap<String, QuillValue>,
) -> Result<IndexMap<String, QuillValue>, CoercionError>
pub fn coerce_card( &self, card_kind: &str, fields: &IndexMap<String, QuillValue>, ) -> Result<IndexMap<String, QuillValue>, CoercionError>
Coerce typed fields for a single card (IndexMap of user fields only).
Returns the input unchanged when the card kind 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_with_warnings(
yaml_content: &str,
) -> Result<(QuillConfig, Vec<Diagnostic>), Vec<Diagnostic>>
pub fn from_yaml_with_warnings( yaml_content: &str, ) -> Result<(QuillConfig, 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, YamlError>
pub fn schema_yaml(&self) -> Result<String, YamlError>
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<QuillConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuillConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for QuillConfig
impl PartialEq for QuillConfig
Source§impl Serialize for QuillConfig
impl Serialize for QuillConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for QuillConfig
Auto Trait Implementations§
impl !Freeze for QuillConfig
impl RefUnwindSafe for QuillConfig
impl Send for QuillConfig
impl Sync for QuillConfig
impl Unpin for QuillConfig
impl UnsafeUnpin for QuillConfig
impl UnwindSafe for QuillConfig
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
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.Source§impl<U, T> ToOwnedTable<U> for Twhere
U: FromTableRef<T>,
impl<U, T> ToOwnedTable<U> for Twhere
U: FromTableRef<T>,
fn to_owned_table(&self) -> U
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more