diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-15 22:51:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-15 23:11:20 +0100 |
| commit | b6202b646a0d5ecced301d9bac8bfcaf977d7ee4 (patch) | |
| tree | 7d42cb50f9e66153e7e8b2217009684e25f54f42 /library/src/text/misc.rs | |
| parent | f3980c704544a464f9729cc8bc9f97d3a7454769 (diff) | |
Reflection for castables
Diffstat (limited to 'library/src/text/misc.rs')
| -rw-r--r-- | library/src/text/misc.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/library/src/text/misc.rs b/library/src/text/misc.rs index 1c5a32b4..fc4f7d73 100644 --- a/library/src/text/misc.rs +++ b/library/src/text/misc.rs @@ -2,6 +2,8 @@ use super::TextNode; use crate::prelude::*; /// A text space. +/// +/// Tags: text. #[func] #[capable(Unlabellable, Behave)] #[derive(Debug, Hash)] @@ -23,6 +25,8 @@ impl Behave for SpaceNode { } /// A line break. +/// +/// Tags: text. #[func] #[capable(Behave)] #[derive(Debug, Hash)] @@ -45,6 +49,8 @@ impl Behave for LinebreakNode { } /// Strongly emphasizes content by increasing the font weight. +/// +/// Tags: text. #[func] #[capable(Show)] #[derive(Debug, Hash)] @@ -79,8 +85,7 @@ pub struct Delta(pub i64); castable! { Delta, - Expected: "integer", - Value::Int(delta) => Self(delta), + v: i64 => Self(v), } impl Fold for Delta { @@ -92,6 +97,8 @@ impl Fold for Delta { } /// Emphasizes content by flipping the italicness. +/// +/// Tags: text. #[func] #[capable(Show)] #[derive(Debug, Hash)] @@ -130,12 +137,16 @@ impl Fold for Toggle { } /// Convert a string or content to lowercase. +/// +/// Tags: text. #[func] pub fn lower(args: &mut Args) -> SourceResult<Value> { case(Case::Lower, args) } /// Convert a string or content to uppercase. +/// +/// Tags: text. #[func] pub fn upper(args: &mut Args) -> SourceResult<Value> { case(Case::Upper, args) @@ -171,6 +182,8 @@ impl Case { } /// Display text in small capitals. +/// +/// Tags: text. #[func] pub fn smallcaps(args: &mut Args) -> SourceResult<Value> { let body: Content = args.expect("content")?; |
