summaryrefslogtreecommitdiff
path: root/src/library/structure
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-03-12 14:24:24 +0100
committerLaurenz <laurmaedje@gmail.com>2022-03-12 14:24:24 +0100
commit2890a156d27c02a101137bf01dc2046597110bd1 (patch)
treec6bdeb48242c0fbd5b5e13120ca3c8f502d41b75 /src/library/structure
parent5ac7eb3860ebd3247f6486c227e816894cb8fd91 (diff)
Remove classes and improve naming
Diffstat (limited to 'src/library/structure')
-rw-r--r--src/library/structure/heading.rs2
-rw-r--r--src/library/structure/list.rs2
-rw-r--r--src/library/structure/table.rs7
3 files changed, 6 insertions, 5 deletions
diff --git a/src/library/structure/heading.rs b/src/library/structure/heading.rs
index f5565f3c..f1bc795f 100644
--- a/src/library/structure/heading.rs
+++ b/src/library/structure/heading.rs
@@ -11,7 +11,7 @@ pub struct HeadingNode {
pub body: Content,
}
-#[class]
+#[node(showable)]
impl HeadingNode {
/// The heading's font family. Just the normal text family if `auto`.
pub const FAMILY: Leveled<Smart<FontFamily>> = Leveled::Value(Smart::Auto);
diff --git a/src/library/structure/list.rs b/src/library/structure/list.rs
index 2630d231..414f601e 100644
--- a/src/library/structure/list.rs
+++ b/src/library/structure/list.rs
@@ -28,7 +28,7 @@ pub struct ListItem {
/// An ordered list.
pub type EnumNode = ListNode<ORDERED>;
-#[class]
+#[node(showable)]
impl<const L: ListKind> ListNode<L> {
/// How the list is labelled.
pub const LABEL: Label = Label::Default;
diff --git a/src/library/structure/table.rs b/src/library/structure/table.rs
index 42b62eac..0e455ead 100644
--- a/src/library/structure/table.rs
+++ b/src/library/structure/table.rs
@@ -12,7 +12,7 @@ pub struct TableNode {
pub children: Vec<Content>,
}
-#[class]
+#[node(showable)]
impl TableNode {
/// The primary cell fill color.
pub const PRIMARY: Option<Paint> = None;
@@ -41,14 +41,15 @@ impl TableNode {
}))
}
- fn set(args: &mut Args, styles: &mut StyleMap) -> TypResult<()> {
+ fn set(args: &mut Args) -> TypResult<StyleMap> {
+ let mut styles = StyleMap::new();
let fill = args.named("fill")?;
styles.set_opt(Self::PRIMARY, args.named("primary")?.or(fill));
styles.set_opt(Self::SECONDARY, args.named("secondary")?.or(fill));
styles.set_opt(Self::STROKE, args.named("stroke")?);
styles.set_opt(Self::THICKNESS, args.named("thickness")?);
styles.set_opt(Self::PADDING, args.named("padding")?);
- Ok(())
+ Ok(styles)
}
}