@@ -49,6 +49,12 @@ 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+ /// which may be read by external tools.
56+ pub metadata : Option < toml:: Value > ,
57+
5258 /// The document name. This will be used to name build artifacts and the
5359 /// like, and so should be relatively filesystem-friendly. It does not
5460 /// need to be the same as the document title.
@@ -103,6 +109,7 @@ impl Document {
103109 build_dir : build_dir. into ( ) ,
104110 name : doc. doc . name ,
105111 bundle_loc : doc. doc . bundle ,
112+ metadata : doc. doc . metadata ,
106113 outputs,
107114 } )
108115 }
@@ -124,6 +131,7 @@ impl Document {
124131 doc : syntax:: DocSection {
125132 name : self . name . clone ( ) ,
126133 bundle : self . bundle_loc . clone ( ) ,
134+ metadata : None ,
127135 } ,
128136 outputs,
129137 } ;
@@ -288,6 +296,7 @@ impl Document {
288296 name,
289297 bundle_loc,
290298 outputs : crate :: document:: default_outputs ( ) ,
299+ metadata : None ,
291300 } )
292301 }
293302}
@@ -329,6 +338,7 @@ mod syntax {
329338 pub struct DocSection {
330339 pub name : String ,
331340 pub bundle : String ,
341+ pub metadata : Option < toml:: Value > ,
332342 }
333343
334344 #[ derive( Debug , Deserialize , Serialize ) ]
0 commit comments