summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-18 16:52:07 +0300
committerLars Wirzenius <liw@liw.fi>2021-09-18 16:52:07 +0300
commitc7e837f3713ae5e332dd2066e62f1d2d004ef99d (patch)
treee2d16bdb4a1352bb133f9597a07ac3b5a3a1c9ab
parent5d023ad5bc648c9ed91d6860f6f706331542bfe5 (diff)
downloadsubplot-c7e837f3713ae5e332dd2066e62f1d2d004ef99d.tar.gz
feat: allow the `documentclass` field in document metadata
With the new pulldown-cmark parser for codegen, we are explicit about what fields we allow in the YAML document metadata block. We currently don't allow the `documentclass` field. Allow it. It's a useful way for controlling typesetting vie LaTeX to PDF. Sponsored-by: author
-rw-r--r--src/ast.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ast.rs b/src/ast.rs
index 9543efd..6255fb5 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -279,6 +279,7 @@ struct Metadata {
bibliography: Option<Vec<PathBuf>>,
bindings: Option<Vec<PathBuf>>,
functions: Option<Vec<PathBuf>>,
+ documentclass: Option<String>,
}
impl Metadata {
@@ -316,6 +317,9 @@ impl Metadata {
if let Some(v) = &self.functions {
map.insert(s("functions"), meta_path_bufs(v));
}
+ if let Some(v) = &self.documentclass {
+ map.insert(s("documentclass"), meta_string(v));
+ }
event!(
Level::TRACE,
?self,