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

Make the template "live" or executable #13

Open
benjaoming opened this issue Oct 18, 2022 · 0 comments
Open

Make the template "live" or executable #13

benjaoming opened this issue Oct 18, 2022 · 0 comments

Comments

@benjaoming
Copy link

A proposal: In order to ensure the quality and correctness of the template, it's necessary that it's somehow runnable in itself.

So how do we run the template in order to see that it works?

There are two ways to approach the issue...

1. Apply template substitution (then run it)

If the template is full of substitution variables, it would need to be "instantiated" before running it. That also means testing the application of the template itself, which is good.

2. Write a template without substitution (so it's always runnable)

In this setting, the template has all its substitution variable documented but doesn't contain any placeholders in areas that need execution.

The template could for instance have a name, Pseudo BB.

All BBs that would wish to adopt from it, would refer to a list of places in Pseudo BB that needs to be customized individually, such as the name "Pseudo".

Which one?

I lean a bit towards number 2 because it doesn't deal with a substitution layer, i.e. some template engine and its quirky syntax. Why? Templating is about not just substitution of file contents, but also file and folder names. This quickly becomes messy to look.

I'd definitely suggest to avoid a mix of 1 and 2.. i.e. if you cannot have a complete and automatic substitution mechanism, then don't have one at all and go for documentation.

The template should perhaps also be structured so it looks a bit more like:

template/
docs/
README.md  # A README for the template, not a template for a README! :D

This could also be achieved with separate git repos, but that ruins release flows and will make documentation drift.

That was all :)

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

1 participant