diff options
Diffstat (limited to 'src/ast.rs')
-rw-r--r-- | src/ast.rs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -109,6 +109,15 @@ impl<'a> Document { self.files.files() } + /// Check that document has a title in its metadata. + pub fn has_title(&self) -> Result<()> { + if self.meta().title().is_empty() { + Err(Error::no_title()) + } else { + Ok(()) + } + } + /// Typeset a Subplot document. pub fn typeset(&mut self) { let mut visitor = TypesettingVisitor::new(&self.meta.bindings); |