There are a few changes to datafiles and programs that enable authors to more creatively combine various programs and data in a book.
Datafile linking change + deprecation
Programs have until now linked to datafiles via a @datafile attribute on the program that matches a @filename on the datafile. This imposed a uniqueness requirement on @filename that was not always desirable and differed from the standard method for specifying one element from another (
@xml:id).
Programs should now link to datafiles using an @add-files that contains the xml:id(s) of one or more datafiles. As these may not exist in current documents, PreTeXt can't automatically fix this for authors. So for the time being, the old syntax will continue to function but will generate a warning.
New program attributesA few new directives enable building programs across multiple files in more sophisticated ways than the existing @include mechanism for programs. These are primarily of interest to authors of books using programs that must be compiled on a server.
- @add-files allows for specifying book elements (programs or datafiles) that need to be placed into the build folder as files available both to the compiler and the finished program (data files, header files, etc...)
- @compile-also allows for specifying other book programs that should be built at the same time as the current program. For example a library.cpp program that needs to be built along with the current file.
- @extra-compiler-args allows for specifying args that are added to any existing book level default compiler arguments for a particular program.
As always, please report any issues you encounter on either the pretext-support or pretext-dev mailing list.