From d988f110626bc6f80e233319e956317c77d90885 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sun, 2 Oct 2022 00:27:09 +0200 Subject: [PATCH] chore(markdown): Updated Plugin docs for v3 --- markdown/dev/reference/plugins/banner/en.md | 35 ++--- markdown/dev/reference/plugins/bartack/en.md | 41 ++---- markdown/dev/reference/plugins/bundle/en.md | 22 ++- markdown/dev/reference/plugins/bust/en.md | 131 +++++++++--------- markdown/dev/reference/plugins/buttons/en.md | 52 +++---- .../dev/reference/plugins/cutonfold/en.md | 36 ++--- .../dev/reference/plugins/dimension/en.md | 47 ++----- markdown/dev/reference/plugins/en.md | 11 +- .../dev/reference/plugins/export-dxf/en.md | 45 ------ markdown/dev/reference/plugins/flip/en.md | 27 ++-- markdown/dev/reference/plugins/gore/en.md | 28 ++-- .../dev/reference/plugins/grainline/en.md | 34 ++--- markdown/dev/reference/plugins/i18n/en.md | 40 +++--- markdown/dev/reference/plugins/logo/en.md | 34 ++--- .../dev/reference/plugins/measurements/en.md | 26 ++-- markdown/dev/reference/plugins/mirror/en.md | 33 ++--- markdown/dev/reference/plugins/notches/en.md | 37 ++--- markdown/dev/reference/plugins/round/en.md | 46 ++---- markdown/dev/reference/plugins/scalebox/en.md | 49 +++---- markdown/dev/reference/plugins/sprinkle/en.md | 35 ++--- markdown/dev/reference/plugins/svgattr/en.md | 28 ++-- markdown/dev/reference/plugins/theme/en.md | 40 +++--- markdown/dev/reference/plugins/title/en.md | 33 ++--- .../reference/plugins/versionfree-svg/en.md | 25 ++-- 24 files changed, 329 insertions(+), 606 deletions(-) delete mode 100644 markdown/dev/reference/plugins/export-dxf/en.md diff --git a/markdown/dev/reference/plugins/banner/en.md b/markdown/dev/reference/plugins/banner/en.md index dad2f2f36cf..b3769c789d7 100644 --- a/markdown/dev/reference/plugins/banner/en.md +++ b/markdown/dev/reference/plugins/banner/en.md @@ -1,20 +1,10 @@ --- -title: "@freesewing/plugin-banner" +title: plugin-banner --- -The **@freesewing/plugin-banner** plugin provides -[the banner macro](/reference/api/macros/banner). -This macro allows you to add repeating text along a path. - -## Example - -Example of the banner macro provided by this plugin - - - -The banner plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-banner][1], this plugin provides [the banner +macro](/reference/api/macros/banner) which allows you to add repeating text +along a path. ## Installation @@ -24,16 +14,13 @@ npm install @freesewing/plugin-banner ## Usage -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: +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 freesewing from "@freesewing/core"; -import banner from "@freesewing/plugin-banner"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, banner); -``` +The banner plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-banner -Now you can use the -[banner](/reference/api/macros/banner/) macros in your parts. diff --git a/markdown/dev/reference/plugins/bartack/en.md b/markdown/dev/reference/plugins/bartack/en.md index 736eb8effae..364fdd9b70b 100644 --- a/markdown/dev/reference/plugins/bartack/en.md +++ b/markdown/dev/reference/plugins/bartack/en.md @@ -1,21 +1,13 @@ --- -title: "@freesewing/plugin-bartack" +title: plugin-bartack --- -The **@freesewing/plugin-bartack** plugin provides -[the bartack macro](/reference/api/macros/bartack). -This macro allows you to add bartacks — a set of -tight zig-zag stitches used to enforce a seam — to your design. - -## Example - -Example of the bartack macro provided by this plugin - - - -The bartack plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-bartack][1], this plugin provides +the [bartack](/reference/api/macros/bartack), +[bartackAlong](/reference/api/macros/bartackalong), and +the [bartackFractionAlong](/reference/api/macros/bartack) macros +which allows you to add bartacks — a set +of tight zig-zag stitches used to enforce a seam — to your design. ## Installation @@ -25,18 +17,13 @@ npm install @freesewing/plugin-bartack ## Usage -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: +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 freesewing from "@freesewing/core"; -import bartack from "@freesewing/plugin-bartack"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, bartack); -``` +The bartack plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-bartack -Now you can use the -[bartack](/reference/api/macros/bartack/), -[bartackAlong](/reference/api/macros/bartackalong/), and -[bartackFractionAlong](/reference/api/macros/bartackfractionalong/) macros in your parts. diff --git a/markdown/dev/reference/plugins/bundle/en.md b/markdown/dev/reference/plugins/bundle/en.md index d2767f10264..56dc20a977f 100644 --- a/markdown/dev/reference/plugins/bundle/en.md +++ b/markdown/dev/reference/plugins/bundle/en.md @@ -1,8 +1,12 @@ --- -title: "@freesewing/plugin-bundle" +title: plugin-bundle --- -The **@freesewing/plugin-bundle** plugin bundles the most common FreeSewing build-time plugins: +Published as [@freesewing/plugin-bundle][1], this plugin bundles the most +commonly used FreeSewing time plugins in one handy package. + +Specifically, loading this plugin will have the same effect as loading these +plugins individually: - [plugin-banner](/reference/plugins/banner) : Add repeating text to your patterns - [plugin-bartack](/reference/plugins/bartack) : Add bartacks to your patterns @@ -19,8 +23,6 @@ The **@freesewing/plugin-bundle** plugin bundles the most common FreeSewing buil - [plugin-sprinkle](/reference/plugins/sprinkle) : Add multiple snippets to your patterns - [plugin-title](/reference/plugins/title) : Add pretty titles to your pattern parts -Almost all patterns use these plugins, so it made sense to bundle them. - ## Installation ```bash @@ -29,13 +31,7 @@ npm install @freesewing/plugin-bundle ## Usage -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: +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 freesewing from "@freesewing/core"; -import plugins from "@freesewing/plugin-bundle"; -import config from "../config"; - -const Pattern = new freesewing.Design(config, plugins); -``` diff --git a/markdown/dev/reference/plugins/bust/en.md b/markdown/dev/reference/plugins/bust/en.md index 663a20a2d42..195218003e3 100644 --- a/markdown/dev/reference/plugins/bust/en.md +++ b/markdown/dev/reference/plugins/bust/en.md @@ -1,62 +1,12 @@ --- -title: "@freesewing/plugin-bust" +title: plugin-bust --- -The **@freesewing/plugin-bust** plugin helps you adapt menswear patterns for 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 accomodate both people with and without -breasts, this plugin can help you accomplish that. - - - -##### 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.chestCircumference` 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 measurment, after which you can create room for the breasts. - -You can see this in practice in our [Carlita][1] pattern, -which extends the menswear [Carlton][2] pattern. - - - -To learn more about extending a pattern, see [Design inheritance](/howtos/code/inheritance/) - - - -## Use when creating gender-neutral patterns - -To create a truly gender-neutral pattern — 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 mark the breast measurements as [optional measurements](/reference/api/config/optionalmeasurements) -- You'll need to [conditionally load this plugin](/guides/plugins/conditionally-loading-build-time-plugins) - -You can see an example of this in [our Teagan design][3]. - - - -**TODO**: Write a tutorial on gender-neutral desing - - +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 accomodate both people with and without breasts, +this plugin can help you accomplish that. ## Installation @@ -66,19 +16,66 @@ npm install @freesewing/plugin-bust ## Usage -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: +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 freesewing from "@freesewing/core"; -import bust from "@freesewing/plugin-bust"; -import config from "../config"; -const Pattern = new freesewing.Design(config, bust); -``` +## Notes -[1]: https://github.com/freesewing/freesewing/blob/develop/designs/carlita/src/index.js#L12 +### Understanding the use-case for this plugin -[2]: https://github.com/freesewing/freesewing/blob/develop/designs/carlton +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.chestCircumference` 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 measurment, after which you can create room for the +breasts. + +You can see this in practice in our [Carlita][2] pattern, which extends the +menswear [Carlton][3] pattern. + + +To learn more about extending a pattern, see [Design +inheritance](/howtos/code/inheritance/) + + +### Use when creating gender-neutral patterns + +To create a truly gender-neutral pattern — 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 mark the breast measurements as [optional + measurements](/reference/api/config/optionalmeasurements) +- You'll need to [conditionally load this + plugin](/guides/plugins/conditionally-loading-build-time-plugins) + +You can see an example of this in [our Teagan design][4]. + +[1]: https://www.npmjs.com/package/@freesewing/plugin-banner + +[2]: https://github.com/freesewing/freesewing/blob/develop/designs/carlita/src/index.js#L12 + +[3]: https://github.com/freesewing/freesewing/blob/develop/designs/carlton + +[4]: https://github.com/freesewing/freesewing/blob/develop/designs/teagan/src/index.js -[3]: https://github.com/freesewing/freesewing/blob/develop/designs/teagan/src/index.js diff --git a/markdown/dev/reference/plugins/buttons/en.md b/markdown/dev/reference/plugins/buttons/en.md index c5e8b931220..f14337ee648 100644 --- a/markdown/dev/reference/plugins/buttons/en.md +++ b/markdown/dev/reference/plugins/buttons/en.md @@ -1,50 +1,32 @@ --- -title: "@freesewing/plugin-buttons" +title: plugin-buttons --- -The **@freesewing/plugin-buttons** plugin provides the following [snippets](/reference/api/snippets): +Published as [@freesewing/plugin-buttons][1], this plugin provides the following +[snippets](/reference/snippets): -- [button](/reference/api/snippets/button) -- [buttonhole](/reference/api/snippets/buttonhole) -- [buttonhole-start](/reference/api/snippets/buttonhole-start) -- [buttonhole-end](/reference/api/snippets/buttonhole-end) -- [snap-stud](/reference/api/snippets/snap-stud) -- [snap-socket](/reference/api/snippets/snap-socket) - - -An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets - - - - -The buttons plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +- [button](/reference/snippets/button) +- [buttonhole](/reference/snippets/buttonhole) +- [buttonhole-start](/reference/snippets/buttonhole-start) +- [buttonhole-end](/reference/snippets/buttonhole-end) +- [snap-stud](/reference/snippets/snap-stud) +- [snap-socket](/reference/snippets/snap-socket) ## Installation -```bash +```sh npm install @freesewing/plugin-buttons ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import buttons from "@freesewing/plugin-buttons"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, buttons); -``` +The buttons plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-buttons -Now you can use the -[button](/reference/api/snippets/button), -[buttonhole](/reference/api/snippets/buttonhole), -[buttonhole-start](/reference/api/snippets/buttonhole-start), -[buttonhole-end](/reference/api/snippets/buttonhole-end), -[snap-stud](/reference/api/snippets/snap-stud), and -[snap-socket](/reference/api/snippets/snap-socket) -snippets in your designs. diff --git a/markdown/dev/reference/plugins/cutonfold/en.md b/markdown/dev/reference/plugins/cutonfold/en.md index 7d912373bce..2dfd7404c1d 100644 --- a/markdown/dev/reference/plugins/cutonfold/en.md +++ b/markdown/dev/reference/plugins/cutonfold/en.md @@ -1,40 +1,26 @@ --- -title: "@freesewing/plugin-cutonfold" +title: plugin-cutonfold --- -The **@freesewing/plugin-cutonfold** plugin provides -[the cutonfold macro](/reference/api/macros/cutonfold) which adds a cut-on-fold +Published as [@freesewing/plugin-cutonfold][1], this plugin provides [the +cutonfold macro](/reference/api/macros/cutonfold) which adds a cut-on-fold indicator to your design. - - -An example of the cutonfold macro - - - - - -The cutonfold plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - - ## Installation -```bash +```sh npm install @freesewing/plugin-cutonfold ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import cutonfold from "@freesewing/plugin-cutonfold"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, cutonfold); -``` +The cutonfold plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-cutonfold -Now you can use [the cutonfold macro](/reference/api/macros/cutonfold/) in your parts. diff --git a/markdown/dev/reference/plugins/dimension/en.md b/markdown/dev/reference/plugins/dimension/en.md index f40a713dea5..86d297c2ce7 100644 --- a/markdown/dev/reference/plugins/dimension/en.md +++ b/markdown/dev/reference/plugins/dimension/en.md @@ -1,13 +1,9 @@ --- -title: "@freesewing/plugin-dimension" +title: plugin-dimension --- -The **@freesewing/plugin-dimension** plugin provides a variety of macros -to facilitate adding _dimensions_ to your design. By _dimensions_ we mean -the indicators for distance that are added to patterns -in [paperless mode](/reference/api/settings/paperless). - -The following macors are provided by this plugin: +Published as [@freesewing/plugin-dimension][1], this plugin provides the +following macros: - [hd](/reference/api/macros/hd) : Adds a horizontal dimension - [vd](/reference/api/macros/vd) : Adds a vertical dimension @@ -16,42 +12,21 @@ The following macors are provided by this plugin: - [rmd](/reference/api/macros/rmd) : Removes a dimension - [rmad](/reference/api/macros/rmad) : Removes all dimensions with a default prefix - - -An example of the different dimensinon macros - - - - - -The dimension plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - - ## Installation -```bash +```sh npm install @freesewing/plugin-dimension ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import dimension from "@freesewing/plugin-dimension"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, dimension); -``` +The dimension plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-dimension -Now you can use the -[hd](/reference/api/macros/hd/), -[vd](/reference/api/macros/vd/), -[ld](/reference/api/macros/ld/), -[pd](/reference/api/macros/pd/), -[rmd](/reference/api/macros/rmd/), and -[rmad](/reference/api/macros/rmad/) -macros in your parts. diff --git a/markdown/dev/reference/plugins/en.md b/markdown/dev/reference/plugins/en.md index 318d8d7d345..3ba1760d1ad 100644 --- a/markdown/dev/reference/plugins/en.md +++ b/markdown/dev/reference/plugins/en.md @@ -3,9 +3,14 @@ title: Plugins --- FreeSewing uses a modular approach where functionality can be extended with -plugins. Plugins can provide macros, or use any of the lifecycle hooks. -Refer to [the plugin guide](/guides/plugins) for an in-depth look into plugins. +plugins. Plugins can provide macros, store methods, or use any of the lifecycle +hooks. -We maintain the following plugins for @freesewing/core: +We maintain the following plugins: + +## Notes + +Refer to [the plugin guide](/guides/plugins) for an in-depth look into +plugins. diff --git a/markdown/dev/reference/plugins/export-dxf/en.md b/markdown/dev/reference/plugins/export-dxf/en.md deleted file mode 100644 index 8d09b4189e2..00000000000 --- a/markdown/dev/reference/plugins/export-dxf/en.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: "@freesewing/plugin-export-dxf" ---- - -The **@freesewing/plugin-export-dxf** plugin exports your pattern -to [the DXF file format](https://en.wikipedia.org/wiki/AutoCAD_DXF). -It will attach the [the postDraft lifecycle -hook](/reference/api/hooks/postdraft) to add a `renderDxf()` method -to the pattern object. - - - -##### This is de-facto unmaintained - -This plugin is de-facto unmaintained because I have no use for it. -I keep it around in case it might be useful, and I've used it -myself for exporting to different software. - -The being said, DXF is a poor choice as a file format for storing sewing patterns. -For one thing, it only allows straight lines, no curves. Yikes! - - - -## Installation - -```sh -npm install @freesewing/plugin-export-dxf -``` - -## Usage - -Like all [run-time plugins](/guides/plugins/types-of-plugins#run-time-plugins), you -load them by by passing them to the `use()` method of an instatiated pattern. - -That method is chainable, so if you have multiple plugins you can just chain them together. - -```js -import Aaron from "@freesewing/aaron"; -import theme from "@freesewing/plugin-theme"; - -const pattern = new Aaron().use(theme); -``` - -After calling `pattern.draft()` you will be able to call `pattern.renderDxf()` -which will return the Dxf output. diff --git a/markdown/dev/reference/plugins/flip/en.md b/markdown/dev/reference/plugins/flip/en.md index 0fb5658d5b3..19374d20b9a 100644 --- a/markdown/dev/reference/plugins/flip/en.md +++ b/markdown/dev/reference/plugins/flip/en.md @@ -1,30 +1,23 @@ --- -title: "@freesewing/plugin-flip" +title: plugin-flip --- -The **@freesewing/plugin-flip** plugin provides [the flip -macro](/reference/apis/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. +Published as [@freesewing/plugin-flip][1], this plugin provides [the flip +macro](/reference/api/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 -```bash +```sh npm install @freesewing/plugin-flip ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import flip from "@freesewing/plugin-flip"; -import config from "../config"; +[1]: https://www.npmjs.com/package/@freesewing/plugin-flip -const Pattern = new freesewing.Design(config, flip); -``` - -Now you can use [the flip macro](/reference/api/macros/flip) in your parts. diff --git a/markdown/dev/reference/plugins/gore/en.md b/markdown/dev/reference/plugins/gore/en.md index 7a35f8cd8d0..1660ae6cf32 100644 --- a/markdown/dev/reference/plugins/gore/en.md +++ b/markdown/dev/reference/plugins/gore/en.md @@ -2,15 +2,13 @@ title: "@freesewing/plugin-gore" --- -The **@freesewing/plugin-gore** plugin provides -[the gore macro](/reference/api/macros/gore). -This macro allows you to generate [gore -segments](https://en.wikipedia.org/wiki/Gore_\(segment\)) — -2D panels to create a sphehrical shape as used in hats for example — -to your design. +Published as [@freesewing/plugin-gore][1], this plugin provides [the gore +macro](/reference/api/macros/gore) which allows you to generate [gore +segments](https://en.wikipedia.org/wiki/Gore_\(segment\)); 2D panels to create +a sphehrical shape as used in hats for example. -You'll be happy to hear that this plugin handles all the -mathematics for you to create a (part-)sphere in your patterns. +This plugin handles all the mathematics to create a (part-)sphere in your +patterns. ## Installation @@ -20,15 +18,9 @@ npm install @freesewing/plugin-gore ## Usage -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: +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 freesewing from "@freesewing/core"; -import gore from "@freesewing/plugin-gore"; -import config from "../config"; +[1]: https://www.npmjs.com/package/@freesewing/plugin-gore -const Pattern = new freesewing.Design(config, gore); -``` - -Now you can use the [gore](/reference/api/macros/gore) macro in your parts. diff --git a/markdown/dev/reference/plugins/grainline/en.md b/markdown/dev/reference/plugins/grainline/en.md index 284f53e01f9..e73a870066c 100644 --- a/markdown/dev/reference/plugins/grainline/en.md +++ b/markdown/dev/reference/plugins/grainline/en.md @@ -1,36 +1,26 @@ --- -title: "@freesewing/plugin-grainline" +title: plugin-grainline --- -The **@freesewing/plugin-grainline** plugin provides [the grainline -macro](/reference/macros/grainline/) which adds a _grainline_ indicator -to your design. - -An example of the grainline macro - - - -The grainline plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-grainline][1], this plugin provides [the +grainline macro](/reference/api/macros/grainline) which adds a _grainline_ +indicator to your design. ## Installation -```bash +```sh npm install @freesewing/plugin-grainline ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import grainline from "@freesewing/plugin-grainline"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, grainline); -``` +The grainline plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-grainline -Now you can use [the grainline macro](/reference/api/macros/grainline) in your parts. diff --git a/markdown/dev/reference/plugins/i18n/en.md b/markdown/dev/reference/plugins/i18n/en.md index 1280c74c46d..b495aa5a175 100644 --- a/markdown/dev/reference/plugins/i18n/en.md +++ b/markdown/dev/reference/plugins/i18n/en.md @@ -1,40 +1,29 @@ --- -title: "@freesewing/plugin-i18n" +title: plugin-i18n --- -The **@freesewing/plugin-i18n** plugin provides a mechanism to translate your designs. -It does that by attaching to [the insertText lifecycle hook](/reference/api/hooks/inserttext) to -intercept all operations that add text to a design and attempt to translate the text -prior to insertion. - - - -This plugin provides the mechanism for translation, but does not come with translations itself. -For this, you can use our [i18n package](/reference/packages/i18n). - - +Published as [@freesewing/plugin-i18n][1], this plugin faciliates +translation of your designs. ## Installation -```bash +```sh npm install @freesewing/plugin-i18n ``` ## 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: +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 aaron from "@freesewing/aaron"; -import i18n from "@freesewing/plugin-i18n"; -import translations from "@freesewing/i18n"; +## Notes -const pattern = new aaron() - .use(i18nPlugin, { strings: translations }); -``` +This plugin provides the mechanism for translation, but does not come with +translations itself. For this, you can use our [i18n +package](/reference/packages/i18n). -You should also pass a second argument which holds your translations. +To add (your own) translations, you should pass data to this plugin. It should be structured as such: ```js @@ -50,3 +39,8 @@ It should be structured as such: } } ``` + +The i18n plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-i18n + diff --git a/markdown/dev/reference/plugins/logo/en.md b/markdown/dev/reference/plugins/logo/en.md index 8cbe03cee0a..de9d1187dca 100644 --- a/markdown/dev/reference/plugins/logo/en.md +++ b/markdown/dev/reference/plugins/logo/en.md @@ -1,37 +1,25 @@ --- -title: "@freesewing/plugin-logo" +title: plugin-logo --- -The **@freesewing/plugin-logo** plugin provides the FreeSewing logo -as [the logo snippet](/reference/api/snippets/logo). -It's a plugin you most likely want to replace with your own version -if you want to generate patterns with your own branding. - -An example of the logo snippet - - - -The logo plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-logo][1], this plugin provides [the logo +macro](/reference/api/macros/logo) which adds FreeSewing's logo to your +design. ## Installation -```bash +```sh npm install @freesewing/plugin-logo ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import logo from "@freesewing/plugin-logo"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, logo); -``` +The logo plugin is part of our [plugin-bundle](/reference/plugins/bundle) -You can now use the [logo](/reference/api/snippets/logo) snippet in your parts. +[1]: https://www.npmjs.com/package/@freesewing/plugin-logo diff --git a/markdown/dev/reference/plugins/measurements/en.md b/markdown/dev/reference/plugins/measurements/en.md index 71edab00a81..f629a2948bd 100644 --- a/markdown/dev/reference/plugins/measurements/en.md +++ b/markdown/dev/reference/plugins/measurements/en.md @@ -1,9 +1,8 @@ --- -title: "@freesewing/plugin-measurements" +title: plugin-measurements --- -The **@freesewing/plugin-measurements** plugin attaches -to [the preDraft lifecycle hook](/reference/api/hooks/predraft) to +Published as [@freesewing/plugin-measurements][1], this plugin will provide a number of extra measurements to your pattern insofar as they can be deduced from the measurements that are provided. @@ -17,12 +16,6 @@ It will add the following measurements: - `waistFrontArc` (if both `waist` and `waistBack` are provided) - `crossSeamBack` (if both `crossSeam` and `crossSeamFront` are available) - - -The measurements plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - - ## Installation ```sh @@ -31,13 +24,12 @@ npm install @freesewing/plugin-measurements ## Usage -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: +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 freesewing from "@freesewing/core"; -import measurements from "@freesewing/plugin-measurements"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, measurements); -``` +The measurements plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-measurements diff --git a/markdown/dev/reference/plugins/mirror/en.md b/markdown/dev/reference/plugins/mirror/en.md index 70a2fd556de..2b174be9aeb 100644 --- a/markdown/dev/reference/plugins/mirror/en.md +++ b/markdown/dev/reference/plugins/mirror/en.md @@ -1,36 +1,25 @@ --- -title: "@freesewing/plugin-mirror" +title: plugin-mirror --- -The **@freesewing/plugin-mirror** plugin provides [the mirror -macro](/reference/api/macros/mirror) which facilitates mirroring -a number of points and/or paths around a given mirror line. - -Example of the mirror plugin - - - -The mirror plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-mirror][1], this plugin provides [the mirror +macro](/reference/api/macros/mirror) which facilitates mirroring a number of +points and/or paths around a given mirror line. ## Installation -```bash +```sh npm install @freesewing/plugin-mirror ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import mirror from "@freesewing/plugin-mirror"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, mirror); -``` +The mirror plugin is part of our [plugin-bundle](/reference/plugins/bundle) -You can now use the [mirror](/reference/api/macros/mirror) macro in your parts. +[1]: https://www.npmjs.com/package/@freesewing/plugin-mirror diff --git a/markdown/dev/reference/plugins/notches/en.md b/markdown/dev/reference/plugins/notches/en.md index e35b7029e0c..9c3bd6d8656 100644 --- a/markdown/dev/reference/plugins/notches/en.md +++ b/markdown/dev/reference/plugins/notches/en.md @@ -2,41 +2,24 @@ title: "@freesewing/plugin-notches" --- -The **@freesewing/plugin-notches** plugin provides the following [snippets](/reference/api/snippets): - -- [notch](/reference/api/snippets/notch) -- [bnotch](/reference/api/snippets/bnotch) - - -An example of the notch and bnotch snippets - - - - -The notches plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-notches][1], this plugin provides the +[notch](/reference/api/snippets/notch) and +[bnotch](/reference/api/snippets/bnotch) snippets. ## Installation -```bash +```sh npm install @freesewing/plugin-notches ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import notches from "@freesewing/plugin-notches"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, notches); -``` +The notches plugin is part of our [plugin-bundle](/reference/plugins/bundle) -Now you can use the -[notch](/reference/api/snippets/notch) and -[bnotch](/reference/api/snippets/buttonhole) -snippets in your designs. +[1]: https://www.npmjs.com/package/@freesewing/plugin-notches diff --git a/markdown/dev/reference/plugins/round/en.md b/markdown/dev/reference/plugins/round/en.md index d0e744364ee..7edb793374d 100644 --- a/markdown/dev/reference/plugins/round/en.md +++ b/markdown/dev/reference/plugins/round/en.md @@ -1,45 +1,29 @@ --- -title: "@freesewing/plugin-round" +title: plugin-round --- -The **@freesewing/plugin-round** plugin provides [the -round macro](/reference/api/macros/round) which helps you round -corners on your designs. - - - -##### Straight corners only - -The round macro is intended for rounding 90° angles. -It does not support rounding other angles/corners. - - - -An example of the round macro - - - -The round plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-round][1], this plugin provides [the round +macro](/reference/api/macros/round) which helps you round corners on your +designs. ## Installation -```bash +```sh npm install @freesewing/plugin-round ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import round from "@freesewing/plugin-round"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, round); -``` +The round macro is intended for rounding 90° angles. +It does not support rounding other angles/corners. + +The round plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-round -Now you can use [the round macro](/reference/macros/round/): in your parts. diff --git a/markdown/dev/reference/plugins/scalebox/en.md b/markdown/dev/reference/plugins/scalebox/en.md index 300edc8b6cc..ac7d8449533 100644 --- a/markdown/dev/reference/plugins/scalebox/en.md +++ b/markdown/dev/reference/plugins/scalebox/en.md @@ -2,46 +2,31 @@ title: "@freesewing/plugin-scalebox" --- -The **@freesewing/plugin-scalebox** plugin provides [the -scalebox macro](/reference/api/macros/scalebox/) with facilitates -adding a scalebox to your design, so users can verify that the pattern -is printed at the correct scale. - -An example of the scalebox - - - -##### FreeSewing branding can be overruled at runtime - -This plugin by default includes FreeSewing branding, but you can -override that when calling the scalebox macro in case you want to -generate your own branded designs. - - - - - -The scalebox plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-scalebox][1], this plugin provides the +[scalebox](/reference/api/macros/scalebox) and +[miniscale](/reference/api/macros/miniscale) macros which add a (mini) scalebox +to your design, so users can verify that the pattern is printed at the correct +scale. ## Installation -```bash +```sh npm install @freesewing/plugin-scalebox ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import scalebox from "@freesewing/plugin-scalebox"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, scalebox); -``` +This plugin by default includes FreeSewing branding, but you can +override that when calling the scalebox macro in case you want to +generate your own branded designs. + +The scalebox plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-scalebox -Now you can use the [scalebox](/reference/api/macros/scalebox/) macro in your parts. diff --git a/markdown/dev/reference/plugins/sprinkle/en.md b/markdown/dev/reference/plugins/sprinkle/en.md index c4daded278b..5fa692f5946 100644 --- a/markdown/dev/reference/plugins/sprinkle/en.md +++ b/markdown/dev/reference/plugins/sprinkle/en.md @@ -1,37 +1,26 @@ --- -title: "@freesewing/plugin-sprinkle" +title: plugin-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). - -An example of the sprinkle macro - - - -The sprinkle plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-sprinkle][1], this 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 design). ## Installation -```bash +```sh npm install @freesewing/plugin-sprinkle ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import sprinkle from "@freesewing/plugin-sprinkle"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, sprinkle); -``` +The sprinkle plugin is part of our [plugin-bundle](/reference/plugins/bundle) -Now you can use the [sprinkle](/reference/api/macros/sprinkle) macro in your parts. +[1]: https://www.npmjs.com/package/@freesewing/plugin-sprinkle diff --git a/markdown/dev/reference/plugins/svgattr/en.md b/markdown/dev/reference/plugins/svgattr/en.md index 2a09abc592e..bee8174e5e5 100644 --- a/markdown/dev/reference/plugins/svgattr/en.md +++ b/markdown/dev/reference/plugins/svgattr/en.md @@ -1,29 +1,27 @@ --- -title: "@freesewing/plugin-svgattr" +title: plugin-svgattr --- -The **@freesewing/plugin-svgattr** plugin takes an object of key-value -pairs and adds them ass attributes to your SVG document on render. -It leverages [the preRender lifecycle hook](/reference/api/hooks/prerender) to do so. +Published as [@freesewing/plugin-svgattr][1], this plugin takes an object of +key-value pairs and adds them ass attributes to your SVG document on render. ## Installation -```bash +```sh npm install @freesewing/plugin-svgattr ``` ## Usage -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: +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 Aaron from "@freesewing/aaron"; -import svgAttr from "@freesewing/plugin-svgattr"; -import translations from "@freesewing/i18n"; +## Notes -const myAaron = new Aaron() - .use(svgAttr, { class: "freesewing pattern" }); -``` +You should pass a second argument which holds key-value pairs of the attributes +you want to add to the SVG tag. -You should pass a second argument which holds key-value pairs of the attributes you want to add to the SVG tag. +The svgattr plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-svgattr diff --git a/markdown/dev/reference/plugins/theme/en.md b/markdown/dev/reference/plugins/theme/en.md index e3879e84292..d758083e923 100644 --- a/markdown/dev/reference/plugins/theme/en.md +++ b/markdown/dev/reference/plugins/theme/en.md @@ -1,38 +1,30 @@ --- -title: "@freesewing/plugin-theme" +title: plugin-theme --- -The **@freesewing-plugin-theme** plugin provides CSS styling for SVG output. -It leverages [the preRender lifecycle hook](/reference/api/hooks/prerender) to -accomplish this. - - - -##### Only applies to SVG/PS/PDF output - -This plugin will inject CSS in the SVG document when rendering to SVG. - -If you use other ways to render your pattern (like our React component) -you will need to apply your own styles. - - +Published as [@freesewing/plugin-theme][1], this plugin provides CSS for +your SVG document when rendering to SVG. ## Installation -```bash +```sh npm install @freesewing/plugin-theme ``` ## Usage -Like all [run-time plugins](/guides/plugins/types-of-plugins#run-time-plugins), you -load them by by passing them to the `use()` method of an instatiated pattern. +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). -That method is chainable, so if you have multiple plugins you can just chain them together. +## Notes -```js -import Aaron from "@freesewing/aaron"; -import theme from "@freesewing/plugin-theme"; +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. + +The theme plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +[1]: https://www.npmjs.com/package/@freesewing/plugin-theme -const pattern = new Aaron().use(theme); -``` diff --git a/markdown/dev/reference/plugins/title/en.md b/markdown/dev/reference/plugins/title/en.md index 1826f518d32..434cf9fcb50 100644 --- a/markdown/dev/reference/plugins/title/en.md +++ b/markdown/dev/reference/plugins/title/en.md @@ -1,36 +1,25 @@ --- -title: "@freesewing/plugin-title" +title: plugin-title --- -The **@freesewing/plugin-title** plugin provides [the -title macro](/reference/api/macros/title/) which facilitates adding part titles -to your designs. - -An example of the title macro - - - -The title plugin is part of our [plugin-bundle](/reference/plugins/bundle) - - +Published as [@freesewing/plugin-title][1], this plugin provides [the title +macro](/reference/api/macros/title) which facilitates adding part titles to +your designs. ## Installation -```bash +```sh npm install @freesewing/plugin-title ``` ## Usage -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: +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 freesewing from "@freesewing/core"; -import title from "@freesewing/plugin-title"; -import config from "../config"; +## Notes -const Pattern = new freesewing.Design(config, title); -``` +The title plugin is part of our [plugin-bundle](/reference/plugins/bundle) -Now you can use the [title](/reference/api/macros/title/) macro in your parts. +[1]: https://www.npmjs.com/package/@freesewing/plugin-title diff --git a/markdown/dev/reference/plugins/versionfree-svg/en.md b/markdown/dev/reference/plugins/versionfree-svg/en.md index 10dcc05defc..69f6792c4d0 100644 --- a/markdown/dev/reference/plugins/versionfree-svg/en.md +++ b/markdown/dev/reference/plugins/versionfree-svg/en.md @@ -1,28 +1,23 @@ --- -title: "@freesewing/versionfree-svg" +title: versionfree-svg --- -The **@freesewing/plugin-versionfree-svg** plugin suppresses -the inclusion of the FreeSewing version number in SVG output. -This allows diffing pattern output between versions to check for -any differences in the output between different versions of FreeSewing. +Published as [@freesewing/plugin-versionfree-svg][1], this plugin suppresses +the inclusion of the FreeSewing version number in SVG output. This allows +diffing pattern output between versions to check for any differences in the +output between different versions of FreeSewing. ## Installation ```sh -npm install @freesewing/plugin-bartack +npm install @freesewing/plugin-versionfree-svg ``` ## Usage -Like all [run-time plugins](/guides/plugins/types-of-plugins#run-time-plugins), you -load them by by passing them to the `use()` method of an instatiated pattern. +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). -That method is chainable, so if you have multiple plugins you can just chain them together. +[1]: https://www.npmjs.com/package/@freesewing/plugin-versionfree-svg -```js -import Aaron from "@freesewing/aaron"; -import versionfreeSvg from "@freesewing/plugin-versionfree-svg"; - -const pattern = new Aaron().use(versionfreeSvg); -```