summaryrefslogtreecommitdiff
path: root/src/func.rs
diff options
context:
space:
mode:
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) }
+}