chore(markdown): Work on macro reference docs
This commit is contained in:
parent
5a68c74330
commit
403f0c45c2
9 changed files with 277 additions and 113 deletions
|
@ -6,39 +6,48 @@ The `bartackAlong` macro allows you to add a _bartack_ marker to your sewing pat
|
|||
More specifically, a bartack along a path.
|
||||
It is provided by the [bartack plugin](/reference/plugins/bartack/).
|
||||
|
||||
<Example part="plugin_bartackalong">
|
||||
Example of the bartackAlong macro
|
||||
</Example>
|
||||
## Signature
|
||||
|
||||
```js
|
||||
points.a = new Point(15, 15)
|
||||
points.b = new Point(20, 20)
|
||||
points.c = new Point(30, 20)
|
||||
points.d = new Point(35, 15)
|
||||
points.e = new Point(20, 10)
|
||||
points.f = new Point(30, 10)
|
||||
|
||||
paths.a = new Path()
|
||||
.move(points.a)
|
||||
.curve(points.b, points.c, points.d)
|
||||
.setRender(false)
|
||||
|
||||
macro('bartackAlong', {
|
||||
path: paths.a
|
||||
})
|
||||
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['e', 'f']
|
||||
macro('banner', {
|
||||
Number angle=0,
|
||||
Number density=3,
|
||||
Number length=15,
|
||||
Path path,
|
||||
String prefix='',
|
||||
String suffix='',
|
||||
Number width=3,
|
||||
})
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
<Example caption="Example of the bartackAlong macro">
|
||||
```js
|
||||
({ Point, Path, macro, part }) => {
|
||||
|
||||
macro('bartackAlong', {
|
||||
path: new Path()
|
||||
.move(new Point(15,15))
|
||||
.curve(
|
||||
new Point(20, 20),
|
||||
new Point(30, 20),
|
||||
new Point(35, 15),
|
||||
)
|
||||
})
|
||||
|
||||
return part
|
||||
}
|
||||
```
|
||||
</Example>
|
||||
|
||||
## Configuration
|
||||
|
||||
| Property | Default | Type | Description |
|
||||
|-------------:|------------|------------|-------------|
|
||||
| `angle` | `0` | `number` | The angle under which to draw the bartack |
|
||||
| `density` | `3` | `number` | Controls how close the stitches are togeter |
|
||||
| `length` | `15` | `number` | Length of the bartack |
|
||||
| `nameFormat` | | `function` | A method that receives the name of the path or point and should return the name for the cloned path and or point |
|
||||
| `path` | | `Path` | The path the bartack should follow |
|
||||
| `prefix` | | `string` | A prefix to apply to the names of the generated path and points |
|
||||
| `suffix` | | `string` | A suffix to apply to the names of the generated path and points |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue