summaryrefslogtreecommitdiff
path: root/library/src/meta
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/meta
parent4c73456fc1f5df8ebb3a89d9db657c3c54624d66 (diff)
New macro setup
Diffstat (limited to 'library/src/meta')
-rw-r--r--library/src/meta/document.rs4
-rw-r--r--library/src/meta/link.rs4
-rw-r--r--library/src/meta/outline.rs4
-rw-r--r--library/src/meta/reference.rs4
4 files changed, 12 insertions, 4 deletions
diff --git a/library/src/meta/document.rs b/library/src/meta/document.rs
index fbb62b6b..1dae4a2a 100644
--- a/library/src/meta/document.rs
+++ b/library/src/meta/document.rs
@@ -2,10 +2,12 @@ use crate::layout::{LayoutRoot, PageNode};
use crate::prelude::*;
/// The root node that represents a full document.
+#[func]
+#[capable(LayoutRoot)]
#[derive(Hash)]
pub struct DocumentNode(pub StyleVec<PageNode>);
-#[node(LayoutRoot)]
+#[node]
impl DocumentNode {
/// The document's title.
#[property(referenced)]
diff --git a/library/src/meta/link.rs b/library/src/meta/link.rs
index 34304ea9..94328b00 100644
--- a/library/src/meta/link.rs
+++ b/library/src/meta/link.rs
@@ -2,6 +2,8 @@ use crate::prelude::*;
use crate::text::TextNode;
/// Link text and other elements to a destination.
+#[func]
+#[capable(Show, Finalize)]
#[derive(Debug, Hash)]
pub struct LinkNode {
/// The destination the link points to.
@@ -23,7 +25,7 @@ impl LinkNode {
}
}
-#[node(Show, Finalize)]
+#[node]
impl LinkNode {
fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> {
let dest = args.expect::<Destination>("destination")?;
diff --git a/library/src/meta/outline.rs b/library/src/meta/outline.rs
index 53535be5..d0fbc3f7 100644
--- a/library/src/meta/outline.rs
+++ b/library/src/meta/outline.rs
@@ -4,10 +4,12 @@ use crate::prelude::*;
use crate::text::{LinebreakNode, SpaceNode, TextNode};
/// A section outline (table of contents).
+#[func]
+#[capable(Prepare, Show)]
#[derive(Debug, Hash)]
pub struct OutlineNode;
-#[node(Prepare, Show)]
+#[node]
impl OutlineNode {
/// The title of the outline.
#[property(referenced)]
diff --git a/library/src/meta/reference.rs b/library/src/meta/reference.rs
index a04fd13f..657e5ef7 100644
--- a/library/src/meta/reference.rs
+++ b/library/src/meta/reference.rs
@@ -2,10 +2,12 @@ use crate::prelude::*;
use crate::text::TextNode;
/// A reference to a label.
+#[func]
+#[capable(Show)]
#[derive(Debug, Hash)]
pub struct RefNode(pub EcoString);
-#[node(Show)]
+#[node]
impl RefNode {
fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> {
Ok(Self(args.expect("target")?).pack())