diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-11-07 19:02:13 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-11-07 19:07:11 +0100 |
| commit | 1ece263579afcf94ca44acc8e157bce01c3226b8 (patch) | |
| tree | 6da8a7b03bf2138efb728d20f506aec3557afe5c /src/library/style.rs | |
| parent | 271af7ed0308c9eca7da5dce93d52d38be84889f (diff) | |
Create easy-to-use argument parser 💎
Diffstat (limited to 'src/library/style.rs')
| -rw-r--r-- | src/library/style.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library/style.rs b/src/library/style.rs index 48f4d4db..9bcdcccd 100644 --- a/src/library/style.rs +++ b/src/library/style.rs @@ -2,8 +2,8 @@ use crate::func::prelude::*; use toddle::query::FontClass; macro_rules! stylefunc { - ($ident:ident) => ( - /// Styles text. + ($ident:ident, $doc:expr) => ( + #[doc = $doc] #[derive(Debug, PartialEq)] pub struct $ident { body: Option<SyntaxTree> @@ -24,7 +24,7 @@ macro_rules! stylefunc { Ok(match &this.body { Some(body) => commands![ Command::SetStyle(new_style), - Command::Layout(body), + Command::LayoutTree(body), Command::SetStyle(ctx.style.clone()), ], None => commands![Command::SetStyle(new_style)] @@ -34,6 +34,6 @@ macro_rules! stylefunc { ); } -stylefunc!(Italic); -stylefunc!(Bold); -stylefunc!(Monospace); +stylefunc!(Italic, "💡 `italic`: Sets text in _italics_."); +stylefunc!(Bold, "🧱 `bold`: Sets text in **bold**."); +stylefunc!(Monospace, "👩💻 `mono`: Sets text in `monospace`."); |
