forked from fastn-stack/ftd.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilt-in-types.ftd
More file actions
166 lines (102 loc) · 3.66 KB
/
built-in-types.ftd
File metadata and controls
166 lines (102 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
\-- ft-core.concept:
-- ft.page-with-toc: Built-in Types
toc: $config.data-toc
sub-sections: $config.doc-header
-- ft.markdown:
`ftd` comes with some built-in types. These types can be used to construct more
complex types like [`record`](/record/) and
[`or-type`](/or-type/).
-- ft.h1: `boolean`
This type is used to represent boolean values `true` and `false`.
-- ft.code:
lang: ftd
\-- boolean is-monday: true
-- ft.markdown:
This type can be "auto-detected" so it's not necessary to specify the type when
declaring a boolean variable.
-- ft.h1: `integer`
This is integer type, can be positive or negative.
-- ft.code:
lang: ftd
\-- integer number-of-days-in-a-week: 7
-- ft.markdown:
This type can be "auto-detected" so it's not necessary to specify the type when
declaring an integer variable.
-- ft.h1: `decimal`
This type is used to represent decimal numbers.
-- ft.code:
lang: ftd
\-- decimal pi: 3.14159
-- ft.markdown:
This type can be "auto-detected" so it's not necessary to specify the type when
declaring a decimal variable.
-- ft.h1: `string`
This is unicode string.
-- ft.code:
lang: ftd
\-- string message: hello world!
-- ft.code: a multi-line string
lang: ftd
\-- string message:
this is a multiline string.
can have any number of lines.
or long paragraph, if you have a long paragraph to write. it can
contain unicode characters in any भाषा, or emojis, 💁👌🎍😍.
-- ft.h1: `caption`
`caption` is a special type, it is an alias for `string`, but can not be used when
declaring a variable.
This type is used for `record`, `or-type` and `component` arguments.
If a `record` or `or-type` field, or `component` argument is defined as `caption`,
it can be passed in the "caption" location in `ftd::p1` "section".
-- ft.code: record with caption
lang: ftd
\-- record person:
name: caption
\-- person amitu: Amit Upadhyay
\-- person shobhit:
name: Shobhit Sharma
-- ft.markdown:
If something is specified as `caption`, it can come in the "caption" location, eg
in case of `amitu` var, or it can come as an explicit key, as in the declaration
of `shobhit` variable.
-- ft.h1: `body`
`body` is a special type, it is an alias for `string`, but can not be used when
declaring a variable.
This type is used for `record`, `or-type` and `component` arguments.
If a `record` or `or-type` field, or `component` argument is defined as `body`,
it can be passed in the "body" location in `ftd::p1` "section".
-- ft.code: record with body
lang: ftd
\-- record person:
name: caption
bio: body
\-- person amitu: Amit Upadhyay
this is single
or multi-line bio of Amit.
\-- person shobhit:
name: Shobhit Sharma
bio: or we can put things in "header"
-- ft.markdown:
If something is specified as `body`, it can come in the "body" location, eg in
case of `amitu` var, or it can come as an explicit key, as in the declaration of
`shobhit` variable.
-- ft.h1: `caption or body`
`caption or body` is a special type, it is an alias for `string`, but can not be
used when declaring a variable.
This type is used for `record`, `or-type` and `component` arguments.
If a `record` or `or-type` field, or `component` argument is defined as `caption
or body`, it can be passed in either the "caption" or "body" location in
`ftd::p1` "section".
-- ft.code: record with caption or body
lang: ftd
\-- record person:
name: caption or body
\-- person amitu: Amit Upadhyay
\-- person shobhit:
name: Shobhit Sharma
\-- person abrar:
Abrar Khan
-- ft.markdown:
If something is specified as `caption or body`, it can come in the "caption"
location, eg in case of `amitu` var, or it can come as an explicit key, as in
the declaration of `shobhit` variable, or in "body" location, eg for `abrar`.