@@ -49,6 +49,12 @@ pub struct Document {
49
49
/// this will be a subdirectory of `src_dir` named `build`.
50
50
build_dir : PathBuf ,
51
51
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
+ /// which may be read by external tools.
56
+ pub metadata : Option < toml:: Value > ,
57
+
52
58
/// The document name. This will be used to name build artifacts and the
53
59
/// like, and so should be relatively filesystem-friendly. It does not
54
60
/// need to be the same as the document title.
@@ -103,6 +109,7 @@ impl Document {
103
109
build_dir : build_dir. into ( ) ,
104
110
name : doc. doc . name ,
105
111
bundle_loc : doc. doc . bundle ,
112
+ metadata : doc. doc . metadata ,
106
113
outputs,
107
114
} )
108
115
}
@@ -124,6 +131,7 @@ impl Document {
124
131
doc : syntax:: DocSection {
125
132
name : self . name . clone ( ) ,
126
133
bundle : self . bundle_loc . clone ( ) ,
134
+ metadata : None ,
127
135
} ,
128
136
outputs,
129
137
} ;
@@ -288,6 +296,7 @@ impl Document {
288
296
name,
289
297
bundle_loc,
290
298
outputs : crate :: document:: default_outputs ( ) ,
299
+ metadata : None ,
291
300
} )
292
301
}
293
302
}
@@ -329,6 +338,7 @@ mod syntax {
329
338
pub struct DocSection {
330
339
pub name : String ,
331
340
pub bundle : String ,
341
+ pub metadata : Option < toml:: Value > ,
332
342
}
333
343
334
344
#[ derive( Debug , Deserialize , Serialize ) ]
0 commit comments