chore(markdown): Restructuring dev docs
This commit is contained in:
parent
9ef46c502a
commit
d42d9a9377
114 changed files with 246 additions and 1462 deletions
|
@ -1,10 +1,5 @@
|
|||
---
|
||||
title: Core API
|
||||
for: developers
|
||||
icons:
|
||||
- javascript
|
||||
- terms
|
||||
about: FreeSewing's core API reference documents all available methods and objects
|
||||
title: "@freesewing/core API"
|
||||
---
|
||||
|
||||
This is the documentation for FreeSewing's core library, published as `@freesewing/core` on NPM.
|
||||
|
|
|
@ -23,5 +23,13 @@ macro('cutonfold', {
|
|||
| `offset` | 50 | Number | The distance in mm to offset from the line from start to end |
|
||||
| `grainline` | `false` | Boolean | Whether this cutonfold indicator is also the grainline |
|
||||
|
||||
<Note>
|
||||
|
||||
###### 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.
|
||||
|
||||
</Note>
|
||||
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
---
|
||||
title: Account
|
||||
---
|
||||
|
||||
## Load account
|
||||
```
|
||||
GET /account
|
||||
```
|
||||
On success: The account data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
## Update account
|
||||
```
|
||||
PUT /account
|
||||
{
|
||||
'bio': 'The new bio',
|
||||
'avatar': 'data:image/png;base64,iVBORw0KGg...'
|
||||
'password': 'new password',
|
||||
'username': 'new username',
|
||||
'email': 'new.email@domain.com',
|
||||
'social': {
|
||||
'github': 'githubUsername',
|
||||
'twitter': 'twitterUsername',
|
||||
'isntagram': 'instagramUsername'
|
||||
},
|
||||
'settings': {
|
||||
'language': 'fr',
|
||||
'units': 'imperial',
|
||||
},
|
||||
'consent': {
|
||||
'profile': true,
|
||||
'model': false,
|
||||
'openData': false
|
||||
},
|
||||
```
|
||||
On success: The (updated) account data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
- This will only update what you pass it
|
||||
- This will only handle one top-level attribute per call
|
||||
- A change of email won't take effect immediately but instead trigger an email for confirmation. The email will be sent to the new email address, with the current email address in CC.
|
||||
|
||||
## Remove account
|
||||
```
|
||||
DELETE /account
|
||||
```
|
||||
On success:
|
||||
```
|
||||
204
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Removes the account and all user's data. Will also trigger a goodbye email.
|
||||
|
||||
## Confirm email change
|
||||
```
|
||||
POST /account/change/email
|
||||
{
|
||||
'id': '98e132041ad3f369443f1d3d'
|
||||
}
|
||||
```
|
||||
On success: The account data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Changing your email address requires confirmation, and this endpoint is for that.
|
||||
|
||||
## Export account
|
||||
```
|
||||
GET /account/export
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
{
|
||||
'export': 'https://static.freesewing.org/tmp/msypflkyyw/export.zip'
|
||||
}
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Will export the user data and publish it for download.
|
||||
|
||||
## Restrict account
|
||||
```
|
||||
GET /account/restrict
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Will lock the user account, thereby restricting processing of their data.
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
---
|
||||
title: Backend API
|
||||
for: developers
|
||||
about: Documentation for our backend REST API
|
||||
---
|
||||
|
||||
<Fixme>This documentation is outdated</Fixme>
|
||||
|
||||
<Note>
|
||||
|
||||
See also: [The backend documentation](/reference/repos/backend/)
|
||||
|
||||
</Note>
|
||||
|
||||
## API Cheat sheet
|
||||
With authentication:
|
||||
|
||||
|🔐| Method | Endpoint | Description |
|
||||
|--- |--------|----------|-------------|
|
||||
|🔐|`POST`|`/models`| [Creates model](/reference/backend/models/#create-model) |
|
||||
|🔐|`GET`|`/models/:handle`| [Read model](/reference/backend/models/#read-model) |
|
||||
|🔐|`PUT`|`/models/:handle`| [Update model](/reference/backend/models/#update-model) |
|
||||
|🔐|`DELETE`|`/models/:handle`| [Remove model](/reference/backend/models/#remove-model) |
|
||||
|🔐|`POST`|`/recipes`| [Create recipe](/reference/backend/recipes/#create-recipe) |
|
||||
|🔐|`GET`|`/recipes/:handle`| [Read recipe](/reference/backend/recipes/#read-recipe) |
|
||||
|🔐|`PUT`|`/recipes/:handle`| [Updates recipe](/reference/backend/recipes/#update-recipe) |
|
||||
|🔐|`DELETE`|`/recipes/:handle`| [Remove recipe](/reference/backend/recipes/#remove-recipe) |
|
||||
|🔐|`GET`|`/account`| [Load account](/reference/backend/account/#load-account) |
|
||||
|🔐|`PUT`|`/account`| [Update account](/reference/backend/account/#update-account) |
|
||||
|🔐|`DELETE`|`/account`| [Remove account](/reference/backend/account/#remove-account) |
|
||||
|🔐|`POST`|`/account/change/email`| [Confirm email change](/reference/backend/account/#confirm-email-change) |
|
||||
|🔐|`GET`|`/account/export`| [Export account](/reference/backend/account/#export-account) |
|
||||
|🔐|`GET`|`/account/restrict`| [Restric account](/reference/backend/account/#restrict-account) |
|
||||
|🔐|`GET`|`/users/:username`| [Read user profile](/reference/backend/users/#read-user-profile)
|
||||
|🔐|`POST`|`/available/username`| [Is username available](/reference/backend/users/#is-username-available) |
|
||||
|
||||
Without authentication:
|
||||
|
||||
|🔓| Method | Endpoint | Description |
|
||||
|--- |--------|----------|-------------|
|
||||
|🔓|`POST`|`/signup`| [Request account](/reference/backend/signup/#request-account) |
|
||||
|🔓|`POST`|`/account`| [Create account](/reference/backend/signup/#create-account) |
|
||||
|🔓|`POST`|`/login`| [Log in](/reference/backend/login/#log-in) |
|
||||
|🔓|`POST`|`/reset/password`| [Recover password](/reference/backend/login/#recover-password) |
|
||||
|🔓|`POST`|`/confirm/login`| [Passwordless login](/reference/backend/login/#passwordless-login) |
|
||||
|🔓|`POST`|`/oauth/init`| [Oauth initialisation](/reference/backend/oauth/#oauth-initialisation) |
|
||||
|🔓|`GET`|`/oauth/callback/from/:provider`| [Oauth callback](/reference/backend/oauth/#oauth-callback) |
|
||||
|🔓|`POST`|`/oauth/login`| [Oauth login](/reference/backend/oauth/#oauth-login) |
|
||||
|🔓|`GET`|`/patrons`| [Patron list](/reference/backend/users/#patron-list) |
|
||||
|
||||
|
||||
<ReadMore root='reference/backend' box />
|
|
@ -1,55 +0,0 @@
|
|||
---
|
||||
title: Log in
|
||||
---
|
||||
|
||||
## Log in
|
||||
```
|
||||
POST /login
|
||||
{
|
||||
'username': 'user-csfwg',
|
||||
'password': `test`
|
||||
}
|
||||
```
|
||||
On success: The account data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
- Returns the same as the create account endpoint
|
||||
- Both username or email address can be uses as `username`
|
||||
|
||||
## Reset password
|
||||
```
|
||||
POST /reset/password
|
||||
{
|
||||
'username': 'test@freesewing.org'
|
||||
}
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
- Will send an email to the user with a link for a passwordless login.
|
||||
|
||||
## Passwordless login
|
||||
```
|
||||
POST /confirm/login
|
||||
{
|
||||
'id': '5d5132041ad3f369443f1d7b'
|
||||
}
|
||||
```
|
||||
On success: The account data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
- Returns the same as the create account endpoint
|
||||
- ID is the one sent out in the confirmation email
|
||||
|
||||
This will log the user in.
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
---
|
||||
title: Models
|
||||
---
|
||||
|
||||
## Create model
|
||||
|
||||
```
|
||||
POST /models
|
||||
{
|
||||
'name': 'The model name',
|
||||
'breasts': false,
|
||||
'units': 'imperial'
|
||||
}
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
{
|
||||
'model': {
|
||||
'breasts': false,
|
||||
'units': 'imperial',
|
||||
'handle': 'dnkve',
|
||||
'user': 'ohium',
|
||||
'name': The model name',
|
||||
'createdAt': '2019-08-12T12:06:41.086Z',
|
||||
'updatedAt': '2019-08-12T12:06:41.086Z',
|
||||
'pictureUris': {
|
||||
'l': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg',
|
||||
'm': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg',
|
||||
's': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg',
|
||||
'xs': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Creates a model and returns its data.
|
||||
|
||||
## Read model
|
||||
```
|
||||
GET /models/:handle
|
||||
```
|
||||
On success: The model data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Loads a model's data
|
||||
|
||||
## Update model
|
||||
|
||||
```
|
||||
PUT /models/:handle
|
||||
{
|
||||
'measurements': {
|
||||
'ankleCircumference': 234
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Updates the model and returns the (updated) model data.
|
||||
|
||||
## Remove model
|
||||
|
||||
```
|
||||
DELETE /models/:handle
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Removes the model
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
---
|
||||
title: Oauth
|
||||
---
|
||||
|
||||
## Oauth initialisation
|
||||
```
|
||||
POST /oauth/init
|
||||
{
|
||||
'provider': 'github',
|
||||
'language': 'fr'
|
||||
}
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
{
|
||||
'state': '5d5132041ad3f369443f1d7b'
|
||||
}
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
- This triggers an Oauth flow
|
||||
- `provider` should be one of `google` or `github`
|
||||
- `language` should be one of the [configured language codes](https://github.com/freesewing/backend/blob/develop/src/config/index.js#L32)
|
||||
- The frontend will use the state value to initialize an Oauth session. We'll check the state value when we receive the Oauth callback at the backend
|
||||
|
||||
## Oauth callback
|
||||
```
|
||||
GET /oauth/callback/from/:provider
|
||||
```
|
||||
On success: Redirects to the frontend
|
||||
|
||||
This is part of the Oauth flow. It fetches the user info from the Oauth provider. If it can't match it with a user, it will create a user account.
|
||||
In other words, this will handle both log in and sign up.
|
||||
|
||||
The frontend redirect will contain a confirmation ID in the URL that we'll `POST` back in the next Oauth flow step.
|
||||
|
||||
## Oauth login
|
||||
```
|
||||
POST /oauth/login
|
||||
{
|
||||
'confirmation': '98e132041ad3f369443f1d3d'
|
||||
}
|
||||
```
|
||||
On success: The account data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
This is the last step of the Oauth process. It logs a user in.
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
---
|
||||
title: Recipes
|
||||
---
|
||||
|
||||
## Create Recipe
|
||||
|
||||
```
|
||||
POST /recipes
|
||||
{
|
||||
'name': 'The recipe name',
|
||||
'notes': 'Some notes',
|
||||
'recipe': {
|
||||
'settings': {
|
||||
'sa': 10,
|
||||
'complete': true,
|
||||
'paperless': false,
|
||||
'units': 'metric',
|
||||
'measurements': {
|
||||
'bicepsCircumference': 335,
|
||||
'centerBackNeckToWaist': 520,
|
||||
'chestCircumference': 1080,
|
||||
'"naturalWaistToHip': 145,
|
||||
'neckCircumference': 420,
|
||||
'shoulderSlope': 55,
|
||||
'shoulderToShoulder': 465,
|
||||
'hipsCircumference': 990
|
||||
}
|
||||
},
|
||||
'pattern': 'aaron',
|
||||
'model': 'dvqye'
|
||||
}
|
||||
}
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
{
|
||||
'handle': 'abxda'
|
||||
}
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Creates a recipe and returns its data.
|
||||
|
||||
## Read recipe
|
||||
```
|
||||
GET /recipes/:handle
|
||||
```
|
||||
On success: The recipe data
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Loads a recipe's data
|
||||
|
||||
## Update recipe
|
||||
|
||||
```
|
||||
PUT /recipes/:handle
|
||||
{
|
||||
'notes': "5 stars, would make again"
|
||||
}
|
||||
```
|
||||
|
||||
Updates the recipe and returns the (updated) recipe data.
|
||||
|
||||
## Remove recipe
|
||||
|
||||
```
|
||||
DELETE /recipes/:handle
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
Removes the recipe
|
|
@ -1,97 +0,0 @@
|
|||
---
|
||||
title: Sign up
|
||||
---
|
||||
|
||||
## Request account
|
||||
```
|
||||
POST /signup
|
||||
{
|
||||
email: 'test@freesewing.org',
|
||||
password: 'test',
|
||||
language: 'en'
|
||||
}
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
```
|
||||
On error:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
- This is the first half in the user sign up flow.
|
||||
- `language` should be one of the [configured language codes](https://github.com/freesewing/backend/blob/develop/src/config/index.js#L32)
|
||||
- This will create (but not activate) a user account
|
||||
- This will send out an email to the user to confirm their email address
|
||||
|
||||
## Create account
|
||||
```
|
||||
POST /account
|
||||
{
|
||||
id: '5d5132041ad3f369443f1d7b'
|
||||
consent: {
|
||||
profile: true,
|
||||
model: true,
|
||||
openData: true
|
||||
}
|
||||
}
|
||||
```
|
||||
On success: The account data:
|
||||
```
|
||||
200
|
||||
{
|
||||
'account': {
|
||||
'settings': {
|
||||
'language': 'en',
|
||||
'units': 'metric'
|
||||
},
|
||||
'consent': {
|
||||
'profile': true,
|
||||
'model': true,
|
||||
'openData': true,
|
||||
},
|
||||
'time': {
|
||||
'login': '2019-08-12T09:41:15.823Z'
|
||||
},
|
||||
'role': 'user',
|
||||
'patron': 0,
|
||||
'bio': '',
|
||||
'picture': 'csfwg.svg',
|
||||
'status': 'active',
|
||||
'handle': 'csfwg',
|
||||
'username': 'user-csfwg',
|
||||
'email': 'test@freesewing.org',
|
||||
'pictureUris': {
|
||||
'l': 'https://static.freesewing.org/users/c/csfwg/csfwg.svg',
|
||||
'm': 'https://static.freesewing.org/users/c/csfwg/csfwg.svg',
|
||||
's': 'https://static.freesewing.org/users/c/csfwg/csfwg.svg',
|
||||
'xs': 'https://static.freesewing.org/users/c/csfwg/csfwg.svg'
|
||||
}
|
||||
},
|
||||
'models': {},
|
||||
'recipes': {},
|
||||
'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZDUxMzQzYjFhZDNmMzY5NDQzZjFkOTYiLCJoYW5kbGUiOiJjc2Z3ZyIsImF1ZCI6ImZyZWVzZXdpbmcub3JnIiwiaXNzIjoiZnJlZXNld2luZy5vcmciLCJpYXQiOjE1NjU2MDI4NzV9.-u4qgiH5sEcwhSBvQ9AOxjqsJO3-Phm9t7VbPaPS7vs'
|
||||
}
|
||||
```
|
||||
On failure:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
This is the second half of the sign up flow. The email sent to the user in the first half of the sign up flow contains a link to the (frontend) confirmation page. This will get the confirmation ID from the URL and `POST` it to
|
||||
the backend, along with the user's choices regarding consent for processing their personal data.
|
||||
|
||||
The `consent` object has the following properties:
|
||||
- `bool profile` : Consent for the processing of profile data
|
||||
- `bool model` : Consent for the processing of model data
|
||||
- `bool openData` : Whether or not the user allows publishing of measurements as open data
|
||||
|
||||
For more details on user consent, please consult [FreeSewing's privacy notice](https://en.freesewing.org/docs/about/privacy).
|
||||
|
||||
<Note>
|
||||
|
||||
Our frontend won't allow users to proceed without profile consent as
|
||||
storing your data requires that consent. The backend enforces this too
|
||||
|
||||
</Note>
|
|
@ -1,90 +0,0 @@
|
|||
---
|
||||
title: Users
|
||||
---
|
||||
|
||||
## Read user profile
|
||||
```
|
||||
GET /users/:username
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
{
|
||||
'settings': {
|
||||
'language': 'en',
|
||||
'units': 'metric'
|
||||
},
|
||||
'patron': 0,
|
||||
'bio': '',
|
||||
'handle': 'rracx',
|
||||
'username': 'admin',
|
||||
'createdAt': '2019-08-12T07:40:32.435Z',
|
||||
'updatedAt': '2019-08-12T09:23:48.930Z',
|
||||
'pictureUris': {
|
||||
'l': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg',
|
||||
'm': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg',
|
||||
's': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg',
|
||||
'xs': 'https://static.she.freesewing.org/users/r/rracx/rracx.svg'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Load the profile data of a user. It expects one parameter in the URL of the `GET` request:
|
||||
|
||||
| Variable | Description |
|
||||
|------------|-------------|
|
||||
| `username` | The username of the user to load the profile data for |
|
||||
|
||||
## Is username availbable
|
||||
|
||||
```
|
||||
POST /available/username
|
||||
{
|
||||
username: 'username to check'
|
||||
}
|
||||
```
|
||||
Username available:
|
||||
```
|
||||
200
|
||||
```
|
||||
Username not available:
|
||||
```
|
||||
400
|
||||
```
|
||||
|
||||
## Patron list
|
||||
|
||||
```
|
||||
GET /patrons
|
||||
```
|
||||
On success:
|
||||
```
|
||||
200
|
||||
{
|
||||
'2': [
|
||||
],
|
||||
'4': [],
|
||||
'8': [
|
||||
{
|
||||
'handle': 'joost',
|
||||
'username': 'joost',
|
||||
'bio':"If something doesn't work around here, that's probably my fault",
|
||||
'social': {
|
||||
'twitter': 'j__st',
|
||||
'instagram': 'joostdecock',
|
||||
'github': 'joostdecock'
|
||||
},
|
||||
'pictureUris': {
|
||||
'l': 'https://static.freesewing.org/users/j/joost/joost.jpg',
|
||||
'm': 'https://static.freesewing.org/users/j/joost/m-joost.jpg',
|
||||
's': 'https://static.freesewing.org/users/j/joost/s-joost.jpg',
|
||||
'xs': 'https://static.freesewing.org/users/j/joost/xs-joost.jpg'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- Retrieves the list of [FreeSewing patrons](https://freesewing.org/patrons).
|
||||
- Returns an array per tier
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
---
|
||||
title: Designs
|
||||
for: contributors
|
||||
about: Complete list of FreeSewing designs that we've put out
|
||||
---
|
||||
|
||||
We have a growing number of designs (sewing patterns).
|
||||
|
||||
For each of these, we provide a stand-alone instance of our development environment.
|
||||
This allows you to quickly recreate issues, or kick the tires.
|
||||
|
||||
The full list is below:
|
||||
|
||||
<Fixme>
|
||||
|
||||
Include list based on new iterator
|
||||
|
||||
</Fixme>
|
|
@ -3,3 +3,5 @@ title: Reference
|
|||
order: 1040
|
||||
---
|
||||
|
||||
<ReadMore />
|
||||
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
---
|
||||
title: bartack
|
||||
title: "@freesewing/plugin-bartack"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-bartack)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-bartack)
|
||||
The **@freesewing/plugin-bartack** plugin provides
|
||||
[the bartack macro](/reference/api/macros/bartack).
|
||||
This macro allows you to add bartacks — a set of
|
||||
tight zig-zag stitches used to enforce a seam — to your design.
|
||||
|
||||
The [@freesewing/plugin-bartack](/reference/packages/plugin-bartack) packages provides a plugin to help bartack points and/or paths around a given bartack line.
|
||||
## Example
|
||||
|
||||
<Example part="plugin_bartack">Example of the bartack macro provided by this plugin</Example>
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
```sh
|
||||
npm install @freesewing/plugin-bartack
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -32,8 +31,8 @@ const Pattern = new freesewing.Design(config, bartack);
|
|||
```
|
||||
|
||||
Now you can use the
|
||||
[bartack](/reference/macros/bartack/),
|
||||
[bartackAlong](/reference/macros/bartackalong/), and
|
||||
[bartackFractionAlong](/reference/macros/bartackfractionalong/) macros in your parts.
|
||||
[bartack](/reference/api/macros/bartack/),
|
||||
[bartackAlong](/reference/api/macros/bartackalong/), and
|
||||
[bartackFractionAlong](/reference/api/macros/bartackfractionalong/) macros in your parts:
|
||||
|
||||
|
||||
|
|
|
@ -1,26 +1,17 @@
|
|||
---
|
||||
title: bundle
|
||||
title: "@freesewing/plugin-bundle"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-bundle)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-bundle)
|
||||
The **@freesewing/plugin-bundle** plugin bundles the most common FreeSewing build-time plugins:
|
||||
|
||||
|
||||
The bundle plugin bundles the most common FreeSewing build-time plugins:
|
||||
|
||||
1. [plugin-cutonfold](/reference/plugins/cutonfold) : Add cut-on-fold indicators to your patterns
|
||||
2. [plugin-dimension](/reference/plugins/dimension) : Add dimensions to your (paperless) patterns
|
||||
3. [plugin-grainline](/reference/plugins/grainline) : Add grainline indicators to your patterns
|
||||
4. [plugin-logo](/reference/plugins/logo) : Add a scalebox to your patterns
|
||||
5. [plugin-scalebox](/reference/plugins/scalebox) : Add pretty titles to your pattern parts
|
||||
6. [plugin-title](/reference/plugins/title) : Add pretty titles to your pattern parts
|
||||
7. [plugin-round](/reference/plugins/round) : Rounds corners
|
||||
8. [plugin-sprinkle](/reference/plugins/sprinkle) : Add multiple snippets to your pattern
|
||||
- [plugin-cutonfold](/reference/plugins/cutonfold) : Add cut-on-fold indicators to your patterns
|
||||
- [plugin-dimension](/reference/plugins/dimension) : Add dimensions to your (paperless) patterns
|
||||
- [plugin-grainline](/reference/plugins/grainline) : Add grainline indicators to your patterns
|
||||
- [plugin-logo](/reference/plugins/logo) : Add a scalebox to your patterns
|
||||
- [plugin-scalebox](/reference/plugins/scalebox) : Add pretty titles to your pattern parts
|
||||
- [plugin-title](/reference/plugins/title) : Add pretty titles to your pattern parts
|
||||
- [plugin-round](/reference/plugins/round) : Rounds corners
|
||||
- [plugin-sprinkle](/reference/plugins/sprinkle) : Add multiple snippets to your pattern
|
||||
|
||||
Almost all patterns use these plugins, so it made sense to bundle them.
|
||||
|
||||
|
@ -32,8 +23,8 @@ npm install @freesewing/plugin-bundle
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
---
|
||||
title: bust
|
||||
title: "@freesewing/plugin-bust"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-bust)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-bust)
|
||||
|
||||
The [@freesewing/plugin-bust](/reference/packages/plugin-bust) packages provides a plugin to help you adapt menswear patterns for breasts.
|
||||
|
||||
The **@freesewing/plugin-bust** plugin helps you adapt menswear patterns for breasts.
|
||||
If you are designing a womenswear pattern, you won't need this plugin. But if you're adapting
|
||||
a menswear pattern for breasts, this plugin can help you.
|
||||
a menswear pattern for breasts, or merely want to accomodate both people with and without
|
||||
breasts, this plugin can help you accomplish that.
|
||||
|
||||
<Note>
|
||||
|
||||
##### Understanding the use-case for this plugin
|
||||
|
||||
Almost all menswear patterns use the chest circumference to draft the garment.
|
||||
|
||||
|
@ -27,10 +23,18 @@ This plugin helps you by:
|
|||
- Storing the chest circumference in `measurements.bust`
|
||||
- Changing `measurments.chestCircumference` to the value of `measurements.highBust`
|
||||
|
||||
</Note>
|
||||
|
||||
## Use when extending breastless patterns into a with-breasts version
|
||||
|
||||
One way this plugin is used is to extend a menswear pattern into a womenswear pattern.
|
||||
In this case, the plugin will always be loaded since the pattern assumes breasts will be present.
|
||||
|
||||
This way you can extend a menswear pattern and have it drafted with the high bust measurement
|
||||
as chest measurment, after which you can create room for the breasts.
|
||||
|
||||
It's used by our [Carlita](/reference/packages/carlita) pattern, which extends the menswear [Carlton](/reference/packages/carlton) pattern.
|
||||
You can see this in practice in our [Carlita][1] pattern,
|
||||
which extends the menswear [Carlton][2] pattern.
|
||||
|
||||
<Tip>
|
||||
|
||||
|
@ -38,6 +42,22 @@ To learn more about extending a pattern, see [Design inheritance](/howtos/code/i
|
|||
|
||||
</Tip>
|
||||
|
||||
## Use when creating gender-neutral patterns
|
||||
|
||||
To create a truly gender-neutral pattern — one that will adapt to breasts only if they are
|
||||
present — you can use this plugin, but you'll also need a few other things:
|
||||
|
||||
- You'll need to mark the breast measurements as [optional measurements](/reference/api/config/optionalmeasurements)
|
||||
- You'll need to [conditionally load this plugin](/guides/plugins/conditionally-loading-build-time-plugins)
|
||||
|
||||
You can see an example of this in [our Teagan design][3].
|
||||
|
||||
<Fixme>
|
||||
|
||||
**TODO**: Write a tutorial on gender-neutral desing
|
||||
|
||||
</Fixme>
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
|
@ -46,8 +66,8 @@ npm install @freesewing/plugin-bust
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -58,3 +78,6 @@ const Pattern = new freesewing.Design(config, bust);
|
|||
```
|
||||
|
||||
|
||||
[1]: https://github.com/freesewing/freesewing/blob/develop/packages/carlita/src/index.js#L12
|
||||
[2]: https://github.com/freesewing/freesewing/blob/develop/packages/carlton
|
||||
[3]: https://github.com/freesewing/freesewing/blob/develop/packages/teagan/src/index.js
|
||||
|
|
|
@ -1,32 +1,19 @@
|
|||
---
|
||||
title: buttons
|
||||
title: "@freesewing/plugin-buttons"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-buttons)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-buttons)
|
||||
The **@freesewing/plugin-buttons** plugin provides the following [snippets](/reference/api/snippets):
|
||||
|
||||
The **buttons** plugin provides the following [snippets](/reference/snippets/):
|
||||
- [button](/reference/api/snippets/button)
|
||||
- [buttonhole](/reference/api/snippets/buttonhole)
|
||||
- [buttonhole-start](/reference/api/snippets/buttonhole-start)
|
||||
- [buttonhole-end](/reference/api/snippets/buttonhole-end)
|
||||
- [snap-stud](/reference/api/snippets/snap-stud)
|
||||
- [snap-socket](/reference/api/snippets/snap-socket)
|
||||
|
||||
- `button`
|
||||
- `buttonhole`
|
||||
- `buttonhole-start`
|
||||
- `buttonhole-end`
|
||||
- `snap-stud`
|
||||
- `snap-socket`
|
||||
|
||||
<Example part="plugin_buttons" caption="An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets" design={false} />
|
||||
|
||||
```js
|
||||
let { Point, snippets, Snippet } = part.shorthand();
|
||||
|
||||
snippets.button = new Snippet('button', new Point(40, 10));
|
||||
snippets.buttonhole = new Snippet('buttonhole', new Point(80, 10));
|
||||
```
|
||||
<Example part="plugin_buttons">
|
||||
An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets
|
||||
</Example>
|
||||
|
||||
<Tip>
|
||||
|
||||
|
@ -42,8 +29,8 @@ npm install @freesewing/plugin-buttons
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -53,3 +40,12 @@ import config from "../config";
|
|||
const Pattern = new freesewing.Design(config, buttons);
|
||||
```
|
||||
|
||||
Now you can use the
|
||||
[button](/reference/api/snippets/button),
|
||||
[buttonhole](/reference/api/snippets/buttonhole),
|
||||
[buttonhole-start](/reference/api/snippets/buttonhole-start),
|
||||
[buttonhole-end](/reference/api/snippets/buttonhole-end),
|
||||
[snap-stud](/reference/api/snippets/snap-stud), and
|
||||
[snap-socket](/reference/api/snippets/snap-socket)
|
||||
snippets in your designs.
|
||||
|
||||
|
|
|
@ -1,52 +1,20 @@
|
|||
---
|
||||
title: cutonfold
|
||||
title: "@freesewing/plugin-cutonfold"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-cutonfold)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-cutonfold)
|
||||
The **@freesewing/plugin-cutonfold** plugin provides
|
||||
[the cutonfold macro](/reference/api/macros/cutonfold) which adds a cut-on-fold
|
||||
indicator to your design.
|
||||
|
||||
The **cutonfold** plugin provides [the cutonfold macro](/reference/macros/cutonfold/):
|
||||
<Example part="plugin_cutonfold">
|
||||
|
||||
<Example part="plugin_cutonfold" caption="An example of the cutonfold macro" design={false} />
|
||||
An example of the cutonfold macro
|
||||
|
||||
```js
|
||||
let { Point, points, Path, paths, macro } = part.shorthand();
|
||||
|
||||
points.topLeft = new Point(0, 0);
|
||||
points.topRight = new Point(150, 0);
|
||||
points.bottomRight = new Point(150, 50);
|
||||
points.bottomLeft = new Point(0, 50);
|
||||
|
||||
paths.box = new Path()
|
||||
.move(points.topLeft)
|
||||
.line(points.topRight)
|
||||
.line(points.bottomRight)
|
||||
.line(points.bottomLeft)
|
||||
.close();
|
||||
|
||||
macro("cutonfold", {
|
||||
from: points.bottomLeft,
|
||||
to: points.bottomRight,
|
||||
grainline: true
|
||||
});
|
||||
```
|
||||
<Note>
|
||||
|
||||
###### 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.
|
||||
|
||||
</Note>
|
||||
</Example>
|
||||
|
||||
<Tip>
|
||||
|
||||
The cutonfold plugin is part of our [plugin-bundle](/reference/plugins/bundle/)
|
||||
The cutonfold plugin is part of our [plugin-bundle](/reference/plugins/bundle)
|
||||
|
||||
</Tip>
|
||||
|
||||
|
@ -58,8 +26,8 @@ npm install @freesewing/plugin-cutonfold
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -69,4 +37,4 @@ import config from "../config";
|
|||
const Pattern = new freesewing.Design(config, cutonfold);
|
||||
```
|
||||
|
||||
Now you can use [the cutonfold macro](/reference/macros/cutonfold/) in your parts.
|
||||
Now you can use [the cutonfold macro](/reference/api/macros/cutonfold/) in your parts.
|
||||
|
|
|
@ -1,73 +1,26 @@
|
|||
---
|
||||
title: dimension
|
||||
title: "@freesewing/plugin-dimension"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-dimension)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-dimension)
|
||||
The **@freesewing/plugin-dimension** plugin provides a variety of macros
|
||||
to facilitate adding *dimensions* to your design. By *dimensions* we mean
|
||||
the indicators for distance that are added to patterns
|
||||
in [paperless mode](/reference/api/settings/paperless).
|
||||
|
||||
The **dimension** plugin provides the following [macros](/plugins#macros):
|
||||
The following macors are provided by this plugin:
|
||||
|
||||
- [hd](/reference/macros/hd/) : Adds a horizontal dimension
|
||||
- [vd](/reference/macros/vd/) : Adds a vertical dimension
|
||||
- [ld](/reference/macros/ld/) : Adds a linear dimension
|
||||
- [pd](/reference/macros/pd/) : Adds a dimension along a path
|
||||
- [rmd](/reference/macros/rmd/) : Removes a dimension
|
||||
- [rmad](/reference/macros/rmad/) : Removes all dimensions with a default prefix
|
||||
- [hd](/reference/api/macros/hd) : Adds a horizontal dimension
|
||||
- [vd](/reference/api/macros/vd) : Adds a vertical dimension
|
||||
- [ld](/reference/api/macros/ld) : Adds a linear dimension
|
||||
- [pd](/reference/api/macros/pd) : Adds a dimension along a path
|
||||
- [rmd](/reference/api/macros/rmd) : Removes a dimension
|
||||
- [rmad](/reference/api/macros/rmad) : Removes all dimensions with a default prefix
|
||||
|
||||
<Example part="plugin_dimension" caption="An example of the different dimensinon macros" design={false} />
|
||||
<Example part="plugin_dimension">
|
||||
|
||||
```js
|
||||
let { Point, points, Path, paths, macro } = part.shorthand();
|
||||
An example of the different dimensinon macros
|
||||
|
||||
points.A = new Point(0, 0);
|
||||
points.B = new Point(0, 100);
|
||||
points.C = new Point(50, 100);
|
||||
points.D = new Point(100, 50);
|
||||
points.DCp1 = new Point(100, 0);
|
||||
|
||||
paths.box = new Path()
|
||||
.move(points.A)
|
||||
.line(points.B)
|
||||
.line(points.C)
|
||||
.line(points.D)
|
||||
.curve(points.DCp1, points.A, points.A)
|
||||
.close();
|
||||
|
||||
macro("vd", {
|
||||
from: points.A,
|
||||
to: points.B,
|
||||
x: points.A.x - 15
|
||||
});
|
||||
|
||||
macro("hd", {
|
||||
from: points.B,
|
||||
to: points.C,
|
||||
y: points.B.y + 15
|
||||
});
|
||||
|
||||
macro("ld", {
|
||||
from: points.C,
|
||||
to: points.D,
|
||||
d: -15
|
||||
});
|
||||
|
||||
macro("ld", {
|
||||
from: points.C,
|
||||
to: points.D,
|
||||
d: -30,
|
||||
text: "Custom text"
|
||||
});
|
||||
|
||||
macro("pd", {
|
||||
path: new Path().move(points.A).curve(points.A, points.DCp1, points.D),
|
||||
d: -15
|
||||
});
|
||||
```
|
||||
</Example>
|
||||
|
||||
<Tip>
|
||||
|
||||
|
@ -83,8 +36,8 @@ npm install @freesewing/plugin-dimension
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -94,9 +47,12 @@ import config from "../config";
|
|||
const Pattern = new freesewing.Design(config, dimension);
|
||||
```
|
||||
|
||||
Now you can use the following macros in your parts:
|
||||
Now you can use the
|
||||
[hd](/reference/api/macros/hd/),
|
||||
[vd](/reference/api/macros/vd/),
|
||||
[ld](/reference/api/macros/ld/),
|
||||
[pd](/reference/api/macros/pd/),
|
||||
[rmd](/reference/api/macros/rmd/), and
|
||||
[rmad](/reference/api/macros/rmad/)
|
||||
macros in your parts.
|
||||
|
||||
- [hd](/reference/macros/hd/)
|
||||
- [vd](/reference/macros/vd/)
|
||||
- [ld](/reference/macros/ld/)
|
||||
- [pd](/reference/macros/pd/)
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
---
|
||||
title: Plugins
|
||||
for: developers
|
||||
about: Complete list of all the plugins available for FreeSewing core
|
||||
---
|
||||
|
||||
The following FreeSewing plugins are available:
|
||||
FreeSewing uses a modular approach where functionality can be extended with
|
||||
plugins. Plugins can provide macros, or use any of the lifecycle hooks.
|
||||
Refer to [the plugin guide](/guides/plugins) for an in-depth look into plugins.
|
||||
|
||||
We maintain the following plugins for @freesewing/core:
|
||||
|
||||
<ReadMore />
|
||||
|
||||
|
||||
<ReadMore list />
|
||||
|
|
|
@ -1,22 +1,12 @@
|
|||
---
|
||||
title: flip
|
||||
title: "@freesewing/plugin-flip"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-flip)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-flip)
|
||||
|
||||
The **flip** plugin provides [the flip macro](/reference/macros/flip/) which flips (mirrors) an entire part vertically around the Y-axis.
|
||||
|
||||
```js
|
||||
let { macro } = part.shorthand();
|
||||
|
||||
macro("flip");
|
||||
```
|
||||
The **@freesewing/plugin-flip** plugin provides [the flip
|
||||
macro](/reference/apis/macros/flip/) which flips (mirrors)
|
||||
an entire part vertically around the Y-axis.
|
||||
It's typically used to create a right and left pattern part from
|
||||
the same basis.
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -26,8 +16,8 @@ npm install @freesewing/plugin-flip
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -37,4 +27,4 @@ import config from "../config";
|
|||
const Pattern = new freesewing.Design(config, flip);
|
||||
```
|
||||
|
||||
Now you can use [the flip macro](/reference/macros/flip) in your parts.
|
||||
Now you can use [the flip macro](/reference/api/macros/flip) in your parts.
|
||||
|
|
|
@ -1,30 +1,12 @@
|
|||
---
|
||||
title: grainline
|
||||
title: "@freesewing/plugin-grainline"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-grainline)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-grainline)
|
||||
The **@freesewing/plugin-grainline** plugin provides [the grainline
|
||||
macro](/reference/macros/grainline/) which adds a *grainline* indicator
|
||||
to your design.
|
||||
|
||||
The **grainline** plugin provides [the grainline macro](/reference/macros/grainline/):
|
||||
|
||||
<Example part="plugin_grainline" caption="An example of the grainline macro" design={false} />
|
||||
|
||||
```js
|
||||
let { Point, points, macro } = part.shorthand();
|
||||
|
||||
points.grainlineFrom = new Point(10, 10);
|
||||
points.grainlineTo = new Point(100, 10);
|
||||
|
||||
macro("grainline", {
|
||||
from: points.grainlineFrom,
|
||||
to: points.grainlineTo
|
||||
});
|
||||
```
|
||||
<Example part="plugin_grainline">An example of the grainline macro</Example>
|
||||
|
||||
<Tip>
|
||||
|
||||
|
@ -40,8 +22,8 @@ npm install @freesewing/plugin-grainline
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -51,4 +33,4 @@ import config from "../config";
|
|||
const Pattern = new freesewing.Design(config, grainline);
|
||||
```
|
||||
|
||||
Now you can use [the grainline macro](/reference/macros/grainline) in your parts.
|
||||
Now you can use [the grainline macro](/reference/api/macros/grainline) in your parts.
|
||||
|
|
|
@ -1,21 +1,11 @@
|
|||
---
|
||||
title: i18n
|
||||
title: "@freesewing/plugin-i18n"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-i18n)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-i18n)
|
||||
|
||||
The **i18n** plugin provides translation for your pattern:
|
||||
|
||||
<Example part="path_attr" caption="An example in English" design={false} options={{locale: 'en'}} />
|
||||
<Example part="path_attr" caption="An example in French" design={false} options={{locale: 'fr'}} />
|
||||
|
||||
It uses the [`insertText`](/plugins#inserttext) hook to do so.
|
||||
The **@freesewing/plugin-i18n** plugin provides a mechanism to translate your designs.
|
||||
It does that by attaching to [the insertText lifecycle hook](/reference/api/hooks/inserttext) to
|
||||
intercept all operations that add text to a design and attempt to translate the text
|
||||
prior to insertion.
|
||||
|
||||
<Note>
|
||||
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
---
|
||||
title: logo
|
||||
title: "@freesewing/plugin-logo"
|
||||
---
|
||||
|
||||
[](/plugins)
|
||||
|
||||
[](https://www.npmjs.com/package/@freesewing/plugin-logo)
|
||||
|
||||
[](https://deepscan.io/dashboard#view=project&tid=2114&pid=2993&bid=23256)
|
||||
|
||||
[](https://github.com/freesewing/freesewing/issues?q=is%3Aissue+is%3Aopen+label%3Apkg%3Aplugin-logo)
|
||||
The **@freesewing/plugin-logo** plugin provides the FreeSewing logo
|
||||
as [the logo snippet](/reference/api/snippets/logo).
|
||||
It's a plugin you most likely want to replace with your own version
|
||||
if you want to generate patterns with your own branding.
|
||||
|
||||
The **logo** plugin provides [the logo snippet](/reference/snippets/):
|
||||
|
||||
<Example part="plugin_logo" caption="An example of the logo snippet" design={false} />
|
||||
|
||||
```js
|
||||
let { Point, snippets, Snippet } = part.shorthand();
|
||||
|
||||
snippets.logo = new Snippet("logo", new Point(50, 30));
|
||||
```
|
||||
<Example part="plugin_logo">An example of the logo snippet</Example>
|
||||
|
||||
<Tip>
|
||||
|
||||
|
@ -34,8 +23,8 @@ npm install @freesewing/plugin-logo
|
|||
|
||||
## Usage
|
||||
|
||||
Like all [build-time plugins](/guides/plugins/#build-time-plugins), you load them
|
||||
by passing them to the [`freesewing.Design`](/reference/api#design) constructor:
|
||||
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
||||
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
||||
|
||||
```js
|
||||
import freesewing from "@freesewing/core";
|
||||
|
@ -45,3 +34,5 @@ import config from "../config";
|
|||
const Pattern = new freesewing.Design(config, logo);
|
||||
```
|
||||
|
||||
You can now use the [logo](/reference/api/snippets/logo) snippet in your parts.
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue