1
0
Fork 0
freesewing/markdown/dev/howtos/code/shorthand/en.md
Joost De Cock b34a2ee2ed feat: Flat import of markdown repo
This is a flat (without history) import of (some of) the content
from our markdown module.

We've imported this without history because the repo contains our
blog posts and showcases posts content prior to porting them to strapi.

Since this contains many images, it would balloon the size of this repo
to import the full history.

Instead, please refer to the history of the (archived) markdown repo
at: https://github.com/freesewing/markdown
2021-08-25 16:09:31 +02:00

1.4 KiB

title for about
Using shorthand developers Shows you how to use our shorthand method and notation

The Part.shorthand() method will become your best friend.

By using object destructuring you'll get access to a bunch of handy variables to make your code more concise and readable.

Part.shorthand() provides a lot of things, and you typically don't need all of them, but here's everything it has to offer:

  const {
    options,      // Pattern options
    measurements, // Model measurements
    Point,        // Point constructor
    Path,         // Path constructor
    Snippet,      // Snippet constructor
    points,       // Holds part points
    paths,        // Holds part paths
    snippets,     // Holds part snippets
    store,        // The store allows you to share data between parts
    utils,        // A collection of utilities
    macro,        // Method to call a macro
    debug,        // Method to log debug info
    sa,           // Requested seam allowance
    final,        // Whether to draft a complete pattern or not
    paperless,    // Whether to draft a paperless pattern or not
    units,        // Requested units
  } = part.shorthand();

Many examples throughout our documentation use shorthand notation.