From a9fdff244aef859449a76e5f762ee7c343a8ddcc Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 10 Mar 2023 20:47:23 +0100 Subject: Expose content representation more --- src/model/realize.rs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/model/realize.rs') diff --git a/src/model/realize.rs b/src/model/realize.rs index 502774bb..c4c67a4f 100644 --- a/src/model/realize.rs +++ b/src/model/realize.rs @@ -3,11 +3,11 @@ use crate::diag::SourceResult; /// Whether the target is affected by show rules in the given style chain. pub fn applicable(target: &Content, styles: StyleChain) -> bool { - if target.has::() && !target.is_prepared() { + if target.can::() && !target.is_prepared() { return true; } - if target.has::() && target.is_pristine() { + if target.can::() && target.is_pristine() { return true; } @@ -51,7 +51,7 @@ pub fn realize( if let Some(showable) = target.with::() { let guard = Guard::Base(target.id()); if realized.is_none() && !target.is_guarded(guard) { - realized = Some(showable.show(vt, target, styles)?); + realized = Some(showable.show(vt, styles)?); } } @@ -135,23 +135,13 @@ fn try_apply( /// Preparations before execution of any show rule. pub trait Prepare { /// Prepare the node for show rule application. - fn prepare( - &self, - vt: &mut Vt, - this: Content, - styles: StyleChain, - ) -> SourceResult; + fn prepare(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult; } /// The base recipe for a node. pub trait Show { /// Execute the base recipe for this node. - fn show( - &self, - vt: &mut Vt, - this: &Content, - styles: StyleChain, - ) -> SourceResult; + fn show(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult; } /// Post-process a node after it was realized. -- cgit v1.2.3