Code Generation Tutorials¶
Tackle was originally built from cookiecutter, a very popular code scaffolding tool, and extends its functionality with additional language features such as modularity, conditionals and loops, reusable objects, and more. These tutorials aim to walk through some of the patterns that can be used to build anything from a lightweight single document code generator to a project scaffolding tool used to continually update project templates over time.
Sections¶
- Basic Code Generation
- Basic code generation / the generate hook
- Flow control for code generation
- Modular Code Generation
- Calling code generating modules
- Maintaining context between tackle providers
- Partial Code Generation
- Generating code in specific parts of documents
- Stateful Code Generation
- Maintaining state when running code generation
- WIP
Examples¶
For those that learn best via examples, here are a few that should get the general point across:
- tackle-provider
- A tackle provider for creating other tackle providers
- tackle-license
- A tackle provider for creating license files
- Tackle provider docs
- Tackle's provider docs are generated with tackle
- This example uses the provider_docs hook from a tackle-file which then calls a mkdocs.yaml
- The most important resource is the testing providers docs which goes into details about how to test hooks and tackle files.