Update scripts

This commit is contained in:
Steve Ruiz 2021-06-27 14:55:48 +01:00
parent 3f4f5e73ae
commit a9a8629ad2
3 changed files with 35 additions and 38 deletions

View file

@ -14,8 +14,8 @@ const rect = new Rectangle({
point: [100, 100],
size: [200, 200],
style: {
color: ColorStyle.Blue
}
color: ColorStyle.Blue,
},
})
rect.x = 300
@ -59,8 +59,8 @@ const myShape = new Rectangle({
style: {
color: ColorStyle.Blue,
size: SizeStyle.Large,
dash: DashStyle.Dotted
}
dash: DashStyle.Dotted,
},
})
\`\`\`
@ -73,7 +73,6 @@ myShape.x = 100
myShape.color = ColorStyle.Red
\`\`\`
You can find more information on each shape class by clicking its name in the list above.
## Controls
@ -82,12 +81,12 @@ In addition to shapes, you can also use code to create controls.
\`\`\`ts
new NumberControl({
label: "x",
value: 0
label: 'x',
value: 0,
})
const myShape = new Rectangle({
point: [controls.x, 0]
point: [controls.x, 0],
})
\`\`\`
@ -103,8 +102,8 @@ Each of these controls is a \`class\`. To create the control, use the following
\`\`\`ts
const control = new TextControl({
label: "myLabel",
value: "my value"
label: 'myLabel',
value: 'my value',
})
\`\`\`
@ -112,13 +111,12 @@ Once you've created a control, you can use its value in your code like this:
\`\`\`ts
const myShape = new Text({
text: controls.myLabel
text: controls.myLabel,
})
\`\`\`
You can find more information on each control class by clicking its name in the list above.
## Shape Classes
...
@ -126,5 +124,6 @@ You can find more information on each control class by clicking its name in the
## Control Classes
...
`,
}

View file

@ -8,7 +8,7 @@
"dev": "next dev",
"format": "prettier --write .",
"lint": "eslint . --ext ts --ext tsx --ext js",
"scripts": "node scripts/type-gen && node scripts/docs-gen && prettier --write './components/code-panel/*'",
"scripts": "prettier --write './state/code/docs.md' && node scripts/type-gen && node scripts/docs-gen && prettier --write './components/code-panel/*'",
"start": "next start",
"test-all": "yarn lint && yarn type-check && yarn test",
"test:update": "jest --updateSnapshot",

View file

@ -5,8 +5,8 @@ const rect = new Rectangle({
point: [100, 100],
size: [200, 200],
style: {
color: ColorStyle.Blue
}
color: ColorStyle.Blue,
},
})
rect.x = 300
@ -50,8 +50,8 @@ const myShape = new Rectangle({
style: {
color: ColorStyle.Blue,
size: SizeStyle.Large,
dash: DashStyle.Dotted
}
dash: DashStyle.Dotted,
},
})
```
@ -64,7 +64,6 @@ myShape.x = 100
myShape.color = ColorStyle.Red
```
You can find more information on each shape class by clicking its name in the list above.
## Controls
@ -73,12 +72,12 @@ In addition to shapes, you can also use code to create controls.
```ts
new NumberControl({
label: "x",
value: 0
label: 'x',
value: 0,
})
const myShape = new Rectangle({
point: [controls.x, 0]
point: [controls.x, 0],
})
```
@ -94,8 +93,8 @@ Each of these controls is a `class`. To create the control, use the following sy
```ts
const control = new TextControl({
label: "myLabel",
value: "my value"
label: 'myLabel',
value: 'my value',
})
```
@ -103,13 +102,12 @@ Once you've created a control, you can use its value in your code like this:
```ts
const myShape = new Text({
text: controls.myLabel
text: controls.myLabel,
})
```
You can find more information on each control class by clicking its name in the list above.
## Shape Classes
...