summaryrefslogtreecommitdiff
path: root/src/library/structure/reference.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-01 16:56:35 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-02 09:18:33 +0100
commit37ac5d966ebaf97ac79c507028cd5b742b510b89 (patch)
tree249d43ff0f8d880cb5d00c236993f8ff0c1f10d8 /src/library/structure/reference.rs
parentf547c97072881069417acd3b79b08fb7ecf40ba2 (diff)
More dynamic content representation
Diffstat (limited to 'src/library/structure/reference.rs')
-rw-r--r--src/library/structure/reference.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/structure/reference.rs b/src/library/structure/reference.rs
index 425ee518..b4e8b047 100644
--- a/src/library/structure/reference.rs
+++ b/src/library/structure/reference.rs
@@ -4,15 +4,15 @@ use crate::library::prelude::*;
#[derive(Debug, Hash)]
pub struct RefNode(pub EcoString);
-#[node(showable)]
+#[node(Show)]
impl RefNode {
fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> {
- Ok(Content::show(Self(args.expect("label")?)))
+ Ok(Self(args.expect("label")?).pack())
}
}
impl Show for RefNode {
- fn unguard(&self, _: Selector) -> ShowNode {
+ fn unguard_parts(&self, _: Selector) -> Content {
Self(self.0.clone()).pack()
}
@@ -24,6 +24,6 @@ impl Show for RefNode {
}
fn realize(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> {
- Ok(Content::Text(format_eco!("@{}", self.0)))
+ Ok(TextNode(format_eco!("@{}", self.0)).pack())
}
}