1TILT(1)                           Tilt Manual                          TILT(1)
2
3
4

NAME

6       tilt - process templates
7

SYNOPSIS

9       tilt -l
10       tilt  [-t  pattern]  [-y  file] [-D name=value] [-d file] [--vars=ruby]
11       file
12

DESCRIPTION

14       Process template file and write output to stdout. With no file or  when
15       file  is ´-´, read template from stdin and use the --type option to de‐
16       termine the template´s type.
17

OPTIONS

19       -l, --list
20              List template engines + file patterns and exit
21
22       -t, --type=pattern
23              Use this template engine; required if no file
24
25       -y, --layout=file
26              Use file as a layout template
27
28       -Dname=value
29              Define variable name as value
30
31       -d, --define-file=file
32              Load YAML or JSON from file and use for variables
33
34       --vars=ruby
35              Evaluate ruby to Hash and use for variables
36
37       -h, --help
38              Show this help message
39

EXAMPLES

41       Convert markdown to HTML:
42
43
44           $ tilt foo.markdown > foo.html
45
46
47
48       Process ERB template:
49
50
51           $ echo "Answer: <%= 2 + 2 %>" | tilt -t erb
52           Answer: 4
53
54
55
56       Define variables:
57
58
59           $ echo ´{"n":40}´ > data.json
60           $ echo "Answer: <%= 2 + n %>" | tilt -t erb -d data.json
61           Answer: 42
62
63           $ echo "Answer: <%= 2 + n %>" | tilt -t erb --vars="{:n=>40}"
64           Answer: 42
65           $ echo "Answer: <%= 2 + n.to_i %>" | tilt -t erb -Dn=40
66           Answer: 42
67
68
69

SEE ALSO

71       m4(1), mustache(1)
72
73
74
75Tilt 2.0.11                        July 2022                           TILT(1)
Impressum