Skip to content

Commit fc7c99e

Browse files
committed
Re-added metadata field to bundle
1 parent 6a723f5 commit fc7c99e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

crates/docmodel/src/document.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ pub struct Document {
4949
/// this will be a subdirectory of `src_dir` named `build`.
5050
build_dir: PathBuf,
5151

52+
/// Arbitrary document metadata.
53+
/// This has no effect on tectonic's build process.
54+
/// Rather, allows users to add easily-accessible information to their documents.
55+
///
56+
/// Tectonic's `show metadata` command displays this information.
57+
pub metadata: Option<toml::Value>,
58+
5259
/// The document name. This will be used to name build artifacts and the
5360
/// like, and so should be relatively filesystem-friendly. It does not
5461
/// need to be the same as the document title.
@@ -103,6 +110,7 @@ impl Document {
103110
build_dir: build_dir.into(),
104111
name: doc.doc.name,
105112
bundle_loc: doc.doc.bundle,
113+
metadata: doc.doc.metadata,
106114
outputs,
107115
})
108116
}
@@ -124,7 +132,7 @@ impl Document {
124132
doc: syntax::DocSection {
125133
name: self.name.clone(),
126134
bundle: self.bundle_loc.clone(),
127-
metadata: serde::de::IgnoredAny{},
135+
metadata: None,
128136
},
129137
outputs,
130138
};
@@ -289,6 +297,7 @@ impl Document {
289297
name,
290298
bundle_loc,
291299
outputs: crate::document::default_outputs(),
300+
metadata: None,
292301
})
293302
}
294303
}
@@ -330,9 +339,7 @@ mod syntax {
330339
pub struct DocSection {
331340
pub name: String,
332341
pub bundle: String,
333-
334-
#[serde(skip_serializing)]
335-
pub metadata: serde::de::IgnoredAny,
342+
pub metadata: Option<toml::Value>,
336343
}
337344

338345
#[derive(Debug, Deserialize, Serialize)]

0 commit comments

Comments
 (0)