summaryrefslogtreecommitdiff
path: root/src/func.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-06-22 17:01:32 +0200
committerLaurenz <laurmaedje@gmail.com>2019-06-22 17:01:32 +0200
commit5de92f6d5e482af412763ba40e55a16102b79b20 (patch)
tree1b291d6e66108b6fe0f3e512d4179b5531753eb1 /src/func.rs
parent099ce71aba54a40455b7ce35768c8fe003f7b16a (diff)
Add monospace syntax 📰
Diffstat (limited to 'src/func.rs')
-rw-r--r--src/func.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/func.rs b/src/func.rs
index 91f3cf74..e7f3dbfa 100644
--- a/src/func.rs
+++ b/src/func.rs
@@ -77,13 +77,12 @@ impl Scope {
Scope { parsers: HashMap::new() }
}
- /// Create a new scope with the standard functions contained:
- /// - `italic`
- /// - `bold`
+ /// Create a new scope with the standard functions contained.
pub fn with_std() -> Scope {
let mut std = Scope::new();
std.add::<BoldFunc>("bold");
std.add::<ItalicFunc>("italic");
+ std.add::<MonospaceFunc>("mono");
std
}
@@ -161,3 +160,9 @@ style_func! {
pub struct ItalicFunc { "italic" },
style => { style.toggle_class(FontClass::Italic) }
}
+
+style_func! {
+ /// Typesets text in monospace.
+ pub struct MonospaceFunc { "mono" },
+ style => { style.toggle_class(FontClass::Monospace) }
+}