From 767d835cc6efa88c136c7e2dea2c0d83d4e5a38e Mon Sep 17 00:00:00 2001 From: Benjamin F Date: Tue, 13 Dec 2022 04:39:07 -0800 Subject: [PATCH] fix(docs): Update plugins documentation --- markdown/dev/reference/plugins/banner/en.md | 8 +++- markdown/dev/reference/plugins/bartack/en.md | 10 +++- markdown/dev/reference/plugins/bundle/en.md | 8 ++++ markdown/dev/reference/plugins/bust/en.md | 47 +++++++++++++++---- markdown/dev/reference/plugins/buttons/en.md | 8 +++- .../dev/reference/plugins/cutonfold/en.md | 10 +++- .../dev/reference/plugins/dimension/en.md | 8 +++- markdown/dev/reference/plugins/en.md | 23 ++++++++- markdown/dev/reference/plugins/flip/en.md | 8 +++- markdown/dev/reference/plugins/gore/en.md | 10 +++- .../dev/reference/plugins/grainline/en.md | 8 +++- markdown/dev/reference/plugins/i18n/en.md | 43 +++++++++++++---- markdown/dev/reference/plugins/logo/en.md | 7 +++ .../dev/reference/plugins/measurements/en.md | 16 ++++++- markdown/dev/reference/plugins/mirror/en.md | 7 +++ markdown/dev/reference/plugins/notches/en.md | 7 +++ markdown/dev/reference/plugins/round/en.md | 11 +++-- markdown/dev/reference/plugins/scalebox/en.md | 10 +++- markdown/dev/reference/plugins/sprinkle/en.md | 7 +++ markdown/dev/reference/plugins/svgattr/en.md | 32 +++++++++++-- markdown/dev/reference/plugins/theme/en.md | 10 ++-- markdown/dev/reference/plugins/title/en.md | 7 +++ .../reference/plugins/versionfree-svg/en.md | 18 +++++-- 23 files changed, 272 insertions(+), 51 deletions(-) diff --git a/markdown/dev/reference/plugins/banner/en.md b/markdown/dev/reference/plugins/banner/en.md index 38173356b7d..b2c05f68beb 100644 --- a/markdown/dev/reference/plugins/banner/en.md +++ b/markdown/dev/reference/plugins/banner/en.md @@ -18,9 +18,15 @@ 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 { bannerPlugin } from '@freesewing/plugin-banner' +// or +import { pluginBanner } from '@freesewing/plugin-banner' +``` + ## Notes The banner plugin is part of our [plugin-bundle](/reference/plugins/bundle) [1]: https://www.npmjs.com/package/@freesewing/plugin-banner - diff --git a/markdown/dev/reference/plugins/bartack/en.md b/markdown/dev/reference/plugins/bartack/en.md index c8b99f54862..9647cebe8f5 100644 --- a/markdown/dev/reference/plugins/bartack/en.md +++ b/markdown/dev/reference/plugins/bartack/en.md @@ -5,7 +5,7 @@ title: plugin-bartack Published as [@freesewing/plugin-bartack][1], this plugin provides the [bartack](/reference/macros/bartack), [bartackAlong](/reference/macros/bartackalong), and -the [bartackFractionAlong](/reference/macros/bartack) macros +the [bartackFractionAlong](/reference/macros/bartackfractionalong) macros which allows you to add bartacks — a set of tight zig-zag stitches used to enforce a seam — to your design. @@ -21,9 +21,15 @@ 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 { bartackPlugin } from '@freesewing/plugin-bartack' +// or +import { pluginBartack } from '@freesewing/plugin-bartack' +``` + ## Notes The bartack plugin is part of our [plugin-bundle](/reference/plugins/bundle) [1]: https://www.npmjs.com/package/@freesewing/plugin-bartack - diff --git a/markdown/dev/reference/plugins/bundle/en.md b/markdown/dev/reference/plugins/bundle/en.md index 56dc20a977f..689acee4dc8 100644 --- a/markdown/dev/reference/plugins/bundle/en.md +++ b/markdown/dev/reference/plugins/bundle/en.md @@ -35,3 +35,11 @@ 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 { bundlePlugin } from '@freesewing/plugin-bundle' +// or +import { pluginBundle } from '@freesewing/plugin-bundle' +``` + +[1]: https://www.npmjs.com/package/@freesewing/plugin-bundle diff --git a/markdown/dev/reference/plugins/bust/en.md b/markdown/dev/reference/plugins/bust/en.md index 9ce8e912962..1dec3acc72c 100644 --- a/markdown/dev/reference/plugins/bust/en.md +++ b/markdown/dev/reference/plugins/bust/en.md @@ -5,7 +5,7 @@ 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 accomodate both people with and without breasts, +breasts or merely want to accomodate both people with and without breasts, this plugin can help you accomplish that. ## Installation @@ -20,6 +20,17 @@ 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 @@ -37,7 +48,7 @@ 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 +- Changing `measurments.chest` to the value of `measurements.highBust` ### Use when extending breastless patterns into a with-breasts version @@ -50,32 +61,48 @@ 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. +You can see this in practice in our [Carlita][2] design, which extends the +menswear [Carlton][3] design. -To learn more about extending a pattern, see [Part +To learn more about extending a design, see [Part inheritance](/howtos/code/from/) -### Use when creating gender-neutral patterns +### Use when creating gender-neutral designs -To create a truly gender-neutral pattern — one that will adapt to breasts only +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 mark the breast measurements as [optional +- 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]. -[1]: https://www.npmjs.com/package/@freesewing/plugin-banner +### 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 - diff --git a/markdown/dev/reference/plugins/buttons/en.md b/markdown/dev/reference/plugins/buttons/en.md index f14337ee648..c55d99ba9ee 100644 --- a/markdown/dev/reference/plugins/buttons/en.md +++ b/markdown/dev/reference/plugins/buttons/en.md @@ -24,9 +24,15 @@ 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 { buttonsPlugin } from '@freesewing/plugin-buttons' +// or +import { pluginButtons } from '@freesewing/plugin-buttons' +``` + ## Notes The buttons plugin is part of our [plugin-bundle](/reference/plugins/bundle) [1]: https://www.npmjs.com/package/@freesewing/plugin-buttons - diff --git a/markdown/dev/reference/plugins/cutonfold/en.md b/markdown/dev/reference/plugins/cutonfold/en.md index 11860abe749..05817416009 100644 --- a/markdown/dev/reference/plugins/cutonfold/en.md +++ b/markdown/dev/reference/plugins/cutonfold/en.md @@ -3,7 +3,7 @@ title: plugin-cutonfold --- Published as [@freesewing/plugin-cutonfold][1], this plugin provides [the -cutonfold macro](/reference/macros/cutonfold) which adds a cut-on-fold +cutonfold macro](/reference/macros/cutonfold) which adds a _cut on fold_ indicator to your design. ## Installation @@ -18,9 +18,15 @@ 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 { cutonfoldPlugin } from '@freesewing/plugin-cutonfold' +// or +import { pluginCutonfold } from '@freesewing/plugin-cutonfold' +``` + ## Notes The cutonfold plugin is part of our [plugin-bundle](/reference/plugins/bundle) [1]: https://www.npmjs.com/package/@freesewing/plugin-cutonfold - diff --git a/markdown/dev/reference/plugins/dimension/en.md b/markdown/dev/reference/plugins/dimension/en.md index 62122f22b31..c5e58a323ba 100644 --- a/markdown/dev/reference/plugins/dimension/en.md +++ b/markdown/dev/reference/plugins/dimension/en.md @@ -24,9 +24,15 @@ 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 { dimensionPlugin } from '@freesewing/plugin-dimension' +// or +import { pluginDimension } from '@freesewing/plugin-dimension' +``` + ## Notes The dimension plugin is part of our [plugin-bundle](/reference/plugins/bundle) [1]: https://www.npmjs.com/package/@freesewing/plugin-dimension - diff --git a/markdown/dev/reference/plugins/en.md b/markdown/dev/reference/plugins/en.md index 3ba1760d1ad..7b60da8280c 100644 --- a/markdown/dev/reference/plugins/en.md +++ b/markdown/dev/reference/plugins/en.md @@ -6,7 +6,28 @@ FreeSewing uses a modular approach where functionality can be extended with plugins. Plugins can provide macros, store methods, or use any of the lifecycle hooks. -We maintain the following plugins: +## 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 { namePlugin } from { @freesewing/plugin-name } +// or +import { pluginName } from { @freesewing/plugin-name } +``` + + + +For convenience, each plugin is exported in two name formats: +"plugin\" and "\Plugin". +For example, either `pluginBanner` or `bannerPlugin` can be used. + + + +## Plugins we maintain diff --git a/markdown/dev/reference/plugins/flip/en.md b/markdown/dev/reference/plugins/flip/en.md index 01315d2643c..0731dcbfdb6 100644 --- a/markdown/dev/reference/plugins/flip/en.md +++ b/markdown/dev/reference/plugins/flip/en.md @@ -19,5 +19,11 @@ 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). -[1]: https://www.npmjs.com/package/@freesewing/plugin-flip +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 diff --git a/markdown/dev/reference/plugins/gore/en.md b/markdown/dev/reference/plugins/gore/en.md index 598b4e005d8..da09c7f8ded 100644 --- a/markdown/dev/reference/plugins/gore/en.md +++ b/markdown/dev/reference/plugins/gore/en.md @@ -8,7 +8,7 @@ segments](https://en.wikipedia.org/wiki/Gore_\(segment\)); 2D panels to create a sphehrical shape as used in hats for example. This plugin handles all the mathematics to create a (part-)sphere in your -patterns. +designs. ## Installation @@ -22,5 +22,11 @@ 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). -[1]: https://www.npmjs.com/package/@freesewing/plugin-gore +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 diff --git a/markdown/dev/reference/plugins/grainline/en.md b/markdown/dev/reference/plugins/grainline/en.md index bab944bd60b..df86ac0d6b1 100644 --- a/markdown/dev/reference/plugins/grainline/en.md +++ b/markdown/dev/reference/plugins/grainline/en.md @@ -18,9 +18,15 @@ 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 { grainlinePlugin } from '@freesewing/plugin-grainline' +// or +import { pluginGrainline } from '@freesewing/plugin-grainline' +``` + ## Notes The grainline plugin is part of our [plugin-bundle](/reference/plugins/bundle) [1]: https://www.npmjs.com/package/@freesewing/plugin-grainline - diff --git a/markdown/dev/reference/plugins/i18n/en.md b/markdown/dev/reference/plugins/i18n/en.md index b495aa5a175..10031354eef 100644 --- a/markdown/dev/reference/plugins/i18n/en.md +++ b/markdown/dev/reference/plugins/i18n/en.md @@ -3,7 +3,8 @@ title: plugin-i18n --- Published as [@freesewing/plugin-i18n][1], this plugin faciliates -translation of your designs. +translation of your designs by allowing you to provide your own +language translations. ## Installation @@ -17,30 +18,52 @@ 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 +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). +package](https://www.npmjs.com/package/@freesewing/i18n). -To add (your own) translations, you should pass data to this plugin. -It should be structured as such: +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" + example: "Example", + examplePhrase: "An example phrase", + anotherTranslationKey: "(English translation for the translation key)", + // More translations can follow... }, nl: { - example: "Voorbeeld" + example: "Voorbeeld", + examplePhrase: "Een voorbeeldzin", + anotherTranslationKey: "(Dutch translation for the translation key)", + // More translations can follow... }, - // More languages 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... } } ``` -The i18n plugin is part of our [plugin-bundle](/reference/plugins/bundle) + +To learn more about using translations in a design, see the +[Translation guide](/guides/translation/) + [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 2f98ae7a3d3..d930a3b78da 100644 --- a/markdown/dev/reference/plugins/logo/en.md +++ b/markdown/dev/reference/plugins/logo/en.md @@ -18,6 +18,13 @@ 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 { logoPlugin } from '@freesewing/plugin-logo' +// or +import { pluginLogo } from '@freesewing/plugin-logo' +``` + ## Notes The logo plugin is part of our [plugin-bundle](/reference/plugins/bundle) diff --git a/markdown/dev/reference/plugins/measurements/en.md b/markdown/dev/reference/plugins/measurements/en.md index f629a2948bd..c7ac771c5dd 100644 --- a/markdown/dev/reference/plugins/measurements/en.md +++ b/markdown/dev/reference/plugins/measurements/en.md @@ -3,7 +3,7 @@ title: plugin-measurements --- Published as [@freesewing/plugin-measurements][1], this plugin will -provide a number of extra measurements to your pattern insofar as +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: @@ -14,7 +14,12 @@ It will add the following measurements: - `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 available) +- `crossSeamBack` (if both `crossSeam` and `crossSeamFront` are provided) + + +For more information about these extra measurements, please see +[Measurements from `plugin-measurements`](/reference/measurements#measurements-from-plugin-measurements) + ## Installation @@ -28,6 +33,13 @@ 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 The measurements plugin is part of our [plugin-bundle](/reference/plugins/bundle) diff --git a/markdown/dev/reference/plugins/mirror/en.md b/markdown/dev/reference/plugins/mirror/en.md index f9305460454..23752fbdd8e 100644 --- a/markdown/dev/reference/plugins/mirror/en.md +++ b/markdown/dev/reference/plugins/mirror/en.md @@ -18,6 +18,13 @@ 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 The mirror plugin is part of our [plugin-bundle](/reference/plugins/bundle) diff --git a/markdown/dev/reference/plugins/notches/en.md b/markdown/dev/reference/plugins/notches/en.md index 255002cca00..78e8e696671 100644 --- a/markdown/dev/reference/plugins/notches/en.md +++ b/markdown/dev/reference/plugins/notches/en.md @@ -18,6 +18,13 @@ 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 { notchesPlugin } from '@freesewing/plugin-notches' +// or +import { pluginNotches } from '@freesewing/plugin-notches' +``` + ## Notes The notches plugin is part of our [plugin-bundle](/reference/plugins/bundle) diff --git a/markdown/dev/reference/plugins/round/en.md b/markdown/dev/reference/plugins/round/en.md index d35c21276eb..cca28df6d99 100644 --- a/markdown/dev/reference/plugins/round/en.md +++ b/markdown/dev/reference/plugins/round/en.md @@ -3,7 +3,7 @@ title: plugin-round --- Published as [@freesewing/plugin-round][1], this plugin provides [the round -macro](/reference/macros/round) which helps you round corners on your +macro](/reference/macros/round) which helps you create rounded corners on your designs. ## Installation @@ -18,12 +18,17 @@ 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. +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 - diff --git a/markdown/dev/reference/plugins/scalebox/en.md b/markdown/dev/reference/plugins/scalebox/en.md index 750310e09ff..a3c6fe1d6a3 100644 --- a/markdown/dev/reference/plugins/scalebox/en.md +++ b/markdown/dev/reference/plugins/scalebox/en.md @@ -20,13 +20,19 @@ 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 { scaleboxPlugin } from '@freesewing/plugin-scalebox' +// or +import { pluginScalebox } from '@freesewing/plugin-scalebox' +``` + ## Notes This plugin by default includes FreeSewing branding, but you can -override that when calling the scalebox macro in case you want to +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 - diff --git a/markdown/dev/reference/plugins/sprinkle/en.md b/markdown/dev/reference/plugins/sprinkle/en.md index 8803d90c277..b6d0cc089b1 100644 --- a/markdown/dev/reference/plugins/sprinkle/en.md +++ b/markdown/dev/reference/plugins/sprinkle/en.md @@ -19,6 +19,13 @@ 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 The sprinkle plugin is part of our [plugin-bundle](/reference/plugins/bundle) diff --git a/markdown/dev/reference/plugins/svgattr/en.md b/markdown/dev/reference/plugins/svgattr/en.md index bee8174e5e5..494560830dd 100644 --- a/markdown/dev/reference/plugins/svgattr/en.md +++ b/markdown/dev/reference/plugins/svgattr/en.md @@ -3,7 +3,8 @@ title: plugin-svgattr --- 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. +key-value pairs and adds them as attributes of the `` tag +of a pattern's SVG document on render. ## Installation @@ -17,11 +18,34 @@ 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' +``` + +For convenience, this plugin is exported +under multiple names with variations of capitalization. + + ## Notes -You should pass a second argument which holds key-value pairs of the attributes -you want to add to the SVG tag. +To provide the attributes for the `` tag, you will need to pass a +second argument which holds key-value pairs. +It should be an `Object` structured as such: -The svgattr plugin is part of our [plugin-bundle](/reference/plugins/bundle) +```js +{ + key1: 'value1', + key2: 'value2', + key3: 'value3', + // More key-value pairs can follow... +} +``` [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 d758083e923..d5afb985269 100644 --- a/markdown/dev/reference/plugins/theme/en.md +++ b/markdown/dev/reference/plugins/theme/en.md @@ -17,6 +17,13 @@ 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. @@ -24,7 +31,4 @@ 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 - diff --git a/markdown/dev/reference/plugins/title/en.md b/markdown/dev/reference/plugins/title/en.md index 188c975f77a..971b1f752b0 100644 --- a/markdown/dev/reference/plugins/title/en.md +++ b/markdown/dev/reference/plugins/title/en.md @@ -18,6 +18,13 @@ 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 { titlePlugin } from '@freesewing/plugin-title' +// or +import { pluginTitle } from '@freesewing/plugin-title' +``` + ## Notes The title plugin is part of our [plugin-bundle](/reference/plugins/bundle) diff --git a/markdown/dev/reference/plugins/versionfree-svg/en.md b/markdown/dev/reference/plugins/versionfree-svg/en.md index 69f6792c4d0..a8e7059a51b 100644 --- a/markdown/dev/reference/plugins/versionfree-svg/en.md +++ b/markdown/dev/reference/plugins/versionfree-svg/en.md @@ -1,11 +1,13 @@ --- -title: versionfree-svg +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 -diffing pattern output between versions to check for any differences in the -output between different versions of FreeSewing. +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 @@ -19,5 +21,11 @@ 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). -[1]: https://www.npmjs.com/package/@freesewing/plugin-versionfree-svg +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