Skip to content

Commit 0f8e082

Browse files
committed
docs: added some links to tera and cleaned up the why
1 parent 5cd7ef6 commit 0f8e082

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

docs/src/content/docs/creating-templates/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Hello, Alice!
5353

5454
That's a template. You just made one.
5555

56-
The `template/` directory contains your project files. Files ending in `.tera` are rendered through the Tera template engine, then have the `.tera` suffix stripped. Everything else is copied as-is.
56+
The `template/` directory contains your project files. Files ending in `.tera` are rendered through the [Tera template engine](https://keats.github.io/tera/), then have the `.tera` suffix stripped. Everything else is copied as-is.
5757

5858
## Variable types
5959

@@ -144,7 +144,7 @@ choices = ["github-actions", "gitlab-ci"]
144144
when = "{{ use_ci }}"
145145
```
146146

147-
`ci_provider` is only prompted when `use_ci` is true. The `when` field takes a Tera expression.
147+
`ci_provider` is only prompted when `use_ci` is true. The `when` field takes a [Tera expression](https://keats.github.io/tera/docs/#expressions).
148148

149149
## Conditional files
150150

@@ -211,7 +211,7 @@ Files matching these patterns are copied verbatim. Tera syntax inside them is le
211211

212212
## Tera template basics
213213

214-
Five things you'll actually use.
214+
Five things you'll actually use. See the [Tera documentation](https://keats.github.io/tera/) for complete reference.
215215

216216
### Variables
217217

@@ -251,7 +251,7 @@ Transform values inline:
251251
{{ description | truncate(length=50) }}
252252
```
253253

254-
`slugify` turns "My Project" into "my-project". `upper` uppercases. `truncate` cuts to length.
254+
`slugify` turns "My Project" into "my-project". `upper` uppercases. `truncate` cuts to length. See all [built-in filters](https://keats.github.io/tera/docs/#built-in-filters).
255255

256256
### Comments
257257

docs/src/content/docs/getting-started/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ license = "MIT"
6767

6868
## What just happened?
6969

70-
diecut cloned the template repo, navigated to the `rust-cli` subdirectory, read the `diecut.toml` config, prompted you for variables, and rendered every `.tera` file through the Tera template engine. The `.tera` suffix was stripped from output filenames. Files without `.tera` were copied as-is. Your answers were saved to `.diecut-answers.toml`.
70+
diecut cloned the template repo, navigated to the `rust-cli` subdirectory, read the `diecut.toml` config, prompted you for variables, and rendered every `.tera` file through the [Tera template engine](https://keats.github.io/tera/). The `.tera` suffix was stripped from output filenames. Files without `.tera` were copied as-is. Your answers were saved to `.diecut-answers.toml`.
7171

7272
## Next steps
7373

docs/src/content/docs/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ That's it. diecut prompts you for variables and generates a ready-to-go project.
4949

5050
## Why diecut?
5151

52-
I built diecut because I tend to make lots of projects for fun. I get a stack I like, and I don't like messing around with the setup. I enjoyed cookiecutter back in the day, but I found it complicating my life more than simplifying it.
52+
I built diecut because I tend to make lots of projects for fun. I get a stack I like, and I don't like messing around with the setup. I enjoyed cookiecutter back in the day, but I found it complicating my life more than simplifying it.
5353

5454
I aimed to solve four things:
5555

56-
- **Single binary**: I've often just wanted to download a binary and no faff with Python stuff, even though I wrote mostly Python.
57-
- **Easy to make**: I wanted it to be dead simple to make templates with as few footguns as possible.
58-
- **Multi-template repos**: I dabble a lot in different stacks and languages, but I'd rather not have 5 different repos for my templates. This felt like a good way to organize them.
59-
- **Dry run**: sometimes I want to see what the result will look like before I commit to it.
56+
- **[Single binary](/getting-started/)**: I've often just wanted to download a binary and no faff with Python stuff, even though I wrote mostly Python.
57+
- **[Easy to make](/creating-templates/)**: I wanted it to be dead simple to make templates with as few footguns as possible. So you also don't need to do complicated logic in the templates, because you can just chain conditional prompts together to get your answers. You don't even need to use almost any of the Tera templating at all and can just use conditional files feature to exclude files you don't want.
58+
- **[Multi-template repos](/using-templates/)**: I dabble a lot in different stacks and languages, but I'd rather not have 5 different repos for my templates. This felt like a good way to organize them.
59+
- **[Safe to try](/reference/commands/)**: sometimes I want to see what the result will look like before I commit to it, but none of the other tools out there had this feature.

docs/src/content/docs/reference/diecut-toml.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ file = ".diecut-answers.toml"
6868

6969
Template metadata. Only `name` is required.
7070

71-
- **`templates_suffix`** -- Change from `.tera` to something else if you prefer (e.g., `.j2`, `.tmpl`). Files matching this suffix are rendered through the Tera engine; others are copied as-is.
71+
- **`templates_suffix`** -- Change from `.tera` to something else if you prefer (e.g., `.j2`, `.tmpl`). Files matching this suffix are rendered through the [Tera](https://keats.github.io/tera/) engine; others are copied as-is.
7272
- **`min_diecut_version`** -- If set, diecut will refuse to process the template if the installed version is too old.
7373

7474
## [variables]
@@ -78,8 +78,8 @@ Variables are prompted in declaration order. Each variable is a TOML table under
7878
Key behaviors:
7979

8080
- `select` and `multiselect` require `choices` to be set.
81-
- `computed` variables must **not** have a `prompt`. They are derived from other variables using Tera expressions.
82-
- `when` controls conditional prompting. Uses Tera expression syntax (e.g., `"{{ use_ci }}"` or just `"use_ci"`).
81+
- `computed` variables must **not** have a `prompt`. They are derived from other variables using [Tera expressions](https://keats.github.io/tera/docs/#expressions).
82+
- `when` controls conditional prompting. Uses [Tera expression](https://keats.github.io/tera/docs/#expressions) syntax (e.g., `"{{ use_ci }}"` or just `"use_ci"`).
8383
- `validation` is a regex pattern. The entire input must match (anchored).
8484
- `secret` variables are prompted but excluded from `.diecut-answers.toml`.
8585
- Variables are available in templates as `{{ variable_name }}`.
@@ -113,7 +113,7 @@ computed = "{{ project_name | slugify }}"
113113
Control which files are included and how they're processed.
114114

115115
- **`exclude`** -- Glob patterns. Matched files are not written to output. Useful for build artifacts, OS files.
116-
- **`copy_without_render`** -- Glob patterns. Matched files skip Tera rendering and are copied verbatim. Use for binaries, images, or files that contain `{{ }}` syntax that isn't meant for Tera.
116+
- **`copy_without_render`** -- Glob patterns. Matched files skip [Tera](https://keats.github.io/tera/) rendering and are copied verbatim. Use for binaries, images, or files that contain `{{ }}` syntax that isn't meant for Tera.
117117
- **`conditional`** -- Array of `{ pattern, when }` objects. Files matching `pattern` are included only when `when` evaluates to true.
118118

119119
```toml

0 commit comments

Comments
 (0)