Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template containing different flavors #411

Closed
SkytAsul opened this issue Mar 10, 2024 · 1 comment
Closed

Template containing different flavors #411

SkytAsul opened this issue Mar 10, 2024 · 1 comment

Comments

@SkytAsul
Copy link
Contributor

Description

Hello,
I have written a package for my school (available here: https://github.com/SkytAsul/INSA-Typst-Template) and I would like to publish it here. However, this package comes with 3 different flavors: one for reports, one for blank documents and one for letters (and I plan on adding one for thesis).
All of those flavors come within one typ file, people simply have to choose between 3 functions to use in the show rule.
Shall I publish 3 separate templates here so they can be chosen from the template selection screen? I fear if everybody does that it will bloat the repository...

@laurmaedje
Copy link
Member

Minor reconfigurations of the same document should be done via arguments to a show rule, but completely different deliverables (e.g. reports vs. letters) should be separate templates. This way, they can have separate preview images, categories, descriptions, etc. Moreover, a template is fully identified and can be instantiated just from its name, rather than "start from this template and then change this functions here".

If you need to share a lot of code between different deliverables for the same institution, you can factor that out into a shared utility package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants