go-task / task

A task runner / simpler Make alternative written in Go
https://taskfile.dev
MIT License
11.15k stars 595 forks source link

go-task is hard to use without knowing the go template engine #1679

Open callegar opened 4 months ago

callegar commented 4 months ago

I would like to see the go-task documentation expanded because currently it is very difficult to understand how to use go-task unless you have a go background.

From the documentation I am getting the impression that go-task should be a generic task runner / build tool and not a tool specific to go programmers. This impression comes from the fact that it is presented as a simpler and easier to use replacement for GNU Make and similar software.

However, it is currently very difficult to understand what can and cannot go within {{ }}. Specifically the page at https://golang.org/pkg/text/template/ that is linked in the documentation is not really easy to follow by those without a go programming background.

For instance: if I have a glob pattern, how do I put into a variable its expansion? If I have an array variable, can I flatten it into a string to pass it to the shell? Complex as it is, the GNU Make manual has an extended section about variables and functions applicable to them and it would be nice to have at least some more examples about how to use functions on variables in go-task.

Thanks for the attention.

pd93 commented 4 months ago

Hey @callegar. Funny that you mention this now. The next version of our docs will come with a Templating Reference page. You can view a preview of this here: https://taskfile.dev/next/reference/templating. This is only meant to provide a high-level overview of the functionality available in the templating engine and the variables/functions available, but it should be more than enough for most users.

Please let us know if you think there's anything missing here and we can make a decision as to whether more information needs adding.

callegar commented 4 months ago

This is great news! Thanks!

I have given just a quick peek at it, seems exactly what I was looking for! There are just minor things that maybe could be expanded: