From 5de92f6d5e482af412763ba40e55a16102b79b20 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 22 Jun 2019 17:01:32 +0200 Subject: =?UTF-8?q?Add=20monospace=20syntax=20=F0=9F=93=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/func.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/func.rs') 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::("bold"); std.add::("italic"); + std.add::("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) } +} -- cgit v1.2.3