From 6b147d81a0e4aa7f30ef0598e9f4ff5880763b07 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 29 Oct 2023 17:20:35 +0100 Subject: [PATCH] feat(markdown): New docs for various things --- .../api/store/generatemacroids/en.md | 8 -- .../dev/reference/api/store/getmacroids/en.md | 5 -- markdown/dev/reference/api/store/log/en.md | 13 ---- markdown/dev/reference/api/store/pack/en.md | 46 ------------ .../api/store/removemacronodes/en.md | 5 -- .../reference/api/store/storemacroids/en.md | 5 -- markdown/dev/reference/macros/banner/en.md | 11 ++- markdown/dev/reference/macros/bannerbox/en.md | 26 +++++-- markdown/dev/reference/macros/bartack/en.md | 15 ++-- .../dev/reference/macros/bartackalong/en.md | 18 +++-- .../macros/bartackfractionalong/en.md | 15 ++-- markdown/dev/reference/macros/crossbox/en.md | 52 +++++-------- markdown/dev/reference/macros/cutonfold/en.md | 41 +++------- markdown/dev/reference/macros/en.md | 10 ++- markdown/dev/reference/macros/flip/en.md | 13 +++- markdown/dev/reference/macros/gore/en.md | 20 ++--- markdown/dev/reference/macros/grainline/en.md | 34 ++------- markdown/dev/reference/macros/hd/en.md | 26 +++---- markdown/dev/reference/macros/ld/en.md | 24 +++--- markdown/dev/reference/macros/miniscale/en.md | 29 ++----- markdown/dev/reference/macros/mirror/en.md | 15 +--- markdown/dev/reference/macros/pd/en.md | 21 ++---- markdown/dev/reference/macros/pleat/en.md | 33 ++++---- .../dev/reference/macros/ringsector/en.md | 15 +--- markdown/dev/reference/macros/rmad/en.md | 37 ++------- markdown/dev/reference/macros/rmahd/en.md | 14 ++++ markdown/dev/reference/macros/rmald/en.md | 14 ++++ markdown/dev/reference/macros/rmapd/en.md | 14 ++++ markdown/dev/reference/macros/rmavd/en.md | 14 ++++ markdown/dev/reference/macros/rmbanner/en.md | 16 ++++ .../dev/reference/macros/rmbannerbox/en.md | 15 ++++ markdown/dev/reference/macros/rmbartack/en.md | 16 ++++ .../dev/reference/macros/rmbartackalong/en.md | 15 ++++ .../macros/rmbartackfractionalong/en.md | 15 ++++ .../dev/reference/macros/rmcrossbox/en.md | 15 ++++ .../dev/reference/macros/rmcutonfold/en.md | 15 ++++ markdown/dev/reference/macros/rmd/en.md | 49 ------------ .../dev/reference/macros/rmgrainline/en.md | 15 ++++ markdown/dev/reference/macros/rmhd/en.md | 15 ++++ markdown/dev/reference/macros/rmld/en.md | 15 ++++ .../dev/reference/macros/rmminiscale/en.md | 15 ++++ markdown/dev/reference/macros/rmpd/en.md | 15 ++++ markdown/dev/reference/macros/rmpleat/en.md | 15 ++++ .../dev/reference/macros/rmringsector/en.md | 35 +-------- .../dev/reference/macros/rmscalebox/en.md | 15 ++++ .../dev/reference/macros/rmsewtogether/en.md | 15 ++++ markdown/dev/reference/macros/rmtitle/en.md | 15 ++++ markdown/dev/reference/macros/rmvd/en.md | 15 ++++ markdown/dev/reference/macros/round/en.md | 17 ++--- markdown/dev/reference/macros/scalebox/en.md | 30 ++------ .../dev/reference/macros/sewtogether/en.md | 24 +++--- markdown/dev/reference/macros/sprinkle/en.md | 9 +-- markdown/dev/reference/macros/title/en.md | 20 ++--- markdown/dev/reference/macros/vd/en.md | 24 +++--- .../dev/reference/plugins/annotations/en.md | 75 ++++++++++++++++--- markdown/dev/reference/plugins/bundle/en.md | 37 --------- markdown/dev/reference/plugins/core/en.md | 39 ++++++++++ markdown/dev/reference/plugins/en.md | 19 +++-- markdown/dev/reference/snippets/bnotch/en.md | 3 +- markdown/dev/reference/snippets/button/en.md | 3 +- .../reference/snippets/buttonhole-end/en.md | 4 +- .../reference/snippets/buttonhole-start/en.md | 4 +- .../dev/reference/snippets/buttonhole/en.md | 4 +- markdown/dev/reference/snippets/eyelet/en.md | 27 +++++++ markdown/dev/reference/snippets/logo/en.md | 3 +- markdown/dev/reference/snippets/notch/en.md | 3 +- .../dev/reference/snippets/snap-socket/en.md | 3 +- .../dev/reference/snippets/snap-stud/en.md | 4 +- "markdown/dev/reference/store-methods/\\" | 31 ++++++++ markdown/dev/reference/store-methods/en.md | 27 +++++++ .../reference/store-methods/flag.error/en.md | 26 +++++++ .../reference/store-methods/flag.fixme/en.md | 26 +++++++ .../reference/store-methods/flag.info/en.md | 71 ++++++++++++++++++ .../reference/store-methods/flag.note/en.md | 26 +++++++ .../reference/store-methods/flag.preset/en.md | 41 ++++++++++ .../reference/store-methods/flag.tip/en.md | 26 +++++++ .../reference/store-methods/flag.warn/en.md | 26 +++++++ .../store-methods/generatemacroids/en.md | 37 +++++++++ .../reference/store-methods/getmacroids/en.md | 30 ++++++++ .../debug => store-methods/log.debug}/en.md | 2 +- .../error => store-methods/log.error}/en.md | 2 +- .../log/info => store-methods/log.info}/en.md | 2 +- .../log/warn => store-methods/log.warn}/en.md | 2 +- .../dev/reference/store-methods/pack/en.md | 11 +++ .../store-methods/removemacronodes/en.md | 31 ++++++++ .../store-methods/storemacroids/en.md | 29 +++++++ .../store-methods/unflag.error/en.md | 19 +++++ .../store-methods/unflag.fixme/en.md | 19 +++++ .../reference/store-methods/unflag.info/en.md | 19 +++++ .../reference/store-methods/unflag.note/en.md | 19 +++++ .../store-methods/unflag.preset/en.md | 17 +++++ .../reference/store-methods/unflag.tip/en.md | 19 +++++ .../reference/store-methods/unflag.warn/en.md | 19 +++++ 93 files changed, 1274 insertions(+), 589 deletions(-) delete mode 100644 markdown/dev/reference/api/store/generatemacroids/en.md delete mode 100644 markdown/dev/reference/api/store/getmacroids/en.md delete mode 100644 markdown/dev/reference/api/store/log/en.md delete mode 100644 markdown/dev/reference/api/store/pack/en.md delete mode 100644 markdown/dev/reference/api/store/removemacronodes/en.md delete mode 100644 markdown/dev/reference/api/store/storemacroids/en.md create mode 100644 markdown/dev/reference/macros/rmahd/en.md create mode 100644 markdown/dev/reference/macros/rmald/en.md create mode 100644 markdown/dev/reference/macros/rmapd/en.md create mode 100644 markdown/dev/reference/macros/rmavd/en.md create mode 100644 markdown/dev/reference/macros/rmbanner/en.md create mode 100644 markdown/dev/reference/macros/rmbannerbox/en.md create mode 100644 markdown/dev/reference/macros/rmbartack/en.md create mode 100644 markdown/dev/reference/macros/rmbartackalong/en.md create mode 100644 markdown/dev/reference/macros/rmbartackfractionalong/en.md create mode 100644 markdown/dev/reference/macros/rmcrossbox/en.md create mode 100644 markdown/dev/reference/macros/rmcutonfold/en.md delete mode 100644 markdown/dev/reference/macros/rmd/en.md create mode 100644 markdown/dev/reference/macros/rmgrainline/en.md create mode 100644 markdown/dev/reference/macros/rmhd/en.md create mode 100644 markdown/dev/reference/macros/rmld/en.md create mode 100644 markdown/dev/reference/macros/rmminiscale/en.md create mode 100644 markdown/dev/reference/macros/rmpd/en.md create mode 100644 markdown/dev/reference/macros/rmpleat/en.md create mode 100644 markdown/dev/reference/macros/rmscalebox/en.md create mode 100644 markdown/dev/reference/macros/rmsewtogether/en.md create mode 100644 markdown/dev/reference/macros/rmtitle/en.md create mode 100644 markdown/dev/reference/macros/rmvd/en.md delete mode 100644 markdown/dev/reference/plugins/bundle/en.md create mode 100644 markdown/dev/reference/plugins/core/en.md create mode 100644 markdown/dev/reference/snippets/eyelet/en.md create mode 100644 "markdown/dev/reference/store-methods/\\" create mode 100644 markdown/dev/reference/store-methods/en.md create mode 100644 markdown/dev/reference/store-methods/flag.error/en.md create mode 100644 markdown/dev/reference/store-methods/flag.fixme/en.md create mode 100644 markdown/dev/reference/store-methods/flag.info/en.md create mode 100644 markdown/dev/reference/store-methods/flag.note/en.md create mode 100644 markdown/dev/reference/store-methods/flag.preset/en.md create mode 100644 markdown/dev/reference/store-methods/flag.tip/en.md create mode 100644 markdown/dev/reference/store-methods/flag.warn/en.md create mode 100644 markdown/dev/reference/store-methods/generatemacroids/en.md create mode 100644 markdown/dev/reference/store-methods/getmacroids/en.md rename markdown/dev/reference/{api/store/log/debug => store-methods/log.debug}/en.md (95%) rename markdown/dev/reference/{api/store/log/error => store-methods/log.error}/en.md (96%) rename markdown/dev/reference/{api/store/log/info => store-methods/log.info}/en.md (95%) rename markdown/dev/reference/{api/store/log/warn => store-methods/log.warn}/en.md (95%) create mode 100644 markdown/dev/reference/store-methods/pack/en.md create mode 100644 markdown/dev/reference/store-methods/removemacronodes/en.md create mode 100644 markdown/dev/reference/store-methods/storemacroids/en.md create mode 100644 markdown/dev/reference/store-methods/unflag.error/en.md create mode 100644 markdown/dev/reference/store-methods/unflag.fixme/en.md create mode 100644 markdown/dev/reference/store-methods/unflag.info/en.md create mode 100644 markdown/dev/reference/store-methods/unflag.note/en.md create mode 100644 markdown/dev/reference/store-methods/unflag.preset/en.md create mode 100644 markdown/dev/reference/store-methods/unflag.tip/en.md create mode 100644 markdown/dev/reference/store-methods/unflag.warn/en.md diff --git a/markdown/dev/reference/api/store/generatemacroids/en.md b/markdown/dev/reference/api/store/generatemacroids/en.md deleted file mode 100644 index 9b2bc5b2717..00000000000 --- a/markdown/dev/reference/api/store/generatemacroids/en.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Store.generateMacroIds() ---- - -FIXME: Write docs - -## Signature - diff --git a/markdown/dev/reference/api/store/getmacroids/en.md b/markdown/dev/reference/api/store/getmacroids/en.md deleted file mode 100644 index 28bf7343f28..00000000000 --- a/markdown/dev/reference/api/store/getmacroids/en.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Store.getMacroIds() ---- - -FIXME: Write docs diff --git a/markdown/dev/reference/api/store/log/en.md b/markdown/dev/reference/api/store/log/en.md deleted file mode 100644 index df7011859ca..00000000000 --- a/markdown/dev/reference/api/store/log/en.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Store.log ---- - -A **Store** is initialized with a `log` property that holds methods for logging. - -Specifically, the `Store.log` property holds the following methods: - - - -## Notes - -You can override the default logging methods in the store with a plugin. diff --git a/markdown/dev/reference/api/store/pack/en.md b/markdown/dev/reference/api/store/pack/en.md deleted file mode 100644 index 12751a3f5fa..00000000000 --- a/markdown/dev/reference/api/store/pack/en.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Store.pack() ---- - -A **Store** is initialized with a `log` property that holds methods for logging. - -Specifically, the `Store.log` property holds the following methods: - -- `Store.log.debug()`: Logs at the debug level -- `Store.log.info()`: Logs at the info level -- `Store.log.warning()`: Logs at the warning level -- `Store.log.error()`: Logs at the error level - - -If errors are logged, FreeSewing will not try to layout the pattern. - - -## Signature - -This signature is for the `info` level, but applies to all methods/levels: - -```js -undefined Store.log.info(...data) -``` - -All logging methods are _variadic_, they will add logs to the array at `store.logs`. - -So logging with `Store.log.info()` will add the logs to the array at `Store.logs.info`. - -## Example - -```js -({ log, part }) => { - log.info('Hey, I am logging') - log.debug( - 'I am logging too', - `But you don't see me make a big deal out if it` - ) - - return part -} -``` - -## Notes - -You can override the default logging methods in the store with a plugin. diff --git a/markdown/dev/reference/api/store/removemacronodes/en.md b/markdown/dev/reference/api/store/removemacronodes/en.md deleted file mode 100644 index 0335dd6f147..00000000000 --- a/markdown/dev/reference/api/store/removemacronodes/en.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Store.removeMacroNodes() ---- - -FIXME: Write docs diff --git a/markdown/dev/reference/api/store/storemacroids/en.md b/markdown/dev/reference/api/store/storemacroids/en.md deleted file mode 100644 index 07f100488e8..00000000000 --- a/markdown/dev/reference/api/store/storemacroids/en.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Store.storeMacroIds() ---- - -FIXME: Write docs diff --git a/markdown/dev/reference/macros/banner/en.md b/markdown/dev/reference/macros/banner/en.md index f360f3c877e..114951c4298 100644 --- a/markdown/dev/reference/macros/banner/en.md +++ b/markdown/dev/reference/macros/banner/en.md @@ -3,18 +3,22 @@ title: banner --- The `banner` macro allows you to add repeating text along a path. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('banner', { + String id='banner', String className='', Number dy=1, Number repeat=10, Number spaces=12, Path path, String text, + Boolean force = false, }) ``` @@ -48,13 +52,18 @@ macro('banner', { |-------------:|------------|------------|-------------| | `className` | `` | `string` | Any additional CSS classes to apply to the text | | `dy` | `1` | `number` | Controls how far the text will be located above the path | +| `id` | `banner` | `string` | The id of this macro instance | | `path` | | `Path` | The Path to add the text on | | `repeat` | `10` | `number` | The number of repetitions | | `spaces` | `12` | `number` | The number of spaces to place between repetitions | | `text` | | `string` | The text to place repeat along the path | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | ## Notes Under the hood, this macro will: - Add `data-text`, `data-text-dy`, and `data-text-class` Attributes to the path to generate the text. + +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. + diff --git a/markdown/dev/reference/macros/bannerbox/en.md b/markdown/dev/reference/macros/bannerbox/en.md index c574fb7a5ff..ff21b0e3b83 100644 --- a/markdown/dev/reference/macros/bannerbox/en.md +++ b/markdown/dev/reference/macros/bannerbox/en.md @@ -1,14 +1,17 @@ --- -title: bannerbox +title: bannerBox --- The `bannerbox` macro allows you to add a box with repeating text on it. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('bannerbox', { + String id='bannerbox', String textClassName='text-xs fill-note', String boxClassName='stroke-xs stroke-note lashed', Point topLeft=new Point(0,0), @@ -18,6 +21,7 @@ macro('bannerbox', { Number dy=4, Number repeat=99, Number spaces=12, + Boolean force = false, }) ``` @@ -28,7 +32,9 @@ macro('bannerbox', { ({ Point, points, Path, paths, macro, part }) => { macro('bannerbox', { - title: 'a bannerbox example', + text: 'a bannerbox example', + topLeft: new Point(0,0), + bottomRight: new Point(80, 30) }) return part @@ -40,15 +46,17 @@ macro('bannerbox', { | Property | Default | Type | Description | |----------------:|--------------------------------|----------|-------------| -| `textClassName` | `text-xs fill-note` | `string` | CSS classes to apply to the text | -| `boxClassName` | `stroke-xs stroke-note lashed` | `string` | CSS classes to apply to the box path | -| `topLeft` | `new Point(0,0)` | `Point` | Top top-left corner of the box | | `bottomRight` | `new Point(100,100)` | `Point` | Top top-left corner of the box | -| `text` | `` | `string` | The text to place repeat along the box path | -| `margin` | `15` | `number` | Controls the margin the box will apply | +| `boxClassName` | `stroke-xs stroke-note lashed` | `string` | CSS classes to apply to the box path | | `dy` | `4` | `number` | Controls how far the text will be located above the path | +| `id` | `bannerbox` | `string` | The ID of this macro instance | +| `margin` | `15` | `number` | Controls the margin the box will apply | | `repeat` | `99` | `number` | The number of text repetitions. See [banner macro][banner] | | `spaces` | `12` | `number` | The number of spaces to place between repetitions. See [banner macro][banner] | +| `text` | `` | `string` | The text to place repeat along the box path | +| `textClassName` | `text-xs fill-note` | `string` | CSS classes to apply to the text | +| `topLeft` | `new Point(0,0)` | `Point` | Top top-left corner of the box | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | ## Notes @@ -68,4 +76,6 @@ needed might be a best practice to ensure that text completely surrounds the bannerbox, even if the pattern is scaled down, allowing more text to fit around the box. +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. + [banner]: /reference/macros/banner diff --git a/markdown/dev/reference/macros/bartack/en.md b/markdown/dev/reference/macros/bartack/en.md index 6e94669c72b..ed75091b044 100644 --- a/markdown/dev/reference/macros/bartack/en.md +++ b/markdown/dev/reference/macros/bartack/en.md @@ -4,12 +4,15 @@ title: bartack The `bartack` macro allows you to add a _bartack_ marker to your sewing pattern. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('banner', { + String id='bartack', Point anchor, Number angle=0, Number density=3, @@ -17,6 +20,7 @@ macro('banner', { String prefix='', String suffix='', Number width=3, + Boolean force = false, }) ``` @@ -43,13 +47,14 @@ macro('banner', { | `anchor` | | `Point` | The point to start the bartack from | | `angle` | `0` | `number` | The angle under which to draw the bartack | | `density` | `3` | `number` | Controls how close the stitches are together | +| `id` | `bartack` | `string` | The ID of this macro instance | | `length` | `15` | `number` | Length of the bartack | | `prefix` | | `string` | A prefix to apply to the name of the generated path | | `suffix` | | `string` | A suffix to apply to the name of the generated path | | `width` | `3` | `number` | Width of the bartack | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | -## Result +## Notes + +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. -| Generated Element | Description | -|-------------------|-------------| -| `paths.${prefix}bartack${suffix}` | Path generated for the bartack marker | diff --git a/markdown/dev/reference/macros/bartackalong/en.md b/markdown/dev/reference/macros/bartackalong/en.md index 5c53c8f43d9..3f9ae9737e8 100644 --- a/markdown/dev/reference/macros/bartackalong/en.md +++ b/markdown/dev/reference/macros/bartackalong/en.md @@ -4,12 +4,15 @@ title: bartackAlong The `bartackAlong` macro allows you to add a _bartack_ marker to your sewing pattern. More specifically, a bartack along a path. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js -macro('banner', { +macro('bartackAlong', { + String id='bartack' Number angle=0, Number density=3, Number length=15, @@ -17,6 +20,7 @@ macro('banner', { String prefix='', String suffix='', Number width=3, + Boolean force = false, }) ``` @@ -47,14 +51,16 @@ macro('banner', { |-------------:|------------|------------|-------------| | `angle` | `0` | `number` | The angle under which to draw the bartack | | `density` | `3` | `number` | Controls how close the stitches are together | +| `id` | `bartackalong` | `string` | The ID of this macro instance | | `length` | `15` | `number` | Length of the bartack | | `path` | | `Path` | The path the bartack should follow | | `prefix` | | `string` | A prefix to apply to the name of the generated path | | `suffix` | | `string` | A suffix to apply to the name of the generated path | | `width` | `3` | `number` | Width of the bartack | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | + +## Notes + +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. -## Result -| Generated Element | Description | -|-------------------|-------------| -| `paths.${prefix}bartack${suffix}` | Path generated for the bartack marker | diff --git a/markdown/dev/reference/macros/bartackfractionalong/en.md b/markdown/dev/reference/macros/bartackfractionalong/en.md index 17e8ac90e67..185969b8d8c 100644 --- a/markdown/dev/reference/macros/bartackfractionalong/en.md +++ b/markdown/dev/reference/macros/bartackfractionalong/en.md @@ -4,12 +4,15 @@ title: bartackFractionAlong The `bartackFractionAlong` macro allows you to add a _bartack_ marker to your sewing pattern. More specifically, a bartack along a fraction of a path. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js -macro('banner', { +macro('bartackFractionAlong', { + String id="bartack", Number angle=0, Number density=3, Number end=1, @@ -19,6 +22,7 @@ macro('banner', { Number start=0, String suffix='', Number width=3, + Boolean force = false, }) ``` @@ -58,9 +62,8 @@ macro('banner', { | `start` | `0` | `number` | At which fraction of the path length (from `0` to `1`) should the bartack start | | `suffix` | | `string` | A suffix to apply to the name of the generated path | | `width` | `3` | `number` | Width of the bartack | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | -## Result +## Notes -| Generated Element | Description | -|-------------------|-------------| -| `paths.${prefix}bartack${suffix}` | Path generated for the bartack marker | +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. diff --git a/markdown/dev/reference/macros/crossbox/en.md b/markdown/dev/reference/macros/crossbox/en.md index 47cffd74bfb..13f96153a9c 100644 --- a/markdown/dev/reference/macros/crossbox/en.md +++ b/markdown/dev/reference/macros/crossbox/en.md @@ -1,5 +1,5 @@ --- -title: crossbox +title: crossBox --- The `crossbox` macro is used to mark a feature on a sewing pattern @@ -7,15 +7,18 @@ to attach and reinforce an attachment between two pieces. This is regularly done by sewing along the outside of the pieces that needs to be joined, and then sewing along the diagonals too. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('crossbox', { - Point from, - Point to, + String id='crossbox', + Point topLeft, + Point bottomRight, String text, + Boolean force = false, }) ``` @@ -24,25 +27,13 @@ macro('crossbox', { ```js ({ Point, points, Path, paths, macro, part }) => { - points.partTL = new Point(0,0) - points.partTR = new Point(0,70) - points.partBR = new Point(50,70) - points.partBL = new Point(50,0) - - paths.part = new Path() - .move(points.partTL) - .line(points.partTR) - .line(points.partBR) - .line(points.partBL) - .close() - points.tl = new Point(5,5) points.br = new Point(45,25) macro('crossbox', { - from: points.tl, - to: points.br, - text: 'attach here', + topLeft: new Point(5, 5), + bottomRight: new Point(45, 25), + text: 'Attach here', }) return part @@ -54,22 +45,13 @@ macro('crossbox', { | Property | Default | Type | Description | |----------------:|----------|---------------------|-------------| -| `from` | | [Point](/reference/api/point) | The top left point of the crossbox | -| `to` | | [Point](/reference/api/point) | The bottom right point of the crossbox | +| `bottomRight` | | [Point](/reference/api/point) | The bottom right point of the crossbox | +| `topLeft` | | [Point](/reference/api/point) | The top left point of the crossbox | +| `id` | `crossbox` | `string` | The ID of this macro instance | | `text` | | String | Optional text to go in the center of the crossbox | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | -## Result +## Notes + +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. -| Generated Element | Description | -|-------------------|-------------| -| `points.${id}_boxTopLeft` | Point Top Left of the outer box | -| `points.${id}_boxTopRight` | Point Top Right of the outer box | -| `points.${id}_boxBottomLeft` | Point Bottom Left of the outer box | -| `points.${id}_boxBottomRight` | Point Bottom Right of the outer box | -| `points.${id}_topCrossTL` | Point Top Left of the inner box | -| `points.${id}_topCrossTR` | Point Top Right of the inner box | -| `points.${id}_topCrossBL` | Point Bottom Left of the inner box | -| `points.${id}_topCrossBR` | Point Bottom Right of the inner box | -| `points.${id}_textAnchor` | Point for the text | -| `paths.${id}crossBox` | Path for the outer box | -| `paths.${id}_topCross` | Path for the inner box and cross | diff --git a/markdown/dev/reference/macros/cutonfold/en.md b/markdown/dev/reference/macros/cutonfold/en.md index b0dc0bb4c3e..3e291a3d78c 100644 --- a/markdown/dev/reference/macros/cutonfold/en.md +++ b/markdown/dev/reference/macros/cutonfold/en.md @@ -1,20 +1,24 @@ --- -title: cutonfold +title: cutOnFold --- The `cutonfold` macro adds a _cut on fold_ indicator to your pattern. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('cutonfold', { + String id="cutonfold", Point from, Boolean grainline=false, Number margin=5, Number offset=15, String prefix='', Point to, + Boolean force = false, }) ``` @@ -45,47 +49,20 @@ macro('cutonfold', { | Property | Default | Type | Description | |------------:|---------|---------------------|-------------| | `from` | | [Point](/reference/api/point) | The startpoint of the _cut on fold_ indicator | +| `id` | `cutonfold` | `string` | The ID of this macro instance | | `to` | | [Point](/reference/api/point) | The endpoint of the _cut on fold_ indicator | | `margin` | 5 | [Point](/reference/api/point) | The distance in % to keep from the start/end edge | | `offset` | 15 | Number | The distance in mm to offset from the line from start to end | | `prefix` | 'cutonfold' | String | A prefix to apply to the names of the generated path and points | | `grainline` | `false` | Boolean | Whether this cutonfold indicator is also the grainline | - -## Result - -| Generated Element | Description | -|------|-------------| -| `paths.${prefix}Cutonfold` | The Path for the _cut on fold_ indicator | -| `points.${prefix}From` | Point used to create the path | -| `points.${prefix}Via1` | Point used to create the path | -| `points.${prefix}Via2` | Point used to create the path | -| `points.${prefix}To}` | Point used to create the path | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | ## Notes -### Place outside `complete` - -The `cutonfold` macro should be placed outside of `complete` blocks -in the part's draft method. - -This is because it provides information about the part's foldline and -possible grainline, -information that is always needed by the cutting layout regardless of -whether `complete` details and graphics are shown on the pattern. - -The `cutonfold` macro will automatically show or hide the cut on fold -indicator based on the `complete` setting. +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. ### It's safe to use a corner of your pattern part for this Since this is typically used on corners, the generated cut-on-fold indicator will not go all the way to the `to` and `from` points. -### Removing the cut on fold indicator - -If you inherit a part with a cut on fold indicator and you'd like to remove it, -you can do so by passing `false` to the macro: - -```js -macro('cutonfold', false) -``` diff --git a/markdown/dev/reference/macros/en.md b/markdown/dev/reference/macros/en.md index c72abfaedb3..35ce1953633 100644 --- a/markdown/dev/reference/macros/en.md +++ b/markdown/dev/reference/macros/en.md @@ -49,10 +49,12 @@ Now you can use these macros in your part: ## Macros we maintain -Below is a list of macros from [the plugins we maintain](/reference/plugins): +Below is a list of macros from [the plugins we maintain](/reference/plugins). + + + +We use camelCase here, but macro names are case-insensitive + -## Notes - -We recommend allowing to *undo* a macro by passing `false` as its parameter. diff --git a/markdown/dev/reference/macros/flip/en.md b/markdown/dev/reference/macros/flip/en.md index ca6facd6d2f..a3ad2061ea4 100644 --- a/markdown/dev/reference/macros/flip/en.md +++ b/markdown/dev/reference/macros/flip/en.md @@ -3,8 +3,17 @@ title: flip --- The `flip` macro flips (mirrors) an entire part vertically around either the -X-axis or the Y-axis. It is provided by the [flip -plugin](/reference/plugins/flip). +X-axis or the Y-axis. + +It is provided by the [flip plugin](/reference/plugins/flip). + + +##### Not a core-plugins macro + +The `flip` macro is not provided by the [core-plugins](/reference/plugins/core), +so you need to load the [flip plugin](/reference/plugins/flip) explicitly +if you want to use it. + ## Signature diff --git a/markdown/dev/reference/macros/gore/en.md b/markdown/dev/reference/macros/gore/en.md index c7b18872c5d..b45388bafbe 100644 --- a/markdown/dev/reference/macros/gore/en.md +++ b/markdown/dev/reference/macros/gore/en.md @@ -3,7 +3,14 @@ title: gore --- The `gore` macro facilitates the drafting of [gores][1] to create spherical or other roundish objects. They are are typically used in hats. -It is provided by the [gore plugin](/reference/plugins/grainline/). + + +##### Not a core-plugins macro + +The `gore` macro is not provided by the [core plugins](/reference/plugins/core), +so you need to load the [gore plugin](/reference/plugins/gore) explicitly +if you want to use it. + ## Signature @@ -51,17 +58,6 @@ macro('gore', { | `class` | | boolean | Any classes to add to the generated path | | `prefix` | | string | A prefix to apply to the names of the generated path and points | -## Result - -| Generated Element | Description | -|------|-------------| -| `paths.${prefix}seam` | The Path for the gore | -| `points.${prefix}p1` | Point for the gore tip | -| `points.${prefix}p2` | Point between the tip and side corner | -| `points.${prefix}p3` | Point for the gore side corner | -| `points.${prefix}Cp1` | Control Point used to create the curved path | -| `points.${prefix}Cp2` | Control Point used to create the curved path | - [1]: https://en.wikipedia.org/wiki/Gore_\(segment\) [2]: /reference/api/point diff --git a/markdown/dev/reference/macros/grainline/en.md b/markdown/dev/reference/macros/grainline/en.md index 91276e781ca..abc7bb80bca 100644 --- a/markdown/dev/reference/macros/grainline/en.md +++ b/markdown/dev/reference/macros/grainline/en.md @@ -3,7 +3,9 @@ title: grainline --- The `grainline` macro adds a _grainline_ indicator to your pattern. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature @@ -12,6 +14,7 @@ macro('grainline', { Point from, Point to, String text=grainline, + Boolean force = false, }) ``` @@ -43,36 +46,11 @@ macro('grainline', { | `from` | | [Point][1] | The startpoint of the _grainline_ indicator | | `to` | | [Point][1] | The endpoint of the _grainline_ indicator | | `text` | 'grainline' | string | The text to put on the _grainline_ indicator | - -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.grainline` | The Path for the _grainline_ indicator | -| `points.grainlineFrom` | Point used to create the path | -| `points.grainlineTo` | Point used to create the path | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | [1]: /reference/api/point ## Notes -### Place outside `complete` +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. -The `grainline` macro should be placed outside of `complete` blocks -in the part's draft method. - -This is because it provides information about the part's grainline, -information that is always needed by the cutting layout regardless of -whether `complete` details and graphics are shown on the pattern. - -The `grainline` macro will automatically show or hide the grainline -indicator based on the `complete` setting. - -### Removing the grainline indicator - -If you inherit a part with a grainline indicator and you'd like to remove it, -you can do so by passing `false` to the macro: - -```js -macro('grainline', false) -``` diff --git a/markdown/dev/reference/macros/hd/en.md b/markdown/dev/reference/macros/hd/en.md index 729a8e908a2..9b457a9d55b 100644 --- a/markdown/dev/reference/macros/hd/en.md +++ b/markdown/dev/reference/macros/hd/en.md @@ -3,19 +3,22 @@ title: hd --- The `hd` macro adds a _horizontal dimension_ to your pattern. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('hd', { - String id, + String id = 'hd', Point from, Boolean noEndMarker, Boolean noStartMarker, String text, Point to, Number y, + Boolean force = false, }) ``` @@ -28,7 +31,8 @@ macro('hd', { macro('hd', { from: new Point(0,0), to: new Point(100,0), - y:15, + y: 15, + force: 1, }) return part @@ -43,23 +47,13 @@ macro('hd', { | `from` | | [Point](/reference/api/point) | The startpoint of the dimension | | `to` | | [Point](/reference/api/point) | The endpoint of the dimension | | `y` | | Number | The Y-value at which to draw the dimension | -| `id` | auto-assigned | String | A custom ID under which paths and points will be created | +| `id` | `hd` | `string` | The ID of this macro instance | | `text` | Horizontal distance | Number | The text to go on the dimension if not the from-to horizontal distance | | `noStartMarker` | `false` | Boolean | Whether to not draw a start marker | | `noEndMarker` | `false` | Boolean | Whether to not draw an end marker | - -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.${id}` | Path for the span of the dimension | -| `paths.${id}_ls` | Path for the leader to the start of the dimension | -| `paths.${id}_le` | Path for the leader to the end of the dimension | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `paperless` is `false` | ## Notes -Setting a custom ID will: - -- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) -- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) +This macro takes the `paperless` setting into account and won't output anything when both `paperless` and `force` are `false`. diff --git a/markdown/dev/reference/macros/ld/en.md b/markdown/dev/reference/macros/ld/en.md index 4963832a2e9..fad8a016670 100644 --- a/markdown/dev/reference/macros/ld/en.md +++ b/markdown/dev/reference/macros/ld/en.md @@ -3,19 +3,22 @@ title: ld --- The `ld` macro adds a _linear dimension_ to your pattern. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('ld', { Number d, - String id, + String id = 'ld', Point from, Boolean noEndMarker, Boolean noStartMarker, String text, Point to, + Boolean force = false, }) ``` @@ -29,6 +32,7 @@ macro('ld', { from: new Point(0,0), to: new Point(100,20), d:15, + force: true, }) return part @@ -43,22 +47,12 @@ macro('ld', { | `from` | | [Point](/reference/api/point) | The startpoint of the dimension | | `to` | | [Point](/reference/api/point) | The endpoint of the dimension | | `d` | 0 | Number | The offset at which to draw the dimension | -| `id` | auto-assigned | String | A custom ID under which paths and points will be created | +| `id` | `ld` | `string` | The ID of this macro instance | | `text` | Linear distance | Number | The text to go on the dimension if not the from-to linear distance | | `noStartMarker` | `false` | Boolean | Whether to not draw a start marker | | `noEndMarker` | `false` | Boolean | Whether to not draw an end marker | - -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.${id}` | Path for the span of the dimension | -| `paths.${id}_ls` | Path for the leader to the start of the dimension | -| `paths.${id}_le` | Path for the leader to the end of the dimension | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `paperless` is `false` | ## Notes -Setting a custom ID will: - -- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) -- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) +This macro takes the `paperless` setting into account and won't output anything when both `paperless` and `force` are `false`. diff --git a/markdown/dev/reference/macros/miniscale/en.md b/markdown/dev/reference/macros/miniscale/en.md index b84e19744f6..335ad25b773 100644 --- a/markdown/dev/reference/macros/miniscale/en.md +++ b/markdown/dev/reference/macros/miniscale/en.md @@ -1,5 +1,5 @@ --- -title: miniscale +title: miniScale --- The `miniscale` macro adds a mini _scale box_ to your pattern. This box allows @@ -7,9 +7,10 @@ users to verify their pattern is printed to scale. The white inside of the box provides a metric scale, and the black outside of the box provides an imperial scale. -The `miniscale` macro is provided by the [annotations -plugin](/reference/plugins/annotations). -It is the mini version of [the scalebox macro](/reference/macros/scalebox/). +A miniscale is the mini version of [the scalebox macro](/reference/macros/scalebox/). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature @@ -17,6 +18,7 @@ It is the mini version of [the scalebox macro](/reference/macros/scalebox/). macro('miniscale', { Point at, Number rotate, + Boolean force = false, }) ``` @@ -41,23 +43,8 @@ macro('miniscale', { |------------:|---------|---------------------|-------------| | `at` | | [Point](/reference/api/point) | The point to anchor the _scale box_ on | | `rotate` | 0 | Number | Rotation in degrees | - -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.__miniscaleImperial` | Path of the imperial, outer box | -| `paths.__miniscaleMetric` | Path of the metric, inner box | -| `points.__miniscaleImperial` | Point anchoring the imperial text | -| `points.__miniscaleMetric` | Point anchoring the metric text | -| `points.__miniscale[Metric/Imperial][Top/Bottom][Left/Right]` | Points for the corners of the boxes | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | ## Notes -If you inherit a part with a miniscale on it and you'd like to remove all -points and paths generated by the miniscale macro, you can do so by passing -`false` to the macro: - -```js -macro('miniscale', false) -``` +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. diff --git a/markdown/dev/reference/macros/mirror/en.md b/markdown/dev/reference/macros/mirror/en.md index 1c3cfb483dc..af48fb42e04 100644 --- a/markdown/dev/reference/macros/mirror/en.md +++ b/markdown/dev/reference/macros/mirror/en.md @@ -2,8 +2,10 @@ title: mirror --- -The `mirror` macro allows you to mirror points and/or paths around a mirror -line. It is provided by the [mirror plugin](/reference/plugins/mirror/). +The `mirror` macro allows you to mirror points and/or paths around a mirror line. + +It is provided by the [mirror plugin](/reference/plugins/mirror/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature @@ -61,12 +63,3 @@ macro('mirror', { | `prefix` | `mirrored` | `string` | A prefix to apply to the names of the clones points and or paths. Ignored if `nameFormat` is set | | `nameFormat` | | `function` | A method that receives the name of the path or point as a first argument and one of `path` or `point` as the second argument and should return the name for the cloned path and or point | -## Result - -If `nameFormat` is set, its method determines the names of cloned, mirrored Points and Paths. -If it is not set, the names are as below. - -| Generated Element | Description | -|-------------------|-------------| -| `paths.${prefix}${Pathname}` | The cloned, mirrored Path(s) (with the first letter of pathname capitalized) | -| `points.${prefix}${Pointname}` | The cloned, mirrored Point(s) (with the first letter of pointname capitalized) | diff --git a/markdown/dev/reference/macros/pd/en.md b/markdown/dev/reference/macros/pd/en.md index e2c31492a15..b9103b821d4 100644 --- a/markdown/dev/reference/macros/pd/en.md +++ b/markdown/dev/reference/macros/pd/en.md @@ -4,7 +4,9 @@ title: pd The `pd` macro adds a _path dimension_ to your pattern, indicating the length of a path. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature @@ -16,6 +18,7 @@ macro('pd', { Boolean noEndMarker, Boolean noStartMarker, String text, + Boolean force = false, }) ``` @@ -32,6 +35,7 @@ macro('pd', { macro('pd', { path: paths.example, d: 15, + force: true, }) return part @@ -46,21 +50,12 @@ macro('pd', { | `path` | | [Path](/reference/api/path) | The path to draw the dimension along | | `d` | 10 | Number | The offset at which to draw the dimension | | `text` | Path length | Number | The text to go on the dimension if not the length of the path | -| `id` | auto-assigned | String | A custom ID under which paths and points will be created | +| `id` | `pd` | `string` | The ID of this macro instance | | `noStartMarker` | `false` | Boolean | Whether to not draw a start marker | | `noEndMarker` | `false` | Boolean | Whether to not draw an end marker | - -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.${id}` | Path for the span of the dimension | -| `paths.${id}_ls` | Path for the leader to the start of the dimension | -| `paths.${id}_le` | Path for the leader to the end of the dimension | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `paperless` is `false` | ## Notes -Setting a custom ID will: +This macro takes the `paperless` setting into account and won't output anything when both `paperless` and `force` are `false`. -- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) -- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) diff --git a/markdown/dev/reference/macros/pleat/en.md b/markdown/dev/reference/macros/pleat/en.md index 64dc4094514..f78f25dfd12 100644 --- a/markdown/dev/reference/macros/pleat/en.md +++ b/markdown/dev/reference/macros/pleat/en.md @@ -7,17 +7,25 @@ lines perpendicular to the line going from `from` to `to`. The `pleat` macro follows the convention of paths being counter-clockwise to determine what is the inside or outside of the part. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('pleat', { + String id = 'pleat', Point from, Point to, - String prefix = 'pleat', Number margin = 35, Boolean reverse = false, + Boolean force = false, + Object calsses = { + arrow: 'note', + from: 'note', + to: 'note dashed', + }, + }) ``` @@ -35,7 +43,7 @@ macro('pleat', { .attr('class', 'fabric') points.from = new Point(40,0) - points.to = new Point(30,0) + points.to = new Point(10,0) macro('pleat', { from: points.from, @@ -52,19 +60,16 @@ macro('pleat', { | Property | Default | Type | Description | |----------------:|----------|---------------------|-------------| | `from` | | [Point](/reference/api/point) | The start point of the pleat | +| `id` | `pleat` | `string` | The ID of this macro instance | | `to` | | [Point](/reference/api/point) | The end point of the pleat | -| `prefix` | 'pleat' | String | The prefix to be used for creating all the points and paths | | `margin` | 35 | Number | The size (in mm) of the pleat lines | | `reverse` | `false` | Boolean | Reverses the two pleat lines and the arrow | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | +| `classes.arrow` | `note` | `string` | CSS classes to apply to the arrow | +| `classes.from` | `note` | `string` | CSS classes to apply to the line at the `from` point | +| `classes.to` | `note dashed` | `string` | CSS classes to apply to the line at the `to` point | -## Result +## Notes + +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. -| Generated Element | Description | -|-------------------|-------------| -| `points.${prefix}From` | Copy of the `from` Point | -| `points.${prefix}To` | Copy of the `to` Point | -| `points.${prefix}FromIn` | Point for the inside of the `from` path | -| `points.${prefix}ToIn` | Point for the inside of the `to` path | -| `paths.${prefix}PleatFrom` | Path forming the from line | -| `paths.${prefix}PleatTo` | Path forming the to line | -| `paths.${prefix}PleatArrow` | Path forming the arrow | diff --git a/markdown/dev/reference/macros/ringsector/en.md b/markdown/dev/reference/macros/ringsector/en.md index a637abb3f46..5b757b9a56d 100644 --- a/markdown/dev/reference/macros/ringsector/en.md +++ b/markdown/dev/reference/macros/ringsector/en.md @@ -1,5 +1,5 @@ --- -title: ringsector +title: ringSector --- The `ringsector` macro drafts a ring sector, which is like a part of a donut @@ -20,6 +20,7 @@ if you want to use it. ```js macro('ringsector', { + String id='ringsector', Point center = new Point(0,0), Number angle, Number insideRadius, @@ -50,6 +51,7 @@ macro('ringsector', { | Property | Default | Type | Description | |---------------:|-------------------|------------|-------------| +| `id` | `ringsector` | `string` | The ID of this macro instance | | `center` | `new Point(0,0)` | [Point][1] | The center point of the ring sector | | `angle` | | Number | The angle the ring sector should cover | | `insideRadius` | | Number | The inside radius of the ring sector | @@ -61,17 +63,6 @@ macro('ringsector', { ## Notes -### Nodes generated by this macro - -This macro will add points and a single path to your part. -Their IDs will be saved in store under: -`parts.{part.name}.macros.@freesewing/plugin-ringsector.ids.{id}` - -### Removing a ring sector - -If you inherit a part with a ring sector drafted by this macro and you'd like to remove it, - -you can do so with [the rmringsector macro](/reference/macros/rmringsector). ### Example when rotate=true diff --git a/markdown/dev/reference/macros/rmad/en.md b/markdown/dev/reference/macros/rmad/en.md index 5682686fcd7..de4c01c0372 100644 --- a/markdown/dev/reference/macros/rmad/en.md +++ b/markdown/dev/reference/macros/rmad/en.md @@ -1,41 +1,14 @@ --- -title: rmad +title: rmaD --- -The `rmad` macro removes all dimensions with the exception of those that were -created with a custom ID. -It is provided by the [annotations plugin](/reference/plugins/annotations). +The `rmad` macro removes all dimensions (all nodes created by `hd`, `vd`, `ld`, and `pd` macros). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('rmad') ``` - -## Example - - -```js -({ Point, macro, part }) => { - - // This will be removed - macro('ld', { - from: new Point(10, 0), - to: new Point(40, 0), - d: 5, - }) - - // This will not removed - macro('ld', { - from: new Point(10, 20), - to: new Point(80, 20), - d: 5, - id: 'example' // custom ID - }) - - macro('rmad') - - return part -} -``` - diff --git a/markdown/dev/reference/macros/rmahd/en.md b/markdown/dev/reference/macros/rmahd/en.md new file mode 100644 index 00000000000..8018e8b9d73 --- /dev/null +++ b/markdown/dev/reference/macros/rmahd/en.md @@ -0,0 +1,14 @@ +--- +title: rmaHd +--- + +The `rmahd` macro removes all horizontal dimensions (all nodes created by `hd` macros). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmahd') +``` diff --git a/markdown/dev/reference/macros/rmald/en.md b/markdown/dev/reference/macros/rmald/en.md new file mode 100644 index 00000000000..ca52a1e7c0c --- /dev/null +++ b/markdown/dev/reference/macros/rmald/en.md @@ -0,0 +1,14 @@ +--- +title: rmaLd +--- + +The `rmald` macro removes all linear dimensions (all nodes created by `ld` macros). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmald') +``` diff --git a/markdown/dev/reference/macros/rmapd/en.md b/markdown/dev/reference/macros/rmapd/en.md new file mode 100644 index 00000000000..b8e2f8e766d --- /dev/null +++ b/markdown/dev/reference/macros/rmapd/en.md @@ -0,0 +1,14 @@ +--- +title: rmaPd +--- + +The `rmapd` macro removes all path dimensions (all nodes created by `pd` macros). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmapd') +``` diff --git a/markdown/dev/reference/macros/rmavd/en.md b/markdown/dev/reference/macros/rmavd/en.md new file mode 100644 index 00000000000..28194eea0c1 --- /dev/null +++ b/markdown/dev/reference/macros/rmavd/en.md @@ -0,0 +1,14 @@ +--- +title: rmaVd +--- + +The `rmaVd` macro removes all path dimensions (all nodes created by `vd` macros). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmavd') +``` diff --git a/markdown/dev/reference/macros/rmbanner/en.md b/markdown/dev/reference/macros/rmbanner/en.md new file mode 100644 index 00000000000..109166f667f --- /dev/null +++ b/markdown/dev/reference/macros/rmbanner/en.md @@ -0,0 +1,16 @@ +--- +title: rmBanner +--- + +The `rmBanner` macro removes the nodes added by [the banner macro](/reference/macros/banner). +It is the recommended way to remove (the effects of) a `banner` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmBanner', id = 'banner') +``` + diff --git a/markdown/dev/reference/macros/rmbannerbox/en.md b/markdown/dev/reference/macros/rmbannerbox/en.md new file mode 100644 index 00000000000..385f9547e03 --- /dev/null +++ b/markdown/dev/reference/macros/rmbannerbox/en.md @@ -0,0 +1,15 @@ +--- +title: rmBannerBox +--- + +The `rmBannerBox` macro removes the nodes added by [the bannerBox macro](/reference/macros/bannerbox). +It is the recommended way to remove (the effects of) a `bannerBox` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmBannerBox', id = 'bannerbox') +``` diff --git a/markdown/dev/reference/macros/rmbartack/en.md b/markdown/dev/reference/macros/rmbartack/en.md new file mode 100644 index 00000000000..b0ffb6a7ba4 --- /dev/null +++ b/markdown/dev/reference/macros/rmbartack/en.md @@ -0,0 +1,16 @@ +--- +title: rmBartack +--- + +The `rmBartack` macro removes the nodes added by [the bartack macro](/reference/macros/bartack). +It is the recommended way to remove (the effects of) a `bartack` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmBartack', id = 'bartack') +``` + diff --git a/markdown/dev/reference/macros/rmbartackalong/en.md b/markdown/dev/reference/macros/rmbartackalong/en.md new file mode 100644 index 00000000000..3996c55e98d --- /dev/null +++ b/markdown/dev/reference/macros/rmbartackalong/en.md @@ -0,0 +1,15 @@ +--- +title: rmBartackAlong +--- + +The `rmBartackAlong` macro removes the nodes added by [the bartackAlong macro](/reference/macros/bartackalong). +It is the recommended way to remove (the effects of) a `bartackAlong` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmBartackAlong', id = 'bartack') +``` diff --git a/markdown/dev/reference/macros/rmbartackfractionalong/en.md b/markdown/dev/reference/macros/rmbartackfractionalong/en.md new file mode 100644 index 00000000000..bd4ccb991f6 --- /dev/null +++ b/markdown/dev/reference/macros/rmbartackfractionalong/en.md @@ -0,0 +1,15 @@ +--- +title: rmBartackFractionAlong +--- + +The `rmBartackFractionAlong` macro removes the nodes added by [the bartackFractionAlong macro](/reference/macros/bartackfractionalong). +It is the recommended way to remove (the effects of) a `bartackFractionAlong` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmBartackFractionAlong', id = 'bartack') +``` diff --git a/markdown/dev/reference/macros/rmcrossbox/en.md b/markdown/dev/reference/macros/rmcrossbox/en.md new file mode 100644 index 00000000000..a259b2a9946 --- /dev/null +++ b/markdown/dev/reference/macros/rmcrossbox/en.md @@ -0,0 +1,15 @@ +--- +title: rmCrossBox +--- + +The `rmCrossBox` macro removes the nodes added by [the crossBox macro](/reference/macros/crossbox). +It is the recommended way to remove (the effects of) a `crossbox` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmCrossBox', id = 'crossbox') +``` diff --git a/markdown/dev/reference/macros/rmcutonfold/en.md b/markdown/dev/reference/macros/rmcutonfold/en.md new file mode 100644 index 00000000000..6e44c981ae6 --- /dev/null +++ b/markdown/dev/reference/macros/rmcutonfold/en.md @@ -0,0 +1,15 @@ +--- +title: rmCutOnFold +--- + +The `rmCutOnFold` macro removes the nodes added by [the cutOnFold macro](/reference/macros/cutonfold). +It is the recommended way to remove (the effects of) a `cutOnFold` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmCutOnFold', id = 'cutonfold') +``` diff --git a/markdown/dev/reference/macros/rmd/en.md b/markdown/dev/reference/macros/rmd/en.md deleted file mode 100644 index 8e2c14a81c7..00000000000 --- a/markdown/dev/reference/macros/rmd/en.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: rmd ---- - -The `rmd` macro removes a dimension. -It is provided by the [annotations plugin](/reference/plugins/annotations). - -To be able to use this plugin, you need to give your dimension an id: - -## Signature - -```js -macro('rmd', { - String id -}) -``` - -## Example - - -```js -({ Point, macro, part }) => { - - macro('ld', { - from: new Point(10, 0), - to: new Point(40, 0), - d: 5, - id: 'da', - }) - - macro('ld', { - from: new Point(10, 20), - to: new Point(80, 20), - d: 5, - id: 'db', - }) - - macro('rmd', { id: 'db' }) - - return part -} -``` - - -## Configuration - -| Property | Default | Type | Description | -|----------|---------|----------|-------------| -| `id` | | `string` | The id of the dimension to remove | diff --git a/markdown/dev/reference/macros/rmgrainline/en.md b/markdown/dev/reference/macros/rmgrainline/en.md new file mode 100644 index 00000000000..405ba6431c0 --- /dev/null +++ b/markdown/dev/reference/macros/rmgrainline/en.md @@ -0,0 +1,15 @@ +--- +title: rmGrainline +--- + +The `rmGrainline` macro removes the nodes added by [the grainline macro](/reference/macros/grainline). +It is the recommended way to remove (the effects of) a `grainline` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmGrainline', id = 'grainline') +``` diff --git a/markdown/dev/reference/macros/rmhd/en.md b/markdown/dev/reference/macros/rmhd/en.md new file mode 100644 index 00000000000..b4a58d6ebe7 --- /dev/null +++ b/markdown/dev/reference/macros/rmhd/en.md @@ -0,0 +1,15 @@ +--- +title: rmHd +--- + +The `rmHd` macro removes the nodes added by [the hd macro](/reference/macros/hd). +It is the recommended way to remove (the effects of) a `hd` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmHd', id = 'hd') +``` diff --git a/markdown/dev/reference/macros/rmld/en.md b/markdown/dev/reference/macros/rmld/en.md new file mode 100644 index 00000000000..f6de38cfee0 --- /dev/null +++ b/markdown/dev/reference/macros/rmld/en.md @@ -0,0 +1,15 @@ +--- +title: rmLd +--- + +The `rmLd` macro removes the nodes added by [the ld macro](/reference/macros/ld). +It is the recommended way to remove (the effects of) a `ld` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmLd', id = 'ld') +``` diff --git a/markdown/dev/reference/macros/rmminiscale/en.md b/markdown/dev/reference/macros/rmminiscale/en.md new file mode 100644 index 00000000000..0fef7f4bd3f --- /dev/null +++ b/markdown/dev/reference/macros/rmminiscale/en.md @@ -0,0 +1,15 @@ +--- +title: rmMiniScale +--- + +The `rmMiniscale` macro removes the nodes added by [the miniscale macro](/reference/macros/miniscale). +It is the recommended way to remove (the effects of) a `miniscale` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmMiniscale', id = 'miniscale') +``` diff --git a/markdown/dev/reference/macros/rmpd/en.md b/markdown/dev/reference/macros/rmpd/en.md new file mode 100644 index 00000000000..e7845356621 --- /dev/null +++ b/markdown/dev/reference/macros/rmpd/en.md @@ -0,0 +1,15 @@ +--- +title: rmPd +--- + +The `rmPd` macro removes the nodes added by [the pd macro](/reference/macros/pd). +It is the recommended way to remove (the effects of) a `pd` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmPd', id = 'pd') +``` diff --git a/markdown/dev/reference/macros/rmpleat/en.md b/markdown/dev/reference/macros/rmpleat/en.md new file mode 100644 index 00000000000..95d2230b3d3 --- /dev/null +++ b/markdown/dev/reference/macros/rmpleat/en.md @@ -0,0 +1,15 @@ +--- +title: rmPleat +--- + +The `rmPleat` macro removes the nodes added by [the pleat macro](/reference/macros/pleat). +It is the recommended way to remove (the effects of) a `pleat` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmPleat', id = 'pleat') +``` diff --git a/markdown/dev/reference/macros/rmringsector/en.md b/markdown/dev/reference/macros/rmringsector/en.md index b4f428e6db2..5392cc16f24 100644 --- a/markdown/dev/reference/macros/rmringsector/en.md +++ b/markdown/dev/reference/macros/rmringsector/en.md @@ -1,5 +1,5 @@ --- -title: rmringsector +title: rmRingSector --- The `rmringsector` macro removes the nodes added by [the ringsector macro](/reference/macros/ringsector). @@ -21,36 +21,3 @@ if you want to use it. macro('rmringsector', String id = 'ringsector') ``` -## Example - - -```js -({ Point, macro, Path, paths, part }) => { - - macro('ringsector', { - angle: 60, - insideRadius: 30, - outsideRadius: 45, - }) - macro('rmringsector') - - return part -} -``` - - -## Configuration - -| Property | Default | Type | Description | -|---------:|--------------|--------|-------------| -| `id` | `ringsector` | String | The id of the ringsector macro to remove | - -## Notes - -### Nodes removed by this macro - -This macro will remove points and a single path from your part. -Their IDs have been saved in store under: -`parts.{part.name}.macros.@freesewing/plugin-ringsector.ids.{id}` -by the [the ringsector macro](/reference/macros/ringsector). - diff --git a/markdown/dev/reference/macros/rmscalebox/en.md b/markdown/dev/reference/macros/rmscalebox/en.md new file mode 100644 index 00000000000..c6b0b32aa9b --- /dev/null +++ b/markdown/dev/reference/macros/rmscalebox/en.md @@ -0,0 +1,15 @@ +--- +title: rmScaleBox +--- + +The `rmScalebox` macro removes the nodes added by [the scalebox macro](/reference/macros/scalebox). +It is the recommended way to remove (the effects of) a `scalebox` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmScalebox', id = 'scalebox') +``` diff --git a/markdown/dev/reference/macros/rmsewtogether/en.md b/markdown/dev/reference/macros/rmsewtogether/en.md new file mode 100644 index 00000000000..3554c0ae068 --- /dev/null +++ b/markdown/dev/reference/macros/rmsewtogether/en.md @@ -0,0 +1,15 @@ +--- +title: rmSewTogether +--- + +The `rmSewTogether` macro removes the nodes added by [the sewTogether macro](/reference/macros/sewtogether). +It is the recommended way to remove (the effects of) a `sewtogether` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmSewTogether', id = 'sewtogether') +``` diff --git a/markdown/dev/reference/macros/rmtitle/en.md b/markdown/dev/reference/macros/rmtitle/en.md new file mode 100644 index 00000000000..4af9a9521c5 --- /dev/null +++ b/markdown/dev/reference/macros/rmtitle/en.md @@ -0,0 +1,15 @@ +--- +title: rmTitle +--- + +The `rmTitle` macro removes the nodes added by [the title macro](/reference/macros/title). +It is the recommended way to remove (the effects of) a `title` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmTitle', id = 'title') +``` diff --git a/markdown/dev/reference/macros/rmvd/en.md b/markdown/dev/reference/macros/rmvd/en.md new file mode 100644 index 00000000000..c7606b83349 --- /dev/null +++ b/markdown/dev/reference/macros/rmvd/en.md @@ -0,0 +1,15 @@ +--- +title: rmVd +--- + +The `rmVd` macro removes the nodes added by [the vd macro](/reference/macros/vd). +It is the recommended way to remove (the effects of) a `vd` macro. + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Signature + +```js +macro('rmVd', id = 'vd') +``` diff --git a/markdown/dev/reference/macros/round/en.md b/markdown/dev/reference/macros/round/en.md index f0c1dd7e7b4..c8a8f14e333 100644 --- a/markdown/dev/reference/macros/round/en.md +++ b/markdown/dev/reference/macros/round/en.md @@ -2,13 +2,16 @@ title: round --- -The `round` macro creates a rounded corner. It is provided by the [round -plugin](/reference/plugins/round/). +The `round` macro creates a rounded corner. + +It is provided by [plugin-round](/reference/plugins/round), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('round', { + String id = 'round', String class, Point from, Boolean hide, @@ -42,6 +45,7 @@ macro('round', { | Property | Default | Type | Description | |------------:|---------|---------------------|-------------| +| `id` | `round` | `string` | The ID of this macro instance | | `from` | | [Point](/reference/api/point) | The startpoint towards the corner to round | | `to` | | [Point](/reference/api/point) | The endpoint away from the corner to round | | `via` | | [Point](/reference/api/point) | The cornerpoint to round | @@ -50,15 +54,6 @@ macro('round', { | `hide` | `true` | Boolean | Whether to hide the path created by this macro | | `class` | | String | Class(es) to assign to the path created by this macro | -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.${prefix}Rounded` | Path for the rounded corner | -| `points.${prefix}Start` | Point for the start of the rounded corner | -| `points.${prefix}End` | Point for the end of the rounded corner | -| `points.${prefix}Cp1` | Control Point used to create the curved path | -| `points.${prefix}Cp2` | Control Point used to create the curved path | ## Notes diff --git a/markdown/dev/reference/macros/scalebox/en.md b/markdown/dev/reference/macros/scalebox/en.md index 51a7975776c..d927fb870d1 100644 --- a/markdown/dev/reference/macros/scalebox/en.md +++ b/markdown/dev/reference/macros/scalebox/en.md @@ -7,18 +7,20 @@ to verify their pattern is printed to scale. The white inside of the box provides a metric scale, and the black outside of the box provides an imperial scale. -The `scalebox` macro is is provided by the [annotations -plugin](/reference/plugins/annotations). +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('scalebox', { + String id = 'scalebox', Point at, String lead, Number rotate, String text, String title, + Boolean force = false, }) ``` @@ -43,34 +45,16 @@ macro('scalebox', { | Property | Default | Type | Description | |------------:|---------|---------------------|-------------| +| `id` | `scalebox` | `string` | The ID of this macro instance | | `at` | | [Point](/reference/api/point) | The point to anchor the _scale box_ on | | `lead` | FreeSewing | String | The lead text above the title | | `title` | _pattern name + version_ | String | The title text | | `text` | (\*) | String | The text below the title | | `rotate` | 0 | Number | Rotation in degrees | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | (\*) `freesewingIsMadeByJoostDeCockAndContributors \n withTheFinancialSupportOfOurPatrons` -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.__scaleboxImperial` | Path of the imperial, outer box | -| `paths.__scaleboxMetric` | Path of the metric, inner box | -| `points.__scaleboxLead` | Point anchoring the lead text above the title | -| `points.__scaleboxTitle` | Point anchoring the title text | -| `points.__scaleboxTitle` | Point anchoring the text below the title | -| `points.__scaleboxImperial` | Point anchoring the imperial text | -| `points.__scaleboxMetric` | Point anchoring the metric text | -| `points.__scalebox[Metric/Imperial][Top/Bottom][Left/Right]` | Points for the corners of the boxes | - ## Notes -### Removing the scalebox - -If you inherit a part with a scalebox on it and you'd like to remove all points and paths -generated by the scalebox macro, you can do so by passing `false` to the macro: - -```js -macro('scalebox', false) -``` +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. diff --git a/markdown/dev/reference/macros/sewtogether/en.md b/markdown/dev/reference/macros/sewtogether/en.md index f653fe22f0d..2c29fd9c6dc 100644 --- a/markdown/dev/reference/macros/sewtogether/en.md +++ b/markdown/dev/reference/macros/sewtogether/en.md @@ -5,17 +5,20 @@ title: sewTogether The `sewTogether` macro is used to mark where two parts of the same `part` need to be sewn together. This happens when you want to construct a cone for instance. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('sewTogether', { + String id = 'sewtogether', Point from, Point to, Point middle = null, Boolean hinge = false, String prefix = 'sewtogether', + Boolean force = false, }) ``` @@ -54,28 +57,19 @@ macro('sewTogether', { | Property | Default | Type | Description | |----------------:|----------|---------------------|-------------| +| `id` | `sewtogether` | `string` | The ID of this macro instance | | `from` | | [Point](/reference/api/point) | One side of what needs to be sewn together | | `to` | | [Point](/reference/api/point) | The other side of what needs to be sewn together | | `middle` | null | [Point](/reference/api/point) | The middle point (when ommitted, it will be halfway between `from` and `to`) | | `prefix` | 'sewtogether' | String | The prefix to be used for creating all the points and paths | | `hinge ` | `false` | Boolean | Draws the hinge line | - -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `points.${prefix}From` | Copy of the `from` Point | -| `points.${prefix}FromCP` | Control Point of the `from` Point | -| `points.${prefix}Middle` | Copy of the `middle` Point | -| `points.${prefix}To` | Copy of the `to` Point | -| `points.${prefix}ToCP` | Control Point of the `to` Point | -| `points.${prefix}Hinge` | Point for the hinge line | -| `paths.${prefix}SewTogether` | Path forming the line | -| `paths.${prefix}SewTogetherHinge` | Path forming the hinge line | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | ## Notes +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. + This macro is aware of the `sa` setting. Normally it draws the hinge line on the inside of the part (following the counter-clockwise standard). When the `sa` is provided it draws the hinge line on the -outside, up to the `sa` line. \ No newline at end of file +outside, up to the `sa` line. diff --git a/markdown/dev/reference/macros/sprinkle/en.md b/markdown/dev/reference/macros/sprinkle/en.md index d769e2cd38b..7ca3e5db422 100644 --- a/markdown/dev/reference/macros/sprinkle/en.md +++ b/markdown/dev/reference/macros/sprinkle/en.md @@ -3,7 +3,9 @@ title: sprinkle --- The `sprinkle` macro facilitates adding snippets to your pattern in bulk. -It is provided by the [sprinkle plugin](/reference/plugins/sprinkle). + +It is provided by [plugin-sprinkle](/reference/plugins/sprinkle), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature @@ -54,8 +56,3 @@ macro('sprinkle', { | `scale` | 1 | number | Scale for the individual Snippets | | `rotate` | 0 | number | Rotation for the individual Snippets | -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `snippets.${pointname}-${snippet}` | The Snippet(s) created | diff --git a/markdown/dev/reference/macros/title/en.md b/markdown/dev/reference/macros/title/en.md index acdd7abb95e..9bd0638f486 100644 --- a/markdown/dev/reference/macros/title/en.md +++ b/markdown/dev/reference/macros/title/en.md @@ -3,12 +3,15 @@ title: title --- The `title` macro adds a title to a pattern part. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('title', { + String id = 'title', String align, Boolean append, Point at, @@ -18,6 +21,7 @@ macro('title', { Number rotation, Number scale, String title, + Boolean force = false, }) ``` @@ -56,19 +60,15 @@ macro('title', { | `append` | `false` | Boolean | Set this to `true` to append the `nr` to any text already set in Point `at`'s attributes, rather than overwrite it | | `at` | | [Point](/reference/api/point) | The point at which to insert the title | | `cutlist` | `true` | Boolean | Whether to include cutting instructions | +| `id` | `title` | `string` | The ID of this macro instance | | `nr` | | String | The number of the pattern part | | `title` | | String | The name of the pattern part. If title is not set or is an empty string, this won't be rendered, and the version will go beneath the nr.| | `prefix` | | String | A prefix to add to the created points. This allow for more than 1 title per part, as long as you give them a different prefix.| | `rotation` | 0 | Number | An optional rotation in degrees | | `scale` | 1 | Number | An optional scaling factor | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `complete` is `false` | -## Result +## Notes + +This macro takes the `complete` setting into account and won't output anything when both complete and `force` are `false`. -| Generated Element | Description | -|-------------------|-------------| -| `points._${prefix}_titleNr` | Point anchoring the part number text | -| `points._${prefix}_titleName` | Point anchoring the part name text | -| `points._${prefix}_titleCut_${material}_${i}` | Points anchoring the cutting instructions, by material key and instruction index | -| `points._${prefix}_titlePattern` | Point anchoring the pattern name text | -| `points._${prefix}_titleFor` | Point anchoring the name of the person for whom the pattern was made, if that information exists | -| `points._${prefix}_exportDate` | Point anchoring the pattern export date | diff --git a/markdown/dev/reference/macros/vd/en.md b/markdown/dev/reference/macros/vd/en.md index 3de16b78ed0..20e2b074174 100644 --- a/markdown/dev/reference/macros/vd/en.md +++ b/markdown/dev/reference/macros/vd/en.md @@ -3,19 +3,22 @@ title: vd --- The `vd` macro adds a _vertical dimension_ to your pattern. -It is provided by the [annotations plugin](/reference/plugins/annotations). + +It is provided by [plugin-annotations](/reference/plugins/annotations), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Signature ```js macro('vd', { - String id, + String id = 'vd', Point from, Boolean noEndMarker, Boolean noStartMarker, String text, Point to, Number x, + Boolean force = false, }) ``` @@ -29,6 +32,7 @@ macro('vd', { from: new Point(0,0), to: new Point(0,40), x:10, + force: true, }) // Prevent clipping @@ -49,21 +53,11 @@ macro('vd', { | `to` | | [Point](/reference/api/point) | The endpoint of the dimension | | `x` | | Number | The X-value at which to draw the dimension | | `text` | Vertical distance | Number | The text to go on the dimension if not the from-to vertical distance | -| `id` | auto-assigned | String | A custom ID under which paths and points will be created | +| `id` | `vd` | `string` | The ID of this macro instance | | `noStartMarker` | `false` | Boolean | Whether to not draw a start marker | | `noEndMarker` | `false` | Boolean | Whether to not draw an end marker | - -## Result - -| Generated Element | Description | -|-------------------|-------------| -| `paths.${id}` | Path for the span of the dimension | -| `paths.${id}_ls` | Path for the leader to the start of the dimension | -| `paths.${id}_le` | Path for the leader to the end of the dimension | +| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `paperless` is `false` | ## Notes -Setting a custom ID will: - -- Allow removal of the dimension with [the `rmd` macro](/reference/macros/rmd) -- Prevent removal of the dimension with [the `rmad` macro](/reference/macros/rmad/) +This macro takes the `paperless` setting into account and won't output anything when both `paperless` and `force` are `false`. diff --git a/markdown/dev/reference/plugins/annotations/en.md b/markdown/dev/reference/plugins/annotations/en.md index c6a338ef96d..83d769f7ebf 100644 --- a/markdown/dev/reference/plugins/annotations/en.md +++ b/markdown/dev/reference/plugins/annotations/en.md @@ -3,18 +3,25 @@ title: plugin-annotations --- Published as [@freesewing/plugin-annotations][1], this plugin provides a -variety of macros and snippets to annotate designs. +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-start](/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) -- [bnotch](/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) @@ -28,7 +35,30 @@ The annotations plugin provides the following macros: - [hd](/reference/macros/hd) - [ld](/reference/macros/ld) - [rmad](/reference/macros/rmad) -- [rmd](/reference/macros/rmd) +- [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/rmsetogether) +- [rmtitle](/reference/macros/rmtitle) - [pd](/reference/macros/pd) - [pleat](/reference/macros/pleat) - [scalebox](/reference/macros/scalebox) @@ -36,28 +66,53 @@ The annotations plugin provides the following macros: - [title](/reference/macros/title) - [vd](/reference/macros/vd) -The annotations plugin also provides [methods to the Store for adding cutting instructions](#methods) - - For an in-depth look at how to add cutting instructions to your part, see our [cutlist how-to](/howtos/design/cutlist) +## 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 + + +This plugin is part of [core-plugins](/reference/plugins/core), so there is no +need to install it manually unless you want to forego loading of core plugins, +yet still want to load this plugin. + + ```sh npm install @freesewing/plugin-annotations ``` ## Usage + + +This plugin is part of [core-plugins](/reference/plugins/core), so there is no +need to load it manually unless you want to forego loading of core plugins, +yet still want to load this plugin. + + 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 { annotationsPlugin } from '@freesewing/plugin-banner' -// or -import { pluginAnnotations } from '@freesewing/plugin-banner' +import { plugin } from '@freesewing/plugin-annotations' ``` ## Methods diff --git a/markdown/dev/reference/plugins/bundle/en.md b/markdown/dev/reference/plugins/bundle/en.md deleted file mode 100644 index 439f719c8c9..00000000000 --- a/markdown/dev/reference/plugins/bundle/en.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: plugin-bundle ---- - -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-annotations](/reference/plugins/annotations) -- [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 - -## Installation - -```bash -npm install @freesewing/plugin-bundle -``` - -## 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 { 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/core/en.md b/markdown/dev/reference/plugins/core/en.md new file mode 100644 index 00000000000..965d9a7b905 --- /dev/null +++ b/markdown/dev/reference/plugins/core/en.md @@ -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) +- [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](/reference/plugins/binpack) : 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 diff --git a/markdown/dev/reference/plugins/en.md b/markdown/dev/reference/plugins/en.md index 7b60da8280c..ebebc241b1e 100644 --- a/markdown/dev/reference/plugins/en.md +++ b/markdown/dev/reference/plugins/en.md @@ -3,8 +3,9 @@ title: Plugins --- 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. +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 @@ -14,16 +15,18 @@ Plugins can be either To import a plugin for use: ```js -import { namePlugin } from { @freesewing/plugin-name } -// or -import { pluginName } from { @freesewing/plugin-name } +import { plugin } from { @freesewing/plugin-gore } ``` -For convenience, each plugin is exported in two name formats: -"plugin\" and "\Plugin". -For example, either `pluginBanner` or `bannerPlugin` can be used. +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. diff --git a/markdown/dev/reference/snippets/bnotch/en.md b/markdown/dev/reference/snippets/bnotch/en.md index 2f2c70f2804..b8c17b5ec6d 100644 --- a/markdown/dev/reference/snippets/bnotch/en.md +++ b/markdown/dev/reference/snippets/bnotch/en.md @@ -5,7 +5,8 @@ title: bnotch The `bnotch` snippet is intended for notches at the back, or when you need an alternative to the default `notch`. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/button/en.md b/markdown/dev/reference/snippets/button/en.md index 954b94b2cc8..d18a8c69200 100644 --- a/markdown/dev/reference/snippets/button/en.md +++ b/markdown/dev/reference/snippets/button/en.md @@ -4,7 +4,8 @@ title: button The `button` snippet is used to mark button placement. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/buttonhole-end/en.md b/markdown/dev/reference/snippets/buttonhole-end/en.md index 543c6387b0f..ab027f22835 100644 --- a/markdown/dev/reference/snippets/buttonhole-end/en.md +++ b/markdown/dev/reference/snippets/buttonhole-end/en.md @@ -6,8 +6,8 @@ The `buttonhole-end` snippet is used to mark buttonhole placement. This particular snippet places the buttonhole's end on its anchor point. -It is provided by [plugin-annotations](/reference/plugins/annotations/). - +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/buttonhole-start/en.md b/markdown/dev/reference/snippets/buttonhole-start/en.md index 5a3e703fe4d..4f11465aebc 100644 --- a/markdown/dev/reference/snippets/buttonhole-start/en.md +++ b/markdown/dev/reference/snippets/buttonhole-start/en.md @@ -6,8 +6,8 @@ The `buttonhole-start` snippet is used to mark buttonhole placement. This particular snippet places the buttonhole's start on its anchor point. -It is provided by [plugin-annotations](/reference/plugins/annotations/). - +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/buttonhole/en.md b/markdown/dev/reference/snippets/buttonhole/en.md index 11e9a50e67a..ee7b37730b0 100644 --- a/markdown/dev/reference/snippets/buttonhole/en.md +++ b/markdown/dev/reference/snippets/buttonhole/en.md @@ -6,8 +6,8 @@ The `buttonhole` snippet is used to mark buttonhole placement. This particular snippet places the buttonhole centrally on its anchor point. -It is provided by [plugin-annotations](/reference/plugins/annotations/). - +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/eyelet/en.md b/markdown/dev/reference/snippets/eyelet/en.md new file mode 100644 index 00000000000..2cf71de2e3e --- /dev/null +++ b/markdown/dev/reference/snippets/eyelet/en.md @@ -0,0 +1,27 @@ +--- +title: eyelet +--- + +The `eyelet` snippet is used to mark an eyelet, which is a small reinforced opening or hole. + +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + +## Example + + +```js +({ Point, Path, paths, Snippet, snippets, part }) => { + + snippets.demo = new Snippet('eyelet', new Point(0,0)) + + // Prevent clipping + paths.diag = new Path() + .move(new Point(-50,-4)) + .move(new Point(50,4)) + + return part +} +``` + + diff --git a/markdown/dev/reference/snippets/logo/en.md b/markdown/dev/reference/snippets/logo/en.md index cd7965c73fc..3247478a8fe 100644 --- a/markdown/dev/reference/snippets/logo/en.md +++ b/markdown/dev/reference/snippets/logo/en.md @@ -4,7 +4,8 @@ title: logo The `logo` snippet inserts the FreeSewing logo. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/notch/en.md b/markdown/dev/reference/snippets/notch/en.md index d33c5d01b27..86845120057 100644 --- a/markdown/dev/reference/snippets/notch/en.md +++ b/markdown/dev/reference/snippets/notch/en.md @@ -4,7 +4,8 @@ title: notch The `notch` snippet is intended for notches. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/snap-socket/en.md b/markdown/dev/reference/snippets/snap-socket/en.md index f70df5f36cf..4fd588f459e 100644 --- a/markdown/dev/reference/snippets/snap-socket/en.md +++ b/markdown/dev/reference/snippets/snap-socket/en.md @@ -4,7 +4,8 @@ title: snap-socket The `snap-socket` snippet is used to mark the socket part of a snap button. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). ## Example diff --git a/markdown/dev/reference/snippets/snap-stud/en.md b/markdown/dev/reference/snippets/snap-stud/en.md index 239a9129d5e..07383cb5d5a 100644 --- a/markdown/dev/reference/snippets/snap-stud/en.md +++ b/markdown/dev/reference/snippets/snap-stud/en.md @@ -4,7 +4,9 @@ title: snap-stud The `snap-stud` snippet is used to mark the stud part of a snap button. -It is provided by [plugin-annotations](/reference/plugins/annotations/). +It is provided by [plugin-annotations](/reference/plugins/annotations/), which is +part of [core-plugins](/reference/plugins/core) (so it is available by default). + ## Example diff --git "a/markdown/dev/reference/store-methods/\\" "b/markdown/dev/reference/store-methods/\\" new file mode 100644 index 00000000000..709181a4779 --- /dev/null +++ "b/markdown/dev/reference/store-methods/\\" @@ -0,0 +1,31 @@ +--- +title: removeMacroNodes() +--- + +Removes nodes generated by macro `id`. +By nodes, we mean paths, points, and so on that have been created by the macro. + +When a macro properly uses a combination of `generateMacroIds()` and +`storeMacroIds()`, this method will fully handle its removal. + +## Signature + +```mjs +Object store.removeMacroNodes( + String id, + macro = store.activeMacro, + part = store.activePart, +) +``` + +The method takes a (macro) id and removes all nodes created by this macro, +It uses the active macro and part from the store, Or you can pass in `macro` and `part` to not use the active macro or part. + +## Example + +```mjs +undefined store.removeMacroNodes('macroId') +``` + + + diff --git a/markdown/dev/reference/store-methods/en.md b/markdown/dev/reference/store-methods/en.md new file mode 100644 index 00000000000..1d7d60e9e34 --- /dev/null +++ b/markdown/dev/reference/store-methods/en.md @@ -0,0 +1,27 @@ +--- +title: Store Methods +--- + +Store methods are typically provided by plugins and attached to +the store to make them available during the drafting process. + +Some of FreeSewing's core library functionality is implemented +as store methods to allow plugins to override this functinoality. +Examples include log handling and pattern layout algorithm. + +All store methods below are either provided by plugins we maintain, +or are the default store methods as provided by the core library. + +## Signature + +```js +null method(object Store, object config) +``` + +A store method receives as its first parameter [the Store object](/reference/api/store), and +as second parameter a single configuration object for the method. + +## Store methods we maintain + + + diff --git a/markdown/dev/reference/store-methods/flag.error/en.md b/markdown/dev/reference/store-methods/flag.error/en.md new file mode 100644 index 00000000000..215083ab38c --- /dev/null +++ b/markdown/dev/reference/store-methods/flag.error/en.md @@ -0,0 +1,26 @@ +--- +title: flag.error() +--- + +This flags information at the `error` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.error`. +The core library does nothing with this info, it is merely stored, much like logs are. + +However, in our own UI on FreeSewing.org, we use this mechanism to allow +designer to flag information to the user, and even suggest changes to the +pattern configuration. + + +## Signature + +```js +undefined Store.flag.error({ + title: 'Oh no', + desc: 'Something went very wrong' +}) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/flag.fixme/en.md b/markdown/dev/reference/store-methods/flag.fixme/en.md new file mode 100644 index 00000000000..d64c09075d9 --- /dev/null +++ b/markdown/dev/reference/store-methods/flag.fixme/en.md @@ -0,0 +1,26 @@ +--- +title: flag.fixme() +--- + +This flags information at the `fixme` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.fixme`. +The core library does nothing with this info, it is merely stored, much like logs are. + +However, in our own UI on FreeSewing.org, we use this mechanism to allow +designer to flag information to the user, and even suggest changes to the +pattern configuration. + + +## Signature + +```js +undefined Store.flag.fixme({ + title: 'Not yet implemented', + desc: 'Something is unfinished' +}) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/flag.info/en.md b/markdown/dev/reference/store-methods/flag.info/en.md new file mode 100644 index 00000000000..394e6740ebe --- /dev/null +++ b/markdown/dev/reference/store-methods/flag.info/en.md @@ -0,0 +1,71 @@ +--- +title: flag.info() +--- + +This flags information at the `info` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.info`. +The core library does nothing with this info, it is merely stored, much like logs are. + +However, in our own UI on FreeSewing.org, we use this mechanism to allow +designer to flag information to the user, and even suggest changes to the +pattern configuration. + + +## Signature + +```js +undefined Store.flag.info({ + title: 'flag:expandIsOn.t', + desc: 'flag:expandIsOn.d', + suggest: { + text: 'flag:disable', + icon: 'expand', + update: { + settings: ['expand', null], + }, + }, +}) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. +The example above is from our implementation, which uses the following properties: + +## Configuration + +| Property | Type | Description | +| ----------:| ------------------- | ----------- | +| `id` | String | An ID for this flag message. If none is provided, `title` will be used | +| `title` | String | The title of the message | +| `desc` | String | The description of the message | +| `suggest.text` | String | Text to go on the button to implement the suggested configuration change | +| `suggest.icon` | String | Icon name to go on the button to implement the suggested configuration change | +| `suggest.update` | Object | Object describing the changes to apply to the configuration if the user accepts the suggestion | + +Note that the `suggest` object is optional. Without it, it will merely display a message to the user. +However, when a suggest key is present, a button will be created that the user can click to accept the suggested changes. + +## Example + +```js +({ store, part }) => { + store.flag.info({ + msg: `aaron:cutNeckBinding`, + notes: ['flag:saUnused', 'flag:partHiddenByExpand'], + replace: { + width: units(w), + length: units(l), + }, + suggest: { + text: 'flag:show', + icon: 'expand', + update: { + settings: ['expand', 1], + }, + }, + }) + + return part +} +``` + diff --git a/markdown/dev/reference/store-methods/flag.note/en.md b/markdown/dev/reference/store-methods/flag.note/en.md new file mode 100644 index 00000000000..96237cf8a29 --- /dev/null +++ b/markdown/dev/reference/store-methods/flag.note/en.md @@ -0,0 +1,26 @@ +--- +title: flag.note() +--- + +This flags information at the `note` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.note`. +The core library does nothing with this info, it is merely stored, much like logs are. + +However, in our own UI on FreeSewing.org, we use this mechanism to allow +designer to flag information to the user, and even suggest changes to the +pattern configuration. + + +## Signature + +```js +undefined Store.flag.note({ + title: 'Something good to know', + desc: 'Longer message here' +}) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/flag.preset/en.md b/markdown/dev/reference/store-methods/flag.preset/en.md new file mode 100644 index 00000000000..c7a2cc886cb --- /dev/null +++ b/markdown/dev/reference/store-methods/flag.preset/en.md @@ -0,0 +1,41 @@ +--- +title: flag.preset() +--- + +The `flag.preset()` method is a way to flag a pre-defined flag object. +There are currently two such pre-defined flags provided by the annotations-plugin: + +- `expandIsOn` +- `expandIsOff` + +They inform the user about the effect of the `expand` setting on the pattern, when `expand` +is on or off respectively. + +## Signature + +```js +undefined Store.flag.preset(string preset) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implemntation. +The example above is from our implementation, which uses the following properties: + +## Configuration + +| Property | Type | Description | +| ----------:| ------------------- | ----------- | +| `preset` | String | The ID of an existing preset | + +## Example + +```js +({ store, expand, part }) => { + store.flag.preset(expand + ? 'expandIsOn' + : 'expandIsOff' + ) + + return part +} +``` + diff --git a/markdown/dev/reference/store-methods/flag.tip/en.md b/markdown/dev/reference/store-methods/flag.tip/en.md new file mode 100644 index 00000000000..44751b1e384 --- /dev/null +++ b/markdown/dev/reference/store-methods/flag.tip/en.md @@ -0,0 +1,26 @@ +--- +title: flag.tip() +--- + +This flags information at the `tip` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.tip`. +The core library does nothing with this info, it is merely stored, much like logs are. + +However, in our own UI on FreeSewing.org, we use this mechanism to allow +designer to flag information to the user, and even suggest changes to the +pattern configuration. + + +## Signature + +```js +undefined Store.flag.tip({ + title: 'Something good to know', + desc: 'Longer message here' +}) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/flag.warn/en.md b/markdown/dev/reference/store-methods/flag.warn/en.md new file mode 100644 index 00000000000..6efc6fe595d --- /dev/null +++ b/markdown/dev/reference/store-methods/flag.warn/en.md @@ -0,0 +1,26 @@ +--- +title: flag.warn() +--- + +This flags information at the `warn` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.warn`. +The core library does nothing with this info, it is merely stored, much like logs are. + +However, in our own UI on FreeSewing.org, we use this mechanism to allow +designer to flag information to the user, and even suggest changes to the +pattern configuration. + + +## Signature + +```js +undefined Store.flag.warn({ + title: 'Something to be mindful of', + desc: 'Longer message here' +}) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/generatemacroids/en.md b/markdown/dev/reference/store-methods/generatemacroids/en.md new file mode 100644 index 00000000000..0272fffedcb --- /dev/null +++ b/markdown/dev/reference/store-methods/generatemacroids/en.md @@ -0,0 +1,37 @@ +--- +title: generateMacroIds() +--- + +The `generateMacroIds()` store method generates IDs to be used in macros. +It is the recommended way for macros that add nodes to the pattern (by nodes we +mean points, paths and so on) to avoid naming clashes. + +## Signature + +```mjs +Object store.generateMacroIds( + Array keys, + String id, + macro = store.activeMacro +) +``` + +The method takes a list of strings, and an ID which is typically the ID passed +to the macro. You can optionally specify the macro name via `macro` although +you almost certainly want to rely on the default behavior which is to load the +active macro name from the store. + +## Example + +```mjs +const ids = store.generateMacroIds( + [ + 'start', + 'end', + 'middle' + ], + 'macroId' +) +``` + + diff --git a/markdown/dev/reference/store-methods/getmacroids/en.md b/markdown/dev/reference/store-methods/getmacroids/en.md new file mode 100644 index 00000000000..a479732e002 --- /dev/null +++ b/markdown/dev/reference/store-methods/getmacroids/en.md @@ -0,0 +1,30 @@ +--- +title: getMacroIds() +--- + +Retrieve data for macro IDs generated via [`generateMacroIds()`](/reference/store-methods/generatemacroids) and stored +via [`storeMacroIds()`](/reference/store-methods/storemacroids). + +## Signature + +```mjs +Object store.getMacroIds( + String id, + macro = store.activeMacro, + part = store.activePart, +) +``` + +The method takes an id and retrieves the data stored under the macro IDs for the active macro and active part. + +Or, if you want to, you can pass in `macro` and `part` to not use the active macro or part. + +## Example + +```mjs +const ids = store.getMacroIds('macroId') +``` + +It is a best practice to return the result of this method from your macro. + + diff --git a/markdown/dev/reference/api/store/log/debug/en.md b/markdown/dev/reference/store-methods/log.debug/en.md similarity index 95% rename from markdown/dev/reference/api/store/log/debug/en.md rename to markdown/dev/reference/store-methods/log.debug/en.md index 53b3400f8d0..ad68526df5b 100644 --- a/markdown/dev/reference/api/store/log/debug/en.md +++ b/markdown/dev/reference/store-methods/log.debug/en.md @@ -1,5 +1,5 @@ --- -title: Store.log.debug() +title: log.debug() --- This is the logging method for logs of `debug` level. diff --git a/markdown/dev/reference/api/store/log/error/en.md b/markdown/dev/reference/store-methods/log.error/en.md similarity index 96% rename from markdown/dev/reference/api/store/log/error/en.md rename to markdown/dev/reference/store-methods/log.error/en.md index 739fe544e8c..f120b41c610 100644 --- a/markdown/dev/reference/api/store/log/error/en.md +++ b/markdown/dev/reference/store-methods/log.error/en.md @@ -1,5 +1,5 @@ --- -title: Store.log.error() +title: log.error() --- This is the logging method for logs of `error` level. diff --git a/markdown/dev/reference/api/store/log/info/en.md b/markdown/dev/reference/store-methods/log.info/en.md similarity index 95% rename from markdown/dev/reference/api/store/log/info/en.md rename to markdown/dev/reference/store-methods/log.info/en.md index 5dd2b1099eb..6107f1482b7 100644 --- a/markdown/dev/reference/api/store/log/info/en.md +++ b/markdown/dev/reference/store-methods/log.info/en.md @@ -1,5 +1,5 @@ --- -title: Store.log.info() +title: log.info() --- This is the logging method for logs of `info` level. diff --git a/markdown/dev/reference/api/store/log/warn/en.md b/markdown/dev/reference/store-methods/log.warn/en.md similarity index 95% rename from markdown/dev/reference/api/store/log/warn/en.md rename to markdown/dev/reference/store-methods/log.warn/en.md index 893100b21f6..4badaae4a1e 100644 --- a/markdown/dev/reference/api/store/log/warn/en.md +++ b/markdown/dev/reference/store-methods/log.warn/en.md @@ -1,5 +1,5 @@ --- -title: Store.log.warn() +title: log.warn() --- This is the logging method for logs of `warn` level (warning). diff --git a/markdown/dev/reference/store-methods/pack/en.md b/markdown/dev/reference/store-methods/pack/en.md new file mode 100644 index 00000000000..bb9e803a765 --- /dev/null +++ b/markdown/dev/reference/store-methods/pack/en.md @@ -0,0 +1,11 @@ +--- +title: pack() +--- + +The `pack()` store method is used to automatically layout patterns in the core library. +It is implemented as a store method to allow you to override this method and implement +your own algorithm to generate the layout. + + +Document this in more detail + diff --git a/markdown/dev/reference/store-methods/removemacronodes/en.md b/markdown/dev/reference/store-methods/removemacronodes/en.md new file mode 100644 index 00000000000..709181a4779 --- /dev/null +++ b/markdown/dev/reference/store-methods/removemacronodes/en.md @@ -0,0 +1,31 @@ +--- +title: removeMacroNodes() +--- + +Removes nodes generated by macro `id`. +By nodes, we mean paths, points, and so on that have been created by the macro. + +When a macro properly uses a combination of `generateMacroIds()` and +`storeMacroIds()`, this method will fully handle its removal. + +## Signature + +```mjs +Object store.removeMacroNodes( + String id, + macro = store.activeMacro, + part = store.activePart, +) +``` + +The method takes a (macro) id and removes all nodes created by this macro, +It uses the active macro and part from the store, Or you can pass in `macro` and `part` to not use the active macro or part. + +## Example + +```mjs +undefined store.removeMacroNodes('macroId') +``` + + + diff --git a/markdown/dev/reference/store-methods/storemacroids/en.md b/markdown/dev/reference/store-methods/storemacroids/en.md new file mode 100644 index 00000000000..3f6dcdef66f --- /dev/null +++ b/markdown/dev/reference/store-methods/storemacroids/en.md @@ -0,0 +1,29 @@ +--- +title: storeMacroIds() +--- + +Stores data for macro IDs generated via [`generateMacroIds()`](/reference/store-methods/generatemacroids). + +## Signature + +```mjs +Object store.storeMacroIds( + String id, + Array ids, + macro = store.activeMacro, + part = store.activePart, +) +``` + +The method takes a (macro) id and an object of ids and stores it in the store under the active macro and part. + +Or, if you want to, you can pass in `macro` and `part` to not use the active macro or part. + +## Example + +```mjs +const ids = store.getMacroIds('macroId', ids) +``` + +Storing this data is a requirement to allow removal of macros. + diff --git a/markdown/dev/reference/store-methods/unflag.error/en.md b/markdown/dev/reference/store-methods/unflag.error/en.md new file mode 100644 index 00000000000..3749a1a4e07 --- /dev/null +++ b/markdown/dev/reference/store-methods/unflag.error/en.md @@ -0,0 +1,19 @@ +--- +title: unflag.error() +--- + +This removes a specific piece of information flagged at the `error` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.error`. +When doing so, you can pass an `id` or -- if no `id` is used, the `title` field will be used as the `id`. +This methods allows you to remove this flagged info by passing said `id` (or `title`). + +## Signature + +```js +undefined Store.unflag.error(string id) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/unflag.fixme/en.md b/markdown/dev/reference/store-methods/unflag.fixme/en.md new file mode 100644 index 00000000000..a760a9a0c25 --- /dev/null +++ b/markdown/dev/reference/store-methods/unflag.fixme/en.md @@ -0,0 +1,19 @@ +--- +title: unflag.fixme() +--- + +This removes a specific piece of information flagged at the `fixme` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.fixme`. +When doing so, you can pass an `id` or -- if no `id` is used, the `title` field will be used as the `id`. +This methods allows you to remove this flagged info by passing said `id` (or `title`). + +## Signature + +```js +undefined Store.unflag.fixme(string id) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/unflag.info/en.md b/markdown/dev/reference/store-methods/unflag.info/en.md new file mode 100644 index 00000000000..f3e68c8dc7a --- /dev/null +++ b/markdown/dev/reference/store-methods/unflag.info/en.md @@ -0,0 +1,19 @@ +--- +title: unflag.info() +--- + +This removes a specific piece of information flagged at the `info` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.info`. +When doing so, you can pass an `id` or -- if no `id` is used, the `title` field will be used as the `id`. +This methods allows you to remove this flagged info by passing said `id` (or `title`). + +## Signature + +```js +undefined Store.unflag.info(string id) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/unflag.note/en.md b/markdown/dev/reference/store-methods/unflag.note/en.md new file mode 100644 index 00000000000..60324c0c007 --- /dev/null +++ b/markdown/dev/reference/store-methods/unflag.note/en.md @@ -0,0 +1,19 @@ +--- +title: unflag.note() +--- + +This removes a specific piece of information flagged at the `note` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.note`. +When doing so, you can pass an `id` or -- if no `id` is used, the `title` field will be used as the `id`. +This methods allows you to remove this flagged info by passing said `id` (or `title`). + +## Signature + +```js +undefined Store.unflag.note(string id) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/unflag.preset/en.md b/markdown/dev/reference/store-methods/unflag.preset/en.md new file mode 100644 index 00000000000..0e51c3ea7ca --- /dev/null +++ b/markdown/dev/reference/store-methods/unflag.preset/en.md @@ -0,0 +1,17 @@ +--- +title: unflag.preset() +--- + +This removes a specific piece of information flagged through the [`flag.preset()`](/reference/store-methods/flag.preset) method. + +## Signature + +```js +undefined Store.unflag.preset(string id) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +See [flag.preset()](/reference/store-methods/flag.preset) for a list of available presets. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/unflag.tip/en.md b/markdown/dev/reference/store-methods/unflag.tip/en.md new file mode 100644 index 00000000000..62a40a80f3e --- /dev/null +++ b/markdown/dev/reference/store-methods/unflag.tip/en.md @@ -0,0 +1,19 @@ +--- +title: unflag.tip() +--- + +This removes a specific piece of information flagged at the `tip` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.tip`. +When doing so, you can pass an `id` or -- if no `id` is used, the `title` field will be used as the `id`. +This methods allows you to remove this flagged info by passing said `id` (or `title`). + +## Signature + +```js +undefined Store.unflag.tip(string id) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info). diff --git a/markdown/dev/reference/store-methods/unflag.warn/en.md b/markdown/dev/reference/store-methods/unflag.warn/en.md new file mode 100644 index 00000000000..07506a545e3 --- /dev/null +++ b/markdown/dev/reference/store-methods/unflag.warn/en.md @@ -0,0 +1,19 @@ +--- +title: unflag.warn() +--- + +This removes a specific piece of information flagged at the `warn` level. + +Info that is flagged is stored in the store under `plugins.plugin-annotations.flags.warn`. +When doing so, you can pass an `id` or -- if no `id` is used, the `title` field will be used as the `id`. +This methods allows you to remove this flagged info by passing said `id` (or `title`). + +## Signature + +```js +undefined Store.unflag.warn(string id) +``` + +Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation. + +For a more detailed example of how we use this, see [flag.info()](/reference/store-methods/flag.info).