chore: Port FreeSewing.dev to docusaurus
The replaces the NextJS site powering FreeSewing.dev with a Docusaurus setup. It's part of my efforts to simplify FreeSewing's setup so we can focus on our core value proposition.
This commit is contained in:
parent
497633d1d3
commit
ab3204f9f1
692 changed files with 11037 additions and 20674 deletions
108
sites/dev/docs/reference/plugins/annotations/readme.mdx
Normal file
108
sites/dev/docs/reference/plugins/annotations/readme.mdx
Normal file
|
@ -0,0 +1,108 @@
|
|||
---
|
||||
title: plugin-annotations
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-annotations][1], this plugin provides a
|
||||
variety of snippets, macros, and store methods to annotate designs.
|
||||
|
||||
It is part of [core-plugins](/reference/plugins/core) (so it is available by default).
|
||||
|
||||
## Snippets
|
||||
The annotations plugin provides the following snippets:
|
||||
|
||||
- [bnotch](/reference/snippets/button)
|
||||
- [button](/reference/snippets/button)
|
||||
- [buttonhole](/reference/snippets/button)
|
||||
- [buttonhole-end](/reference/snippets/button)
|
||||
- [buttonhole-start](/reference/snippets/button)
|
||||
- [eyelet](/reference/snippets/eyelet)
|
||||
- [logo](/reference/snippets/logo)
|
||||
- [notch](/reference/snippets/button)
|
||||
- [snap-stud](/reference/snippets/snap-stud)
|
||||
- [snap-socket](/reference/snippets/snap-socket)
|
||||
|
||||
## Macros
|
||||
The annotations plugin provides the following macros:
|
||||
|
||||
- [banner](/reference/macros/banner)
|
||||
- [bannerbox](/reference/macros/bannerbox)
|
||||
- [bartack](/reference/macros/bartack)
|
||||
- [bartackAlong](/reference/macros/bartackalong)
|
||||
- [bartackFractionAlong](/reference/macros/bartackfractionalong)
|
||||
- [crossbox](/reference/macros/crossbox)
|
||||
- [cutonfold](/reference/macros/cutonfold)
|
||||
- [grainline](/reference/macros/grainline)
|
||||
- [hd](/reference/macros/hd)
|
||||
- [ld](/reference/macros/ld)
|
||||
- [rmad](/reference/macros/rmad)
|
||||
- [rmahd](/reference/macros/rmahd)
|
||||
- [rmald](/reference/macros/rmald)
|
||||
- [rmapd](/reference/macros/rmapd)
|
||||
- [rmavd](/reference/macros/rmavd)
|
||||
- [rmbanner](/reference/macros/rmbanner)
|
||||
- [rmbannerbox](/reference/macros/rmbannerbox)
|
||||
- [rmbartack](/reference/macros/rmbartack)
|
||||
- [rmbartackAlong](/reference/macros/rmbartackalong)
|
||||
- [rmbartackFractionAlong](/reference/macros/rmbartackfractionalong)
|
||||
- [rmcrossbox](/reference/macros/rmcrossbox)
|
||||
- [rmcutonfold](/reference/macros/rmcutonfold)
|
||||
- [rmgrainline](/reference/macros/rmgrainline)
|
||||
- [rmahd](/reference/macros/rmahd)
|
||||
- [rmald](/reference/macros/rmald)
|
||||
- [rmapd](/reference/macros/rmapd)
|
||||
- [rmavd](/reference/macros/rmavd)
|
||||
- [rmhd](/reference/macros/rmhd)
|
||||
- [rmld](/reference/macros/rmld)
|
||||
- [rmpd](/reference/macros/rmpd)
|
||||
- [rmvd](/reference/macros/rmvd)
|
||||
- [rmpleat](/reference/macros/rmpleat)
|
||||
- [rmscalebox](/reference/macros/rmscalebox)
|
||||
- [rmsewTogether](/reference/macros/rmsewtogether)
|
||||
- [rmtitle](/reference/macros/rmtitle)
|
||||
- [pd](/reference/macros/pd)
|
||||
- [pleat](/reference/macros/pleat)
|
||||
- [scalebox](/reference/macros/scalebox)
|
||||
- [sewTogether](/reference/macros/sewtogether)
|
||||
- [title](/reference/macros/title)
|
||||
- [vd](/reference/macros/vd)
|
||||
|
||||
## Store methods
|
||||
The annotations plugin also provides store methods:
|
||||
|
||||
- [flag.error()](/reference/store-methods/flag.error)
|
||||
- [flag.fixme()](/reference/store-methods/flag.fixme)
|
||||
- [flag.info()](/reference/store-methods/flag.info)
|
||||
- [flag.note()](/reference/store-methods/flag.note)
|
||||
- [flag.preset()](/reference/store-methods/flag.preset)
|
||||
- [flag.tip()](/reference/store-methods/flag.tip)
|
||||
- [flag.warn()](/reference/store-methods/flag.warn)
|
||||
- [unflag.error()](/reference/store-methods/unflag.error)
|
||||
- [unflag.fixme()](/reference/store-methods/unflag.fixme)
|
||||
- [unflag.info()](/reference/store-methods/unflag.info)
|
||||
- [unflag.note()](/reference/store-methods/unflag.note)
|
||||
- [unflag.preset()](/reference/store-methods/unflag.preset)
|
||||
- [unflag.tip()](/reference/store-methods/unflag.tip)
|
||||
- [unflag.warn()](/reference/store-methods/unflag.warn)
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-annotations
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugin](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { plugin } from '@freesewing/plugin-annotations'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
This plugin is part of the [core-plugins bundle](/reference/plugins/core),
|
||||
so there is no need to install or import it manually unless you wish to forego
|
||||
loading of core plugins yet still want to load this plugin.
|
36
sites/dev/docs/reference/plugins/bin-pack/readme.mdx
Normal file
36
sites/dev/docs/reference/plugins/bin-pack/readme.mdx
Normal file
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
title: plugin-bin-pack
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-bin-pack][1], this plugin provides
|
||||
an optimized [pack()](/reference/store-methods/pack) store method which
|
||||
automatically lays out pattern parts.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-bin-pack
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { packPlugin } from '@freesewing/plugin-bin-pack'
|
||||
// or
|
||||
import { binPackPlugin } from '@freesewing/plugin-bin-pack'
|
||||
// or
|
||||
import { binpackPlugin } from '@freesewing/plugin-bin-pack'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
This plugin is part of the [core-plugins bundle](/reference/plugins/core),
|
||||
so there is no need to install or import it manually unless you wish to forego
|
||||
loading of core plugins yet still want to load this plugin.
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-bin-pack
|
108
sites/dev/docs/reference/plugins/bust/readme.mdx
Normal file
108
sites/dev/docs/reference/plugins/bust/readme.mdx
Normal file
|
@ -0,0 +1,108 @@
|
|||
---
|
||||
title: plugin-bust
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-bust][1], this plugin helps you adapt menswear
|
||||
patterns for people with breasts. If you are designing a womenswear pattern,
|
||||
you won't need this plugin. But if you're adapting a menswear pattern for
|
||||
breasts or merely want to accommodate both people with and without breasts,
|
||||
this plugin can help you accomplish that.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @freesewing/plugin-bust
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { bustPlugin } from '@freesewing/plugin-bust'
|
||||
// or
|
||||
import { pluginBust } from '@freesewing/plugin-bust'
|
||||
```
|
||||
|
||||
To import the plugin and condition method for conditional loading:
|
||||
```js
|
||||
import { withCondition } from '@freesewing/plugin-bust'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
### Understanding the use-case for this plugin
|
||||
|
||||
Almost all menswear patterns use the chest circumference to draft the garment.
|
||||
|
||||
As a person with breasts, using your (full) chest circumference will give you
|
||||
bad fit. Instead, it's better to use your high bust measurement as chest
|
||||
circumference, and then create extra room for the breasts.
|
||||
|
||||
This is the same technique that's used in a full-bust adjustment to fit a
|
||||
womenswear pattern for a person with above-average sized breasts.
|
||||
|
||||
This plugin helps you by:
|
||||
|
||||
- Storing the chest circumference in `measurements.bust`
|
||||
- Changing `measurments.chest` to the value of
|
||||
`measurements.highBust`
|
||||
|
||||
### Use when extending breastless patterns into a with-breasts version
|
||||
|
||||
One way this plugin is used is to extend a menswear pattern into a womenswear
|
||||
pattern. In this case, the plugin will always be loaded since the pattern
|
||||
assumes breasts will be present.
|
||||
|
||||
This way you can extend a menswear pattern and have it drafted with the high
|
||||
bust measurement as chest measurement, after which you can create room for the
|
||||
breasts.
|
||||
|
||||
You can see this in practice in our [Carlita][2] design, which extends the
|
||||
menswear [Carlton][3] design.
|
||||
|
||||
:::note RELATED
|
||||
To learn more about extending a design, see [Part
|
||||
inheritance](/howtos/code/from/)
|
||||
:::
|
||||
|
||||
### Use when creating gender-neutral designs
|
||||
|
||||
To create a truly gender-neutral design — one that will adapt to breasts only
|
||||
if they are present — you can use this plugin, but you'll also need a few other
|
||||
things:
|
||||
|
||||
- You'll need to include and mark the bust measurements, including `highBust`,
|
||||
as [optional
|
||||
measurements](/reference/api/part/config/measurements#optionalmeasurements)
|
||||
- You'll need to [conditionally load this
|
||||
plugin](/reference/api/part/config/plugins#conditional-plugins)
|
||||
- You'll need to create your design such that, when appropriate,
|
||||
it is able to produce the condition to cause the plugin to load
|
||||
|
||||
You can see an example of this in [our Teagan design][4].
|
||||
|
||||
### Condition for loading `withCondition`
|
||||
|
||||
For convenience, `plugin-bust` provides a `withCondition` named export
|
||||
that is a conditional plugin, an `Object` consisting of the plugin
|
||||
along with a condition method.
|
||||
|
||||
The condition is met if both:
|
||||
1. `options.draftForHighBust` is set to `true`
|
||||
2. `measurements.highBust` is set
|
||||
|
||||
You can use `withCondition` to conditionally load `plugin-bust`,
|
||||
or you are free to instead create and use your own condition method
|
||||
to pass along with the plugin.
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-bust
|
||||
|
||||
[2]: https://github.com/freesewing/freesewing/blob/develop/designs/carlita/src/index.mjs#L25
|
||||
|
||||
[3]: https://github.com/freesewing/freesewing/blob/develop/designs/carlton
|
||||
|
||||
[4]: https://github.com/freesewing/freesewing/blob/develop/designs/teagan/src/index.mjs
|
39
sites/dev/docs/reference/plugins/core/readme.mdx
Normal file
39
sites/dev/docs/reference/plugins/core/readme.mdx
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: core-plugins
|
||||
---
|
||||
|
||||
Published as [@freesewing/core-plugins][1], our core plugins bundles the most
|
||||
commonly used FreeSewing plugins in one bundle that is loaded by the core
|
||||
library by default.
|
||||
|
||||
Specifically, loading this plugin will have the same effect as loading these
|
||||
plugins individually:
|
||||
|
||||
|
||||
- [plugin-annotations](/reference/plugins/annotations) : A variety of snippets, macros, and store methods for annotating patterns
|
||||
- [plugin-measurements](/reference/plugins/measurements) : Make extra, calculated measurements available to your patterns
|
||||
- [plugin-mirror](/reference/plugins/mirror) : Mirror points and paths in your patterns
|
||||
- [plugin-round](/reference/plugins/round) : Create rounded corners in your patterns
|
||||
- [plugin-sprinkle](/reference/plugins/sprinkle) : Add multiple snippets to your patterns
|
||||
- [plugin-binpack](https://github.com/freesewing/freesewing/tree/develop/plugins/plugin-bin-pack) : The default bin packing algorithm used to handle auto-generated layouts in core
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @freesewing/core-plugins
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The core plugins are loaded by default so there is nothing to be done to use them.
|
||||
|
||||
If you do not want to load the core plugins, pass `noCorePlugins: true` to your Design constructor:
|
||||
|
||||
```mjs
|
||||
const design = new Design({
|
||||
parts: myParts,
|
||||
noCorePlugins: true
|
||||
})
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/core-plugins
|
29
sites/dev/docs/reference/plugins/flip/readme.mdx
Normal file
29
sites/dev/docs/reference/plugins/flip/readme.mdx
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
title: plugin-flip
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-flip][1], this plugin provides [the flip
|
||||
macro](/reference/macros/flip) which flips (mirrors) an entire part
|
||||
vertically around the Y-axis. It's typically used to create a right and left
|
||||
pattern part from the same basis.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-flip
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { flipPlugin } from '@freesewing/plugin-flip'
|
||||
// or
|
||||
import { pluginFlip } from '@freesewing/plugin-flip'
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-flip
|
32
sites/dev/docs/reference/plugins/gore/readme.mdx
Normal file
32
sites/dev/docs/reference/plugins/gore/readme.mdx
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
title: plugin-gore
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-gore][1], this plugin provides [the gore
|
||||
macro](/reference/macros/gore) which allows you to generate [gore
|
||||
segments](https://en.wikipedia.org/wiki/Gore_\(segment\)); 2D panels to create
|
||||
a spherical shape as used in hats for example.
|
||||
|
||||
This plugin handles all the mathematics to create a (part-)sphere in your
|
||||
designs.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-gore
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { gorePlugin } from '@freesewing/plugin-gore'
|
||||
// or
|
||||
import { pluginGore } from '@freesewing/plugin-gore'
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-gore
|
64
sites/dev/docs/reference/plugins/i18n/readme.mdx
Normal file
64
sites/dev/docs/reference/plugins/i18n/readme.mdx
Normal file
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
title: plugin-i18n
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-i18n][1], this plugin facilitates
|
||||
translation of your designs by allowing you to provide your own
|
||||
language translations.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-i18n
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { i18nPlugin } from '@freesewing/plugin-i18n'
|
||||
// or
|
||||
import { pluginI18n } from '@freesewing/plugin-i18n'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
This plugin provides the mechanism for translation but does not come with
|
||||
translations itself. For this, you can use our [i18n
|
||||
package](https://www.npmjs.com/package/@freesewing/i18n).
|
||||
|
||||
To add your own translations, you will need to pass data to this plugin
|
||||
containing translation keys and the translations for them for each language.
|
||||
The data should be in the form of an `Object` structured as such:
|
||||
|
||||
```js
|
||||
{
|
||||
strings:
|
||||
en: {
|
||||
example: "Example",
|
||||
examplePhrase: "An example phrase",
|
||||
anotherTranslationKey: "(English translation for the translation key)",
|
||||
// More translations can follow...
|
||||
},
|
||||
nl: {
|
||||
example: "Voorbeeld",
|
||||
examplePhrase: "Een voorbeeldzin",
|
||||
anotherTranslationKey: "(Dutch translation for the translation key)",
|
||||
// More translations can follow...
|
||||
},
|
||||
es: {
|
||||
example: "Ejemplo",
|
||||
examplePhrase: "Una frase de ejemplo",
|
||||
anotherTranslationKey: "(Spanish translation for the translation key)",
|
||||
// More translations can follow...
|
||||
},
|
||||
// More languages can follow...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-i18n
|
49
sites/dev/docs/reference/plugins/measurements/readme.mdx
Normal file
49
sites/dev/docs/reference/plugins/measurements/readme.mdx
Normal file
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
title: plugin-measurements
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-measurements][1], this plugin will
|
||||
provide a number of extra measurements to your design insofar as
|
||||
they can be deduced from the measurements that are provided.
|
||||
|
||||
It will add the following measurements:
|
||||
|
||||
- `seatFront` (if both `seat` and `seatBack` are provided)
|
||||
- `seatBackArc` (if both `seat` and `seatBack` are provided)
|
||||
- `seatFrontArc` (if both `seat` and `seatBack` are provided)
|
||||
- `waistFront` (if both `waist` and `waistBack` are provided)
|
||||
- `waistBackArc` (if both `waist` and `waistBack` are provided)
|
||||
- `waistFrontArc` (if both `waist` and `waistBack` are provided)
|
||||
- `crossSeamBack` (if both `crossSeam` and `crossSeamFront` are provided)
|
||||
|
||||
:::note RELATED
|
||||
For more information about these extra measurements, please see
|
||||
[Measurements from `plugin-measurements`](/reference/measurements#measurements-from-plugin-measurements)
|
||||
:::
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-measurements
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { measurementsPlugin } from '@freesewing/plugin-measurements'
|
||||
// or
|
||||
import { pluginMeasurements } from '@freesewing/plugin-measurements'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
This plugin is part of the [core-plugins bundle](/reference/plugins/core),
|
||||
so there is no need to install or import it manually unless you wish to forego
|
||||
loading of core plugins yet still want to load this plugin.
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-measurements
|
34
sites/dev/docs/reference/plugins/mirror/readme.mdx
Normal file
34
sites/dev/docs/reference/plugins/mirror/readme.mdx
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
title: plugin-mirror
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-mirror][1], this plugin provides [the mirror
|
||||
macro](/reference/macros/mirror) which facilitates mirroring a number of
|
||||
points and/or paths around a given mirror line.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-mirror
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { mirrorPlugin } from '@freesewing/plugin-mirror'
|
||||
// or
|
||||
import { pluginMirror } from '@freesewing/plugin-mirror'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
This plugin is part of the [core-plugins bundle](/reference/plugins/core),
|
||||
so there is no need to install or import it manually unless you wish to forego
|
||||
loading of core plugins yet still want to load this plugin.
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-mirror
|
40
sites/dev/docs/reference/plugins/readme.mdx
Normal file
40
sites/dev/docs/reference/plugins/readme.mdx
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
title: Plugins
|
||||
---
|
||||
|
||||
FreeSewing uses a modular approach where functionality can be extended with
|
||||
plugins. Plugins can provide [snippets](/reference/snippets),
|
||||
[macros](/reference/macros), [store methods](/reference/store-methods), or
|
||||
use any of the [lifecycle hooks](/reference/hooks).
|
||||
|
||||
## Using plugins
|
||||
|
||||
Plugins can be either
|
||||
[added to part configurations](/reference/api/part/config/plugins) in designs or
|
||||
[added to a pattern instance with Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import a plugin for use:
|
||||
```js
|
||||
import { plugin } from { @freesewing/plugin-gore }
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
For convenience, each plugin is exported as several names exports:
|
||||
|
||||
- `plugin`
|
||||
- `pluginName`
|
||||
- `namePlugin`
|
||||
|
||||
For example, `@freesewing/plugin-gore` has named exports `plugin`, `pluginGore`, and `gorePlugin` that all are the same thing.
|
||||
|
||||
:::
|
||||
|
||||
## Plugins we maintain
|
||||
|
||||
<ReadMore />
|
||||
|
||||
## Notes
|
||||
|
||||
Refer to [the plugin guide](/guides/plugins) for an in-depth look into
|
||||
plugins.
|
30
sites/dev/docs/reference/plugins/ringsector/readme.mdx
Normal file
30
sites/dev/docs/reference/plugins/ringsector/readme.mdx
Normal file
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: plugin-ringsector
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-ringsector][1], this plugin facilitates
|
||||
drafting a ring sector (like a part of a donut).
|
||||
It is particularly usefor for drafting curved waistband, circle skirts, and so on.
|
||||
|
||||
## Provides
|
||||
|
||||
- [The ringsector macro](/reference/macros/ringsector)
|
||||
- [The rmringsector macro](/reference/macros/rmringsector)
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-ringsector
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You should [add it as a part plugin](/reference/api/part/config/plugins).
|
||||
Refer to the documentation of [the provided macros](#provides) for details on how to use them.
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { plugin as ringsectorPlugin } from '@freesewing/plugin-ringsector'
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-ringsector
|
36
sites/dev/docs/reference/plugins/round/readme.mdx
Normal file
36
sites/dev/docs/reference/plugins/round/readme.mdx
Normal file
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
title: plugin-round
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-round][1], this plugin provides [the round
|
||||
macro](/reference/macros/round) which helps you create rounded corners on your
|
||||
designs.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-round
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
```js
|
||||
import { roundPlugin } from '@freesewing/plugin-round'
|
||||
// or
|
||||
import { pluginRound } from '@freesewing/plugin-round'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
The `round` macro is intended for rounding 90° angles.
|
||||
It does not support rounding other angles/corners.
|
||||
|
||||
This plugin is part of the [core-plugins bundle](/reference/plugins/core),
|
||||
so there is no need to install or import it manually unless you wish to forego
|
||||
loading of core plugins yet still want to load this plugin.
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-round
|
35
sites/dev/docs/reference/plugins/sprinkle/readme.mdx
Normal file
35
sites/dev/docs/reference/plugins/sprinkle/readme.mdx
Normal file
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
title: plugin-sprinkle
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-sprinkle][1], this plugin provides [the
|
||||
sprinkle macro](/reference/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 design).
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-sprinkle
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { sprinklePlugin } from '@freesewing/plugin-sprinkle'
|
||||
// or
|
||||
import { pluginSprinkle } from '@freesewing/plugin-sprinkle'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
This plugin is part of the [core-plugins bundle](/reference/plugins/core),
|
||||
so there is no need to install or import it manually unless you wish to forego
|
||||
loading of core plugins yet still want to load this plugin.
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-sprinkle
|
51
sites/dev/docs/reference/plugins/svgattr/readme.mdx
Normal file
51
sites/dev/docs/reference/plugins/svgattr/readme.mdx
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
title: plugin-svgattr
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-svgattr][1], this plugin takes an object of
|
||||
key-value pairs and adds them as attributes of the `<svg>` tag
|
||||
of a pattern's SVG document on render.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-svgattr
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { svgAttrPlugin } from '@freesewing/plugin-svgattr'
|
||||
// or
|
||||
import { svgattrPlugin } from '@freesewing/plugin-svgattr'
|
||||
// or
|
||||
import { pluginSvgAttr } from '@freesewing/plugin-svgattr'
|
||||
// or
|
||||
import { pluginSvgattr } from '@freesewing/plugin-svgattr'
|
||||
```
|
||||
:::tip
|
||||
For convenience, this plugin is exported
|
||||
under multiple names with variations of capitalization.
|
||||
:::
|
||||
|
||||
## Notes
|
||||
|
||||
To provide the attributes for the `<svg>` tag, you will need to pass a
|
||||
second argument which holds key-value pairs.
|
||||
It should be an `Object` structured as such:
|
||||
|
||||
```js
|
||||
{
|
||||
key1: 'value1',
|
||||
key2: 'value2',
|
||||
key3: 'value3',
|
||||
// More key-value pairs can follow...
|
||||
}
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-svgattr
|
34
sites/dev/docs/reference/plugins/theme/readme.mdx
Normal file
34
sites/dev/docs/reference/plugins/theme/readme.mdx
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
title: plugin-theme
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-theme][1], this plugin provides CSS for
|
||||
your SVG document when rendering to SVG.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-theme
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { themePlugin } from '@freesewing/plugin-theme'
|
||||
// or
|
||||
import { pluginTheme } from '@freesewing/plugin-theme'
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
This plugin will inject CSS in the SVG document when rendering to SVG.
|
||||
|
||||
If you use other ways to render your pattern (using `Pattern.getRenderProps()`)
|
||||
you will need to apply your own styles.
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-theme
|
118
sites/dev/docs/reference/plugins/timing/readme.mdx
Normal file
118
sites/dev/docs/reference/plugins/timing/readme.mdx
Normal file
|
@ -0,0 +1,118 @@
|
|||
---
|
||||
title: plugin-timing
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-timing][1], this plugin measures
|
||||
detailed timing information while drafting a design and adds it to the
|
||||
pattern store.
|
||||
|
||||
It is intended to be used by developers trying to determine which parts
|
||||
of their code are slow, or in general to provide insights into the speed
|
||||
at which a design can be drafted.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-timing
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { timingPlugin } from '@freesewing/plugin-timing'
|
||||
// or
|
||||
import { pluginTiming } from '@freesewing/plugin-timing'
|
||||
```
|
||||
|
||||
## Information in `store`
|
||||
|
||||
The plugin adds the following key/value pairs to the `store` before
|
||||
and after the pattern and parts drafting process.
|
||||
|
||||
| Key | Description |
|
||||
|----------|-------------|
|
||||
| `timing.draft.start` | Timestamp for the start of the pattern drafting process |
|
||||
| `timing.draft.took` | Time it took to draft the pattern |
|
||||
| `timing.parts.[part name].start` | Timestamp for the start of the part drafting process |
|
||||
| `timing.parts.[part name].took` | Time it took to draft the part |
|
||||
|
||||
:::note
|
||||
|
||||
Units and types depend on whether the pattern is generated in a browser
|
||||
or via Node.js.
|
||||
|
||||
- If the pattern is generated in a browser,
|
||||
both start timestamps and draft times are in milliseconds,
|
||||
and the values are Numbers.
|
||||
|
||||
- If the pattern is generated via Node.js,
|
||||
start timestamps are in nanoseconds, draft times are in microseconds,
|
||||
and the values are
|
||||
[BigInts](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt).
|
||||
|
||||
:::
|
||||
|
||||
## Examples
|
||||
|
||||
### Via Node.js
|
||||
|
||||
```js
|
||||
import { Aaron } from '@freesewing/aaron'
|
||||
import { pluginTiming } from '@freesewing/plugin-timing'
|
||||
|
||||
// Load some public test measurements from the FreeSewing backend
|
||||
const measurements = (
|
||||
await (
|
||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
||||
).json()
|
||||
).measurements
|
||||
|
||||
const pattern = new Aaron({ measurements }).use(pluginTiming)
|
||||
|
||||
const svg = pattern.draft().render()
|
||||
|
||||
const patternTook = pattern.setStores[0].get(['timing', 'draft', 'took'])
|
||||
console.log('The Aaron pattern took ' + patternTook + ' µs to draft.')
|
||||
|
||||
const frontTook = pattern.setStores[0].get(['timing', 'parts', 'aaron.front', 'took'])
|
||||
console.log('The aaron.front part took ' + frontTook + ' µs to draft.')
|
||||
|
||||
console.log(JSON.stringify(pattern.setStores[0].timing,
|
||||
(key, value) => typeof value === 'bigint' ? value.toString() : value))
|
||||
```
|
||||
|
||||
### In a browser
|
||||
|
||||
For example, in `designs/aaron/src/back.mjs`:
|
||||
|
||||
```js
|
||||
import { pluginTiming } from '@freesewing/plugin-timing'
|
||||
import { front } from '@freesewing/aaron'
|
||||
|
||||
export const back = {
|
||||
from: front,
|
||||
plugins: [ pluginTiming ],
|
||||
draft: ({
|
||||
store,
|
||||
log,
|
||||
part,
|
||||
...
|
||||
}) => {
|
||||
...
|
||||
|
||||
const frontTook = store.get(['timing', 'parts', 'aaron.front', 'took'])
|
||||
log.info('The aaron.front part took ' + frontTook + ' ms to draft.')
|
||||
|
||||
log.info(JSON.stringify(store.timing))
|
||||
|
||||
return part
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-timing
|
31
sites/dev/docs/reference/plugins/versionfree-svg/readme.mdx
Normal file
31
sites/dev/docs/reference/plugins/versionfree-svg/readme.mdx
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
title: plugin-versionfree-svg
|
||||
---
|
||||
|
||||
Published as [@freesewing/plugin-versionfree-svg][1], this plugin suppresses
|
||||
the inclusion of the FreeSewing version number in SVG output.
|
||||
This allows you to more easily check for differences in the
|
||||
output of different pattern versions of the same design.
|
||||
Without the plugin, false positives could be seen simply due to
|
||||
differing FreeSewing version numbers.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @freesewing/plugin-versionfree-svg
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
||||
design, or [add it to a pattern instance with
|
||||
Pattern.use()](/reference/api/pattern/use).
|
||||
|
||||
To import the plugin for use:
|
||||
```js
|
||||
import { versionfreeSvgPlugin } from '@freesewing/plugin-versionfree-svg'
|
||||
// or
|
||||
import { pluginVersionfreeSvg } from '@freesewing/plugin-versionfree-svg'
|
||||
```
|
||||
|
||||
[1]: https://www.npmjs.com/package/@freesewing/plugin-versionfree-svg
|
Loading…
Add table
Add a link
Reference in a new issue