You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: v0.3/handbook/libraries/stdlib.md
+38-38Lines changed: 38 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -814,11 +814,11 @@ The canvas library is an interface for drawing graphics in the browser using the
814
814
815
815
<tr>
816
816
<td>
817
-
<ui>
817
+
<ul>
818
818
<li><strong>width</strong> - the width of the canvas in pixels</li>
819
819
<li><strong>height</strong> - the height of the canvas in pixels</li>
820
820
<li><strong>children</strong> - (optional) - paths are written as child records; while optional, without any children, the canvas will be blank</li>
821
-
</ui>
821
+
</ul>
822
822
</td>
823
823
<td><code>// creates a canvas tagged #my-canvas that is 160 pixels wide by 90 pixel tall
824
824
```
@@ -838,7 +838,7 @@ commit
838
838
839
839
<tr>
840
840
<td>
841
-
<ui>
841
+
<ul>
842
842
<li><strong>fillStyle</strong> - (optional) - sets the color, gradient, or pattern used to fill the drawing; if undefined, the default is black</li>
843
843
<li><strong>strokeStyle</strong> - (optional) - sets the color, gradient, or pattern used for the strokes; if undefined, the path will default to a black fill style</li>
844
844
<li><strong>lineWidth</strong> - (optional) - sets the width of strokes in pixels; if undefined, the default is 1px</li>
@@ -857,7 +857,7 @@ commit
857
857
</ul>
858
858
</li>
859
859
<li><strong>children</strong> - (optional) - each individual operation in the path is written as a child record; while optional, without any children, the canvas will be blank</li>
860
-
</ui>
860
+
</ul>
861
861
</td>
862
862
<td><code>// adds a #canvas/path to #my-canvas with a black stroke, a line width of 2 pixels and beveled corners
863
863
```
@@ -884,10 +884,10 @@ commit
884
884
885
885
<tr>
886
886
<td>
887
-
<ui>
887
+
<ul>
888
888
<li><strong>x</strong> - the horizontal coordinate to move to, in pixels</li>
889
889
<li><strong>y</strong> - the vertical coordinate to move to, in pixels</li>
890
-
</ui>
890
+
</ul>
891
891
</td>
892
892
<td><code>// creates a 100x100 canvas and moves the path 20 pixels right and 15 pixels down from the top left corner of the canvas without drawing a line
893
893
```
@@ -909,10 +909,10 @@ commit
909
909
910
910
<tr>
911
911
<td>
912
-
<ui>
912
+
<ul>
913
913
<li><strong>x</strong> - the horizontal coordinate to move to, in pixels</li>
914
914
<li><strong>y</strong> - the vertical coordinate to move to, in pixels</li>
915
-
</ui>
915
+
</ul>
916
916
</td>
917
917
<td><code>// draws a black line from the top left corner of a 100x100 canvas to the center
918
918
```
@@ -934,14 +934,14 @@ commit
934
934
935
935
<tr>
936
936
<td>
937
-
<ui>
937
+
<ul>
938
938
<li><strong>cp1x</strong> - the x coordinate of the first control point</li>
939
939
<li><strong>cp1y</strong> - the y coordinate of the first control point</li>
940
940
<li><strong>cp2x</strong> - the x coordinate of the second control point</li>
941
941
<li><strong>cp2y</strong> - the y coordinate of the second control point</li>
942
942
<li><strong>x</strong> - the x coordinate of the end point</li>
943
943
<li><strong>y</strong> - the y coordinate of the end point</li>
944
-
</ui>
944
+
</ul>
945
945
</td>
946
946
<td><code>// draws a red Bézier curve starting at (20, 25) and ending at (40, 50)
947
947
```
@@ -964,12 +964,12 @@ commit
964
964
965
965
<tr>
966
966
<td>
967
-
<ui>
967
+
<ul>
968
968
<li><strong>cpx</strong> - the x coordinate of the control point</li>
969
969
<li><strong>cpy</strong> - the y coordinate of the control point</li>
970
970
<li><strong>y</strong> - the x coordinate of the end point</li>
971
971
<li><strong>y</strong> - the y coordinate of the end point</li>
972
-
</ui>
972
+
</ul>
973
973
</td>
974
974
<td><code></code>
975
975
</td>
@@ -985,14 +985,14 @@ commit
985
985
986
986
<tr>
987
987
<td>
988
-
<ui>
988
+
<ul>
989
989
<li><strong>y</strong> - the x coordinate of the center of the curve</li>
990
990
<li><strong>y</strong> - the y coordinate of the center of the curve</li>
991
991
<li><strong>radius</strong> - the radius of the curve in pixels</li>
992
992
<li><strong>startAngle</strong> - the starting angle of the curve in radians</li>
993
993
<li><strong>endAngle</strong> - the ending angle of the curve in radians</li>
994
994
<li><strong>anticlockwise</strong> - (optional) - values can be true or false; true draws the arc counterclockwise, false draws the arc clockwise</li>
995
-
</ui>
995
+
</ul>
996
996
</td>
997
997
<td><code>// draws an arc that circumscribes ¾ of a 40 pixel-wide circle in the middle of the canvas
998
998
```
@@ -1014,13 +1014,13 @@ commit
1014
1014
1015
1015
<tr>
1016
1016
<td>
1017
-
<ui>
1017
+
<ul>
1018
1018
<li><strong>x1</strong> - the x coordinate of the starting point of the curve</li>
1019
1019
<li><strong>y1</strong> - the y coordinate of the starting point of the curve</li>
1020
1020
<li><strong>x2</strong> - the x coordinate of the ending point of the curve</li>
1021
1021
<li><strong>y2</strong> - the y coordinate of the ending point of the curve</li>
1022
1022
<li>radius - the radius of the curve in pixels</li>
1023
-
</ui>
1023
+
</ul>
1024
1024
</td>
1025
1025
<td><code>// draws an arc that connects two perpendicular lines with a circular curve
1026
1026
```
@@ -1044,7 +1044,7 @@ commit
1044
1044
1045
1045
<tr>
1046
1046
<td>
1047
-
<ui>
1047
+
<ul>
1048
1048
<li><strong>y</strong> - the x coordinate of the center of the curve</li>
1049
1049
<li><strong>y</strong> - the y coordinate of the center of the curve</li>
1050
1050
<li><strong>radiusX</strong> - the horizontal radius of the curve</li>
@@ -1053,7 +1053,7 @@ commit
1053
1053
<li><strong>startAngle</strong> - the starting angle of the curve in radians</li>
1054
1054
<li><strong>endAngle</strong> - the ending angle of the curve in radians</li>
1055
1055
<li><strong>anticlockwise</strong> - (optional) - values can be true or false; true draws the arc counterclockwise, false draws the arc clockwise</li>
1056
-
</ui>
1056
+
</ul>
1057
1057
</td>
1058
1058
<td><code>// draws a green oval in the center of the canvas that is 20 pixels wide and 30 pixels high
1059
1059
```
@@ -1075,12 +1075,12 @@ commit
1075
1075
1076
1076
<tr>
1077
1077
<td>
1078
-
<ui>
1078
+
<ul>
1079
1079
<li><strong>y</strong> - the x coordinate of the upper left corner of the rectangle</li>
1080
1080
<li><strong>y</strong> - the y coordinate of the upper left corner of the rectangle</li>
1081
1081
<li><strong>width</strong> - the width of the rectangle in pixels</li>
1082
1082
<li><strong>height</strong> - the height of the rectangle in pixels</li>
1083
-
</ui>
1083
+
</ul>
1084
1084
</td>
1085
1085
<td><code>// draws a blue square with black borders in the middle of the canvas
1086
1086
```
@@ -1102,9 +1102,9 @@ commit
1102
1102
1103
1103
<tr>
1104
1104
<td>
1105
-
<ui>
1105
+
<ul>
1106
1106
<li>No arguments</li>
1107
-
</ui>
1107
+
</ul>
1108
1108
</td>
1109
1109
<td><code>// returns the path to (10, 10) from (20, 40) to create a triangle
1110
1110
```
@@ -1135,7 +1135,7 @@ The UI library provides a shorthand for adding standard HTML elements, as well a
1135
1135
1136
1136
<tr>
1137
1137
<td>
1138
-
<ui>
1138
+
<ul>
1139
1139
<li>the <code>#ui</code> tag supports the following html elements:
1140
1140
<ul>
1141
1141
<li><code>#ui/row</code></li>
@@ -1162,7 +1162,7 @@ The UI library provides a shorthand for adding standard HTML elements, as well a
1162
1162
<li><strong>#</strong> - (optional) - any other tags on the record will be applied to the element as classes</li>
1163
1163
<li><strong>class</strong> - (optional) defines one or more classes for the element</li>
1164
1164
<li>Other attributes - (optional) - other attribute-value pairs will be applied directly to the element for integration with existing JS libraries or debugging</li>
1165
-
</ui>
1165
+
</ul>
1166
1166
</td>
1167
1167
<td><code>// commits a div in the browser with the text “Hello world!”
1168
1168
```
@@ -1212,7 +1212,7 @@ commit
1212
1212
1213
1213
<tr>
1214
1214
<td>
1215
-
<ui>
1215
+
<ul>
1216
1216
<li> - (optional) - preset options for class are:
1217
1217
<ul>
1218
1218
<li>“inset” - an inset button style</li>
@@ -1225,7 +1225,7 @@ commit
1225
1225
<li><strong>text</strong> - (optional) - defines text in the button</li>
1226
1226
<li><strong>#</strong> - (optional) - any other tags on the record will be applied to the button as classes</li>
1227
1227
<li>Other attributes - (optional) - other attribute-value pairs will be applied directly to the button for integration with existing JS libraries or debugging</li>
1228
-
</ui>
1228
+
</ul>
1229
1229
</td>
1230
1230
<td><code></code>
1231
1231
</td>
@@ -1241,15 +1241,15 @@ commit
1241
1241
1242
1242
<tr>
1243
1243
<td>
1244
-
<ui>
1244
+
<ul>
1245
1245
<li><strong>completion</strong> - the list of possible responses, given as a subrecord with the attribute “text” whose value is the list; requires the use of a pipe in the #ui record if matching against multiple search records for one autocomplete field</li>
1246
1246
<li><strong>Note</strong>: Once an autocomplete option has been selected, #ui/autocomplete automatically gains a <strong>selected</strong> attribute whose value is the completion record; in the case of the example shown here, the <strong>selected</strong> attribute would be whichever <code>#state</code> record was chosen</li>
1247
1247
<li><strong>placeholder</strong> - (optional) - the placeholder text for the input field</li>
1248
1248
<li><strong>style</strong> - (optional) - specific CSS styles can be defined, but must be entered as a subrecord</li>
1249
1249
<li><strong>#</strong> - (optional) - any other tags on the record will be applied to the autocomplete as classes</li>
1250
1250
<li><strong>class</strong> - (optional) defines one or more classes for the autocomplete</li>
1251
1251
<li>Other attributes - (optional) - other attribute-value pairs will be applied directly to the autocomplete for integration with existing JS libraries or debugging</li>
1252
-
</ui>
1252
+
</ul>
1253
1253
</td>
1254
1254
<td><code>// creates an autocomplete form with the class “birth-state” and the placeholder “Which state were you born in?”, where the autocomplete options are the names of any #state records found
1255
1255
```
@@ -1277,9 +1277,9 @@ commit
1277
1277
1278
1278
<tr>
1279
1279
<td>
1280
-
<ui>
1280
+
<ul>
1281
1281
<li><strong>autocomplete</strong> - the autocomplete element to clear</li>
1282
-
</ui>
1282
+
</ul>
1283
1283
</td>
1284
1284
<td><code>// clears an autocomplete field if it loses focus
1285
1285
```
@@ -1303,9 +1303,9 @@ commit
1303
1303
1304
1304
<tr>
1305
1305
<td>
1306
-
<ui>
1306
+
<ul>
1307
1307
<li><strong>autocomplete</strong> - the autocomplete being opened</li>
1308
-
</ui>
1308
+
</ul>
1309
1309
</td>
1310
1310
<td><code>// changes the font color of the autocomplete input to red when the list is opened; the color will not revert once the menu is closed unless another block is specifically written to do so
1311
1311
```
@@ -1330,9 +1330,9 @@ commit
1330
1330
1331
1331
<tr>
1332
1332
<td>
1333
-
<ui>
1333
+
<ul>
1334
1334
<li><strong>autocomplete</strong> - the autocomplete being closed</li>
1335
-
</ui>
1335
+
</ul>
1336
1336
</td>
1337
1337
<td><code>// changes the font color of the autocomplete input to black when the list is closed; reverts the change in the example for #ui/event/open
1338
1338
```
@@ -1357,9 +1357,9 @@ commit
1357
1357
1358
1358
<tr>
1359
1359
<td>
1360
-
<ui>
1360
+
<ul>
1361
1361
<li><strong>autocomplete</strong> - the autocomplete being closed</li>
1362
-
</ui>
1362
+
</ul>
1363
1363
</td>
1364
1364
<td><code>// as a follow-up to the #ui/autocomplete example, this waits for the user to pick a birth state, then creates a new autocomplete tagged #birth-county to ask which county within that particular state the user was born in
1365
1365
```
@@ -1384,9 +1384,9 @@ commit
1384
1384
1385
1385
<tr>
1386
1386
<td>
1387
-
<ui>
1387
+
<ul>
1388
1388
<li><strong>autocomplete</strong> - the autocomplete whose input field changed</li>
1389
-
</ui>
1389
+
</ul>
1390
1390
</td>
1391
1391
<td><code>// when an autocomplete asking what the magic word is changes to the correct answer, adds the tag #magic-word to the autocomplete
0 commit comments