Skip to content

Commit 6ecb268

Browse files
docs: Icon updates (#334)
* icons: Update documentation for icons. This commit updates the schema documentation for icons to match the icon validation in the community repo. * icons: Update icon usage. This commit updates all examples to use icons that will validate in the community repo.
1 parent d8a4733 commit 6ecb268

File tree

14 files changed

+37
-37
lines changed

14 files changed

+37
-37
lines changed

docs/schema/datetime/example.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_schema():
2121
id = "event_time",
2222
name = "Event Time",
2323
desc = "The time of the event.",
24-
icon = "cog",
24+
icon = "gear",
2525
),
2626
],
2727
)

docs/schema/generated/example.star

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def more_options(pet):
4141
id = "leash",
4242
name = "Leash",
4343
desc = "A toggle to enable a dog leash.",
44-
icon = "cog",
44+
icon = "gear",
4545
default = False,
4646
),
4747
]
@@ -51,7 +51,7 @@ def more_options(pet):
5151
id = "litter-box",
5252
name = "Litter Box",
5353
desc = "A toggle to enable a litter box.",
54-
icon = "cog",
54+
icon = "gear",
5555
default = False,
5656
),
5757
]
@@ -66,7 +66,7 @@ def get_schema():
6666
id = "pet",
6767
name = "Pet Type",
6868
desc = "What type of pet do you have?",
69-
icon = "cog",
69+
icon = "gear",
7070
),
7171
schema.Generated(
7272
id = "generated",

docs/schema/location/example.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_schema():
3333
id = "location",
3434
name = "Location",
3535
desc = "Location for which to display time.",
36-
icon = "place",
36+
icon = "locationDot",
3737
),
3838
],
3939
)

docs/schema/photoselect/example.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_schema():
1717
id = "photo",
1818
name = "Add Photo",
1919
desc = "A photo to display.",
20-
icon = "cog",
20+
icon = "gear",
2121
),
2222
],
2323
)

docs/schema/schema.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The `get_schema` method returns a `schema.Schema` object that contains _fields_.
6464
Next up should be more familiar. We're now passing `config` into `main()`. This is the same for current pixlet scripts that take `config` today. In [Community Apps](https://github.com/tidbyt/community), we will populate the config hashmap with values configured from the mobile app.
6565

6666
## Icons
67-
Each schema field takes an `icon` value. We use the free icons from [Font Awesome](https://fontawesome.com/) with the names camel cased. For example [users-cog](https://fontawesome.com/v5.15/icons/users-cog?style=solid) should be `usersCog` in the `icon` value.
67+
Each schema field takes an `icon` value. We use the free icons from [Font Awesome](https://fontawesome.com/v6/search?s=solid%2Cbrands) at version 6.1.1 with the names camel cased. For example [users-cog](https://fontawesome.com/v6/icons/users-cog?style=solid&s=solid) should be `usersCog` in the `icon` value. When submitting to the community repo, the icon names are validated against this [icon map](https://github.com/tidbyt/community/blob/main/apps/icons.go).
6868

6969
## Dynamic Fields
7070
Pixlet offers two types of fields: basic fields like `Toggle` or `Text` and dynamic fields that take a `handler` method like `LocationBased` or `Typeahead`. For dynamic fields, the `handler` will get called with user inputs. What the handler returns is specific to the field.
@@ -83,7 +83,7 @@ schema.DateTime(
8383
id = "event_time",
8484
name = "Event Time",
8585
desc = "The time of the event.",
86-
icon = "cog",
86+
icon = "gear",
8787
)
8888
```
8989

@@ -149,7 +149,7 @@ def more_options(pet):
149149
id = "leash",
150150
name = "Leash",
151151
desc = "A toggle to enable a dog leash.",
152-
icon = "cog",
152+
icon = "gear",
153153
default = False,
154154
),
155155
]
@@ -159,7 +159,7 @@ def more_options(pet):
159159
id = "litter-box",
160160
name = "Litter Box",
161161
desc = "A toggle to enable a litter box.",
162-
icon = "cog",
162+
icon = "gear",
163163
default = False,
164164
),
165165
]
@@ -178,7 +178,7 @@ schema.Location(
178178
id = "location",
179179
name = "Location",
180180
desc = "Location for which to display time.",
181-
icon = "place",
181+
icon = "locationDot",
182182
)
183183
```
184184

@@ -290,7 +290,7 @@ schema.PhotoSelect(
290290
id = "photo",
291291
name = "Add Photo",
292292
desc = "A photo to display.",
293-
icon = "cog",
293+
icon = "gear",
294294
)
295295
```
296296

@@ -311,7 +311,7 @@ schema.Text(
311311
id = "msg",
312312
name = "Message",
313313
desc = "A message to display.",
314-
icon = "cog",
314+
icon = "gear",
315315
default = "Hello",
316316
)
317317
```
@@ -327,7 +327,7 @@ schema.Toggle(
327327
id = "party_mode",
328328
name = "Party Mode",
329329
desc = "A toggle to enable party mode.",
330-
icon = "cog",
330+
icon = "gear",
331331
default = False,
332332
)
333333
```
@@ -348,7 +348,7 @@ schema.Typeahead(
348348
id = "search",
349349
name = "Search",
350350
desc = "A list of items that match search.",
351-
icon = "cog",
351+
icon = "gear",
352352
handler = search,
353353
)
354354
```

docs/schema/text/example.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_schema():
1818
id = "msg",
1919
name = "Message",
2020
desc = "A message to display.",
21-
icon = "cog",
21+
icon = "gear",
2222
default = "Hello",
2323
),
2424
],

docs/schema/toggle/example.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_schema():
2323
id = "party_mode",
2424
name = "Party Mode",
2525
desc = "A toggle to enable party mode.",
26-
icon = "cog",
26+
icon = "gear",
2727
default = False,
2828
),
2929
],

docs/schema/typeahead/example.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_schema():
3636
id = "search",
3737
name = "Search",
3838
desc = "A list of items that match search.",
39-
icon = "cog",
39+
icon = "gear",
4040
handler = search,
4141
),
4242
],

examples/sunrise.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_schema():
5959
id = "location",
6060
name = "Location",
6161
desc = "Location for which to display time.",
62-
icon = "place",
62+
icon = "locationDot",
6363
),
6464
],
6565
)

schema/datetime_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ t = schema.DateTime(
1818
id = "event_name",
1919
name = "Event Name",
2020
desc = "The time of the event.",
21-
icon = "cog",
21+
icon = "gear",
2222
)
2323
2424
assert(t.id == "event_name")
2525
assert(t.name == "Event Name")
2626
assert(t.desc == "The time of the event.")
27-
assert(t.icon == "cog")
27+
assert(t.icon == "gear")
2828
2929
def main():
3030
return []

schema/location_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ s = schema.Location(
1818
id = "location",
1919
name = "Location",
2020
desc = "Location for which to display time.",
21-
icon = "place",
21+
icon = "locationDot",
2222
)
2323
2424
assert(s.id == "location")
2525
assert(s.name == "Location")
2626
assert(s.desc == "Location for which to display time.")
27-
assert(s.icon == "place")
27+
assert(s.icon == "locationDot")
2828
2929
def main():
3030
return []

schema/photoselect_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ t = schema.PhotoSelect(
1818
id = "photo",
1919
name = "Add Photo",
2020
desc = "A photo.",
21-
icon = "cog",
21+
icon = "gear",
2222
)
2323
2424
assert(t.id == "photo")
2525
assert(t.name == "Add Photo")
2626
assert(t.desc == "A photo.")
27-
assert(t.icon == "cog")
27+
assert(t.icon == "gear")
2828
2929
def main():
3030
return []

schema/schema_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ def get_schema():
4747
id = "locationid",
4848
name = "Location",
4949
desc = "A Location",
50-
icon = "place",
50+
icon = "locationDot",
5151
),
5252
schema.LocationBased(
5353
id = "locationbasedid",
5454
name = "Locationbased",
5555
desc = "A Locationbased",
56-
icon = "place",
56+
icon = "locationDot",
5757
handler = locationbasedhandler,
5858
),
5959
schema.Toggle(
@@ -67,7 +67,7 @@ def get_schema():
6767
id = "textid",
6868
name = "Text",
6969
desc = "A Text",
70-
icon = "cog",
70+
icon = "gear",
7171
default = "Default text",
7272
),
7373
schema.Dropdown(
@@ -136,15 +136,15 @@ def main():
136136
ID: "locationid",
137137
Name: "Location",
138138
Description: "A Location",
139-
Icon: "place",
139+
Icon: "locationDot",
140140
},
141141
{
142142
Type: "locationbased",
143143
ID: "locationbasedid",
144144
Name: "Locationbased",
145145
Description: "A Locationbased",
146146
Handler: "locationbasedhandler",
147-
Icon: "place",
147+
Icon: "locationDot",
148148
},
149149
{
150150
Type: "onoff",
@@ -159,7 +159,7 @@ def main():
159159
ID: "textid",
160160
Name: "Text",
161161
Description: "A Text",
162-
Icon: "cog",
162+
Icon: "gear",
163163
Default: "Default text",
164164
},
165165
{
@@ -251,14 +251,14 @@ def get_schema():
251251
"name": "Location",
252252
"description": "A Location",
253253
"id": "locationid",
254-
"icon": "place",
254+
"icon": "locationDot",
255255
},
256256
{"type": "locationbased",
257257
"id": "locationbasedid",
258258
"name": "Locationbased",
259259
"description": "A Locationbased",
260260
"handler": "locationbasedhandler",
261-
"icon": "place",
261+
"icon": "locationDot",
262262
},
263263
{"type": "onoff",
264264
"id": "onoffid",
@@ -373,15 +373,15 @@ def main():
373373
ID: "locationid",
374374
Name: "Location",
375375
Description: "A Location",
376-
Icon: "place",
376+
Icon: "locationDot",
377377
},
378378
{
379379
Type: "locationbased",
380380
ID: "locationbasedid",
381381
Name: "Locationbased",
382382
Description: "A Locationbased",
383383
Handler: "locationbasedhandler",
384-
Icon: "place",
384+
Icon: "locationDot",
385385
},
386386
{
387387
Type: "onoff",

schema/typeahead_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ t = schema.Typeahead(
3030
id = "search",
3131
name = "Search",
3232
desc = "A list of items that match search.",
33-
icon = "cog",
33+
icon = "gear",
3434
handler = search,
3535
)
3636
3737
assert(t.id == "search")
3838
assert(t.name == "Search")
3939
assert(t.desc == "A list of items that match search.")
40-
assert(t.icon == "cog")
40+
assert(t.icon == "gear")
4141
assert(t.handler("")[0].display == "Grand Central")
4242
4343
def main():

0 commit comments

Comments
 (0)