Skip to content

adriens/task-gomplates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Build with Taskfile.dev

❔ About

Ready-to-use template to use around Task yaml files

Generate a Markdown/ Mermaid Report from a Taskfile with gomplate

Download the template:

curl -o task-to-md-mermaid.gomplate \
	https://raw.githubusercontent.com/adriens/task-gomplates/main/tmpl/task-to-md-mermaid.gomplate

Generate the Markdown report

Use gomplate to transform the Taskfile into Markdown:

gomplate -f task-to-md-mermaid.gomplate -d tasks=Taskfile.yml > Taskfile.md
  • -f: specifies the template file to use
  • -d tasks=Taskfile.yml: loads Taskfile.yml as a datasource named tasks
  • > Taskfile.md: writes the output to the Markdown file

You can then open Taskfile.md in a Markdown editor that supports Mermaid to view the diagram and the task table.

🕹️ Give it a try

Let's generate the documentaton of the build of Task website :

I gave it a try on your taskfile (website) :

  1. Download the Taskfile and the template file
# Download the Taskfile
curl -L https://github.com/go-task/task/raw/main/website/Taskfile.yml \
	-o Taskfile.yml

# Download the gomplate template
curl -L \
  https://github.com/adriens/task-gomplates/raw/main/tmpl/task-to-md-mermaid.gomplate \
  -o task-to-md-mermaid.gomplate
  1. Generate the Markdown Documentation
gomplate -f task-to-md-mermaid.gomplate -d tasks=Taskfile.yml > Taskfile.md
  1. 🙌 Enjoy

Open the markdown in a GH issue.