summaryrefslogtreecommitdiff
path: root/library/src/basics
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-14 10:09:44 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-14 10:09:44 +0100
commit9ba4d2c134479aad876a0e2ac4cd1622a353109e (patch)
treea94e0e6ae53a1ba440e869fca26cc2ea0b179057 /library/src/basics
parent4c73456fc1f5df8ebb3a89d9db657c3c54624d66 (diff)
New macro setup
Diffstat (limited to 'library/src/basics')
-rw-r--r--library/src/basics/heading.rs4
-rw-r--r--library/src/basics/list.rs5
-rw-r--r--library/src/basics/table.rs4
3 files changed, 10 insertions, 3 deletions
diff --git a/library/src/basics/heading.rs b/library/src/basics/heading.rs
index 0033f021..80f93e8d 100644
--- a/library/src/basics/heading.rs
+++ b/library/src/basics/heading.rs
@@ -6,6 +6,8 @@ use crate::prelude::*;
use crate::text::{SpaceNode, TextNode, TextSize};
/// A section heading.
+#[func]
+#[capable(Prepare, Show, Finalize)]
#[derive(Debug, Hash)]
pub struct HeadingNode {
/// The logical nesting depth of the section, starting from one. In the
@@ -15,7 +17,7 @@ pub struct HeadingNode {
pub body: Content,
}
-#[node(Prepare, Show, Finalize)]
+#[node]
impl HeadingNode {
/// How to number the heading.
#[property(referenced)]
diff --git a/library/src/basics/list.rs b/library/src/basics/list.rs
index bcd8ef1c..0fa8f125 100644
--- a/library/src/basics/list.rs
+++ b/library/src/basics/list.rs
@@ -4,6 +4,8 @@ use crate::prelude::*;
use crate::text::{SpaceNode, TextNode};
/// An unordered (bulleted) or ordered (numbered) list.
+#[func]
+#[capable(Layout)]
#[derive(Debug, Hash)]
pub struct ListNode<const L: ListKind = LIST> {
/// If true, the items are separated by leading instead of list spacing.
@@ -18,7 +20,7 @@ pub type EnumNode = ListNode<ENUM>;
/// A description list.
pub type DescNode = ListNode<DESC>;
-#[node(Layout)]
+#[node]
impl<const L: ListKind> ListNode<L> {
/// How the list is labelled.
#[property(referenced)]
@@ -143,6 +145,7 @@ impl<const L: ListKind> Layout for ListNode<L> {
}
/// An item in a list.
+#[capable]
#[derive(Debug, Clone, Hash)]
pub enum ListItem {
/// An item of an unordered list.
diff --git a/library/src/basics/table.rs b/library/src/basics/table.rs
index 448ad1bd..5a4e8e81 100644
--- a/library/src/basics/table.rs
+++ b/library/src/basics/table.rs
@@ -2,6 +2,8 @@ use crate::layout::{GridNode, TrackSizing, TrackSizings};
use crate::prelude::*;
/// A table of items.
+#[func]
+#[capable(Layout)]
#[derive(Debug, Hash)]
pub struct TableNode {
/// Defines sizing for content rows and columns.
@@ -12,7 +14,7 @@ pub struct TableNode {
pub cells: Vec<Content>,
}
-#[node(Layout)]
+#[node]
impl TableNode {
/// How to fill the cells.
#[property(referenced)]