Templates in tectonic -X new
?
#881
Replies: 4 comments
-
Hi, Thanks for inquiring! (Sorry for taking a little while to reply.) This is definitely the kind of feature that we'd be interested in having. To give a bit of architectural context, the vision for workspaces is to basically be very similar to how Cargo does things — I'd like to have a model where a "workspace" contains some bunch of Tectonic documents (each defined by a In that general framework, I can think of a few general ways that templates might be implemented. The one that might be the simplest, which I think we have another open issue for, would be to make it so that you could add a workspace directory to a document's file lookup path:
.. where both
The key thing here is that for encapsulation and reproducibility reasons, I would not want to allow the above syntax outside of the workspace framework: all of the files referenced during a document build should either be in a bundle, or contained in its source tree. I could see how an Regardless, I think that workspace support needs to be pretty carefully designed to deliver a combination of security, usefulness, and scalability — I think that there are actually a lot of interesting use cases that open up if the framework makes it possible to create a whole graph of documents that "depend" on each other like a Cargo crate graph. I'd be delighted to talk through the design process if this is something you continue to be interested in working on! |
Beta Was this translation helpful? Give feedback.
-
for clarity on my experience -- i'm a Rust-curious, dependency-generalist kinda person, so I don't know exactly how Cargo works but am interested in schemes of exact dependency graphs.
This makes sense, and maybe a few parallel ideas/implementations here:
I see it in a sort of architectural lens, so like "good for me" is subordinate to "good for the tool." I think encapsulation so that
basically this! maybe this is worth having as more of an "open question" design discussion. at least for me as a rust novice i would need a bit more information about the existing structure of the library to know what's possible/advisable :) |
Beta Was this translation helpful? Give feedback.
-
Well, I just recently turned on GitHub Discussions for this repo, and I think you're right, so I'll try converting this to a Discussion and we can see what that flow is like ... |
Beta Was this translation helpful? Give feedback.
-
Is it possible to customize For instance, I use almost identical set of packages and initial setups in all my documents. |
Beta Was this translation helpful? Give feedback.
-
Hello! I'm wondering if the maintainers would be interested in a templates feature?
Of course it's possible to copy and paste/symlink everything manually, but especially when you're working on a family of documents it would be lovely to be able to have some parent template for creating documents with
tectonic -X new
, and even better if it was possible for templates to include each other so there could be one root template and then elaborations for different subtypes of documents.I see that the project structure is currently hardcoded here:
tectonic/crates/docmodel/src/workspace.rs
Line 119 in 9896567
So it seems like it shouldn't be too challenging to add an additional flag that just pulls some existing files from another project? And maybe even possible to specify which files in a project are template files in case you want to reuse them? eg.
Just checking if this is something you'd be interested in/had any preference on how it was written. Would be happy to draft a PR if so :)
Beta Was this translation helpful? Give feedback.
All reactions