chore(markdown): Restructuring dev docs
This commit is contained in:
parent
9ef46c502a
commit
d42d9a9377
114 changed files with 246 additions and 1462 deletions
|
@ -1,37 +1,13 @@
|
|||
---
|
||||
title: sprinkle
|
||||
title: "@freesewing/plugin-sprinkle"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-sprinkle)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-sprinkle)
|
||||
The **@freesewing/plugin-sprinkle** plugin provides [the
|
||||
sprinkle macro](/reference/api/macros/sprinkle/) which is a faster way
|
||||
to add several of the same snippets to your designs (think of it as
|
||||
*sprinkling* them onto your parts).
|
||||
|
||||
The **sprinkle** plugin provides [the sprinkle macro](/reference/macros/sprinkle/):
|
||||
|
||||
<Example part="plugin_sprinkle" caption="An example of the sprinkle macro" design={false} />
|
||||
|
||||
```js
|
||||
let { Point, points, macro } = part.shorthand();
|
||||
|
||||
points.a = new Point(10, 10);
|
||||
points.b = new Point(20, 15);
|
||||
points.c = new Point(30, 10);
|
||||
points.d = new Point(40, 15);
|
||||
points.e = new Point(50, 10);
|
||||
points.f = new Point(60, 15);
|
||||
points.g = new Point(70, 10);
|
||||
points.h = new Point(80, 15);
|
||||
points.i = new Point(90, 10);
|
||||
|
||||
macro("sprinkle", {
|
||||
snippet: "button",
|
||||
on: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
|
||||
});
|
||||
```
|
||||
<Example part="plugin_sprinkle">An example of the sprinkle macro</Example>
|
||||
|
||||
<Tip>
|
||||
|
||||
|
@ -47,8 +23,8 @@ npm install @freesewing/plugin-sprinkle
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -58,4 +34,4 @@ import config from "../config";
|
|||
const Pattern = new freesewing.Design(config, sprinkle);
|
||||
```
|
||||
|
||||
Now you can use [the sprinkle macro](/reference/macros/sprinkle/) in your parts.
|
||||
Now you can use the [sprinkle](/reference/api/macros/sprinkle) macro in your parts.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue