1
0
Fork 0

Merged crowding translation post merging of different crowdin projects

This commit is contained in:
Joost De Cock 2021-08-27 11:27:45 +02:00
commit e2278e5663
1344 changed files with 1450 additions and 22925 deletions

View file

@ -1,7 +1,13 @@
##### Development environment now uses React 17 and Webpack 5
##### Project 2022: New frontends for FreeSewing
Version 2.16 of FreeSewing brings some important changes for developers.
Read [our blog post on version 2.16](https://freesewing.org/blog/react-17/) for more info.
Over the summer, Joost has started working on *project 2022*, an effort to
migrate the FreeSewing websites (freesewing.org and freesewing.dev) from
GatbsyJS to NextJS, and in the process consolidate and streamline our various repositories.
It comes with a new development blog, which you can read at: [2022.freesewing.dev/blog](https://2022.freesewing.dev/blog)
If you'd like to get involved in this effert, head over to [discord.freesewing.org](https://discord.freesewing.org/) and
join the **project-2022** channel.
##### Next contributor call on 04 September

View file

@ -12,23 +12,18 @@ const output = [
format: 'cjs',
sourcemap: true,
exports: rollup.exports,
}
},
]
if (typeof module !== 'undefined')
output.push({
banner,
file: module,
format: 'es',
sourcemap: true
sourcemap: true,
})
export default {
input: 'src/index.js',
output,
plugins: [
peerDepsExternal(),
resolve({ modulesOnly: true }),
commonjs(),
json(),
]
plugins: [peerDepsExternal(), resolve({ modulesOnly: true }), commonjs(), json()],
}

View file

@ -1,66 +0,0 @@
---
title: Documentation for contributors
---
Are you interested in contributing to freesewing? That's awesome, and exactly why this thing is open source in the first place.
## Code of conduct
Freesewing strives to be an open and inclusive community. To keep the trolls at bay, we have a [code of conduct](/guides/code-of-conduct/). As a contributor, you are expected to uphold it.
## Where to get help or report a problem
- The [freesewing chat room on Gitter](https://gitter.im/freesewing/help) is the best place to ask questions, meet other freesewers, or just hang out and share a laugh.
- Chat not your thing? The [@freesewing_org](https://twitter.com/freesewing_org) Twitter account is the next best thing.
- Haben Sie einen Fehler festgestellt? Have a suggestion for an improvement? Please [file an issue on GitHub](https://github.com/freesewing/freesewing/issues/new). Dafür benötigen Sie einen GitHub-Account, diesen können Sie kostenlos erstellen.
## Ways to contribute
There's may ways to contribute to freesewing. Here are some of the more common ones, from easy to more involved:
### Help spread the word
Tell your friends about freesewing, or spread awareness on social media. If you have a blog, perhaps you can write about us, or review one of our patterns.
It may seem simple, but it's probably how you heard about us in the first place. So pay it forward.
### Improve our content
On every page, there's a link at the bottom that allows you to submit improvements. You'll need a GitHub account for this, but they are free.
Use that button. Don't be shy. If you see a typo, or something that needs clarification or more detail, please suggest your improvements.
### Help with translation
Translation is one of the most important aspects to bring FreeSewing to all corners of the world. It's also something for which we are completely dependent on the community.
Our [documentation for translators](/guides/translator/) will tell you all you need to know to get started.
### Test, make, or showcase our patterns
Are you a maker? Go ahead and make [our patterns](https://freesewing.org/patterns), share your experience, and provide us your feedback.
We'd love to get pictures to [showcase](https://freesewing.org/showcase) on our website too.
### Design patterns
Desiging more FreeSewing patterns is a great way to help out.
You can [take the tutorial](/tutorials/pattern-design/) and jump right in. Or, join [our chat room on Gitter](https://gitter.im/freesewing/development) to discuss ideas, or find designers or developers to team up with.
### Contribute to our code
Interested in submitting a pull request for our code? Awesome. All [our repositories](/reference/repos/) are available [on GitHub](https://github.com/freesewing).
Our [chat room on Gitter](https://gitter.im/freesewing/development) is the best place to discuss ideas or ask questions.
### Become a patron
All our patterns, and all our code, is accessible to everyone, regardless of where they live or what they can afford.
This is made possible by our Patrons; Loyal supporters who ensure a sustainable future for freesewing.org, our code, our patterns, and our community.
You can [become a Patron for as little as 2€ per month](https://freesewing.org/patrons/join). It's a very tangible way to support the project.

View file

@ -1,66 +0,0 @@
---
title: Documentation for contributors
---
Are you interested in contributing to freesewing? That's awesome, and exactly why this thing is open source in the first place.
## Code of conduct
Freesewing strives to be an open and inclusive community. To keep the trolls at bay, we have a [code of conduct](/guides/code-of-conduct/). As a contributor, you are expected to uphold it.
## Where to get help or report a problem
- The [freesewing chat room on Gitter](https://gitter.im/freesewing/help) is the best place to ask questions, meet other freesewers, or just hang out and share a laugh.
- Chat not your thing? The [@freesewing_org](https://twitter.com/freesewing_org) Twitter account is the next best thing.
- Did you spot a mistake? Have a suggestion for an improvement? Please [file an issue on GitHub](https://github.com/freesewing/freesewing/issues/new). You'll need a GitHub account, but they are free.
## Ways to contribute
There's may ways to contribute to freesewing. Here are some of the more common ones, from easy to more involved:
### Help spread the word
Tell your friends about freesewing, or spread awareness on social media. If you have a blog, perhaps you can write about us, or review one of our patterns.
It may seem simple, but it's probably how you heard about us in the first place. So pay it forward.
### Improve our content
On every page, there's a link at the bottom that allows you to submit improvements. You'll need a GitHub account for this, but they are free.
Use that button. Don't be shy. If you see a typo, or something that needs clarification or more detail, please suggest your improvements.
### Help with translation
Translation is one of the most important aspects to bring FreeSewing to all corners of the world. It's also something for which we are completely dependent on the community.
Our [documentation for translators](/guides/translator/) will tell you all you need to know to get started.
### Test, make, or showcase our patterns
Are you a maker? Go ahead and make [our patterns](https://freesewing.org/patterns), share your experience, and provide us your feedback.
We'd love to get pictures to [showcase](https://freesewing.org/showcase) on our website too.
### Design patterns
Desiging more FreeSewing patterns is a great way to help out.
You can [take the tutorial](/tutorials/pattern-design/) and jump right in. Or, join [our chat room on Gitter](https://gitter.im/freesewing/development) to discuss ideas, or find designers or developers to team up with.
### Contribute to our code
Interested in submitting a pull request for our code? Awesome. All [our repositories](/reference/repos/) are available [on GitHub](https://github.com/freesewing).
Our [chat room on Gitter](https://gitter.im/freesewing/development) is the best place to discuss ideas or ask questions.
### Become a patron
All our patterns, and all our code, is accessible to everyone, regardless of where they live or what they can afford.
This is made possible by our Patrons; Loyal supporters who ensure a sustainable future for freesewing.org, our code, our patterns, and our community.
You can [become a Patron for as little as 2€ per month](https://freesewing.org/patrons/join). It's a very tangible way to support the project.

View file

@ -1,66 +0,0 @@
---
title: Documentation for contributors
---
Are you interested in contributing to freesewing? That's awesome, and exactly why this thing is open source in the first place.
## Code of conduct
Freesewing strives to be an open and inclusive community. To keep the trolls at bay, we have a [code of conduct](/guides/code-of-conduct/). As a contributor, you are expected to uphold it.
## Where to get help or report a problem
- The [freesewing chat room on Gitter](https://gitter.im/freesewing/help) is the best place to ask questions, meet other freesewers, or just hang out and share a laugh.
- Chat not your thing? The [@freesewing_org](https://twitter.com/freesewing_org) Twitter account is the next best thing.
- Avez-vous trouvé une erreur ? Have a suggestion for an improvement? Please [file an issue on GitHub](https://github.com/freesewing/freesewing/issues/new). Vous aurez besoin d'un compte GitHub, mais ils sont gratuits.
## Ways to contribute
There's may ways to contribute to freesewing. Here are some of the more common ones, from easy to more involved:
### Help spread the word
Tell your friends about freesewing, or spread awareness on social media. If you have a blog, perhaps you can write about us, or review one of our patterns.
It may seem simple, but it's probably how you heard about us in the first place. So pay it forward.
### Improve our content
On every page, there's a link at the bottom that allows you to submit improvements. You'll need a GitHub account for this, but they are free.
Use that button. Don't be shy. If you see a typo, or something that needs clarification or more detail, please suggest your improvements.
### Help with translation
Translation is one of the most important aspects to bring FreeSewing to all corners of the world. It's also something for which we are completely dependent on the community.
Our [documentation for translators](/guides/translator/) will tell you all you need to know to get started.
### Test, make, or showcase our patterns
Are you a maker? Go ahead and make [our patterns](https://freesewing.org/patterns), share your experience, and provide us your feedback.
We'd love to get pictures to [showcase](https://freesewing.org/showcase) on our website too.
### Design patterns
Desiging more FreeSewing patterns is a great way to help out.
You can [take the tutorial](/tutorials/pattern-design/) and jump right in. Or, join [our chat room on Gitter](https://gitter.im/freesewing/development) to discuss ideas, or find designers or developers to team up with.
### Contribute to our code
Interested in submitting a pull request for our code? Awesome. All [our repositories](/reference/repos/) are available [on GitHub](https://github.com/freesewing).
Our [chat room on Gitter](https://gitter.im/freesewing/development) is the best place to discuss ideas or ask questions.
### Become a patron
All our patterns, and all our code, is accessible to everyone, regardless of where they live or what they can afford.
This is made possible by our Patrons; Loyal supporters who ensure a sustainable future for freesewing.org, our code, our patterns, and our community.
You can [become a Patron for as little as 2€ per month](https://freesewing.org/patrons/join). It's a very tangible way to support the project.

View file

@ -1,66 +0,0 @@
---
title: Documentation for contributors
---
Are you interested in contributing to freesewing? That's awesome, and exactly why this thing is open source in the first place.
## Code of conduct
Freesewing strives to be an open and inclusive community. To keep the trolls at bay, we have a [code of conduct](/guides/code-of-conduct/). As a contributor, you are expected to uphold it.
## Where to get help or report a problem
- The [freesewing chat room on Gitter](https://gitter.im/freesewing/help) is the best place to ask questions, meet other freesewers, or just hang out and share a laugh.
- Chat not your thing? The [@freesewing_org](https://twitter.com/freesewing_org) Twitter account is the next best thing.
- Foutje gevonden? Have a suggestion for an improvement? Please [file an issue on GitHub](https://github.com/freesewing/freesewing/issues/new). Je hebt een Github accout nodig, maar die zijn gratis.
## Ways to contribute
There's may ways to contribute to freesewing. Here are some of the more common ones, from easy to more involved:
### Help spread the word
Tell your friends about freesewing, or spread awareness on social media. If you have a blog, perhaps you can write about us, or review one of our patterns.
It may seem simple, but it's probably how you heard about us in the first place. So pay it forward.
### Improve our content
On every page, there's a link at the bottom that allows you to submit improvements. You'll need a GitHub account for this, but they are free.
Use that button. Don't be shy. If you see a typo, or something that needs clarification or more detail, please suggest your improvements.
### Help with translation
Translation is one of the most important aspects to bring FreeSewing to all corners of the world. It's also something for which we are completely dependent on the community.
Our [documentation for translators](/guides/translator/) will tell you all you need to know to get started.
### Test, make, or showcase our patterns
Are you a maker? Go ahead and make [our patterns](https://freesewing.org/patterns), share your experience, and provide us your feedback.
We'd love to get pictures to [showcase](https://freesewing.org/showcase) on our website too.
### Design patterns
Desiging more FreeSewing patterns is a great way to help out.
You can [take the tutorial](/tutorials/pattern-design/) and jump right in. Or, join [our chat room on Gitter](https://gitter.im/freesewing/development) to discuss ideas, or find designers or developers to team up with.
### Contribute to our code
Interested in submitting a pull request for our code? Awesome. All [our repositories](/reference/repos/) are available [on GitHub](https://github.com/freesewing).
Our [chat room on Gitter](https://gitter.im/freesewing/development) is the best place to discuss ideas or ask questions.
### Become a patron
All our patterns, and all our code, is accessible to everyone, regardless of where they live or what they can afford.
This is made possible by our Patrons; Loyal supporters who ensure a sustainable future for freesewing.org, our code, our patterns, and our community.
You can [become a Patron for as little as 2€ per month](https://freesewing.org/patrons/join). It's a very tangible way to support the project.

View file

@ -1,19 +0,0 @@
---
title: freesewing.dev
order: 20
---
The content for our freesewing.dev website is stored in the `dev` folder
of [our Markdown repository](https://github.com/freesewing/markdown/).
Each page is in its own folder and contains an `en.md` file.
All images and other media used by the page/post will also be contained in the folder.
<Note>
You might still see some files from other langauges (like `es.md`, `fr.md`, `de.md`, or `nl.md`) that
predate the decision to only provide freesewing.dev in English.
You can remove those files.
</Note>

View file

@ -1,16 +0,0 @@
---
title: Emails
order: 50
---
By *emails* we mean the kind of automated emails that are sent out by
the FreeSewing backend. Like when you sign up, or ask for a password reset
and so on.
The content of these emails comes from the `src/templates` folder
of [our backend repository](https://github.com/freesewing/backend).
However, most of the actual text that the user gets to see is defined in one of
the YAML files of our i18n package (specifically `email.yaml).
See [strings](/editors/content/strings/) for more details.

View file

@ -4,6 +4,46 @@ title: Content sources
As an editor, you need to know where you can find/edit what type of content.
Below is a list of all our content sources:
## The freesewing monorepo
<ReadMore list />
Our [freesewing monorepo](https://github/freesewing/freesewing) holds the majority of all our code and content.
Here you can find:
- Content for freesewing.org: in the `markdown/org` folder
- Content for freesewing.dev: in the `markdown/dev` folder
- Strings used throughout the software: in the `packages/i18n/src/locales` folder
<Note>
##### Edit, don't translate
As an editor, you only ever work with the `en.md` files. The rest is for the translators.
When creating new content, you don't have to create the other files, only `en.md`.
The rest will be created automatically.
</Note>
## Strapi
FreeSewing uses [the Strapi content management system](https://strapi.io/) as a headless content management system for various posts:
- For blog posts on freesewing.org
- For showcase posts on freesewing.org
- For blog posts on freesewing.dev
- For newsletter editions
The Strapi instance is available at [posts.freesewing.org](https://posts.freesewing.org)
## Emails sent from our backend
The last bit of content is emails that are sent out from our backend systems.
They are in the [backend repository](https://github.com/freesewing/backend).
<Note>
It's on our todo list to bring the backend code into our monorepo
</Note>

View file

@ -1,6 +0,0 @@
---
title: Newsletter
order: 40
---
<Fixme>Under construction</Fixme>

View file

@ -1,35 +0,0 @@
---
title: freesewing.org
order: 10
---
The content for our freesewing.org website is stored in the `org` folder
of [our Markdown repository](https://github.com/freesewing/markdown/).
Within it, you will find the following 4 subfolders:
- `org/blog`: Holds the freesewing.org blog posts
- `org/docs`: Holds the freesewing.org documentation (everything under `/docs` on the site)
- `org/showcase`: Holds the freesewing.org showcase posts
- `org/ui`: Holds snippets of text used throughout the UI that are too large or volatile to be translated as strings
Each page or post is in its own folder that contains the following five files:
- `de.md`: The German version
- `en.md`: The (original) English version
- `es.md`: The Spanish version
- `fr.md`: The French version
- `nl.md`: The Dutch version
All images and other media used by the page/post will also be contained in the folder.
<Note>
##### Edit, don't translate
As an editor, you only ever work with the `en.md` files. The rest is for the translators.
When creating new content, you don't have to create the other files, only `en.md`.
The rest will be created automatically.
</Note>

View file

@ -1,32 +0,0 @@
---
title: Strings
order: 30
---
With *strings* we mean all of the translation stored in [our i18n package](/reference/pacakges/i18n) that
provides internationalization.
They are a number of YAML files that you can find in the `packages/i18n/src/locales/en` folder of
[our monorepo](https://github.com/freesewing/freesewing/)
These files are typically the domain of translators, as they contain short strings and snippets of
text used throughout the software/website rather than flowing text.
However, as an editor, it's good to know where they live.
<Note>
##### Beware that making changes will have ripple-effects on translation
If you make a change to one of the (English) YAML files, this will have a knock-on
effect on translators as this string now needs to be re-translated.
</Note>
<Warning>
Never make changes in the non-English files as they will simply be
overwritten by our translation software.
</Warning>

View file

@ -1,13 +0,0 @@
---
title: Add the body of the blog post
order: 90
---
Below the frontmatter, you can write the body of your blog post, [using markdown](/editors/markdown/).
<Tip>
You can look at [one of the many blog posts](https://github.com/freesewing/markdown/tree/develop/org/blog) for examples.
</Tip>

View file

@ -1,34 +0,0 @@
---
title: Add the frontmatter
order: 40
---
Frontmatter is metadata that we add to the top of the file.
Please refere to [working with frontmatter](/howtos/editors/frontmatter/) if you're not sure how to use it.
The following fields need to be filled in:
| Name | Description |
| ----:| ----------- |
| `date` | **Must** be in format `YYYY-MM-DD` |
| `title` | Title of the blog post |
| `linktitle` | If the title is very long, you can specify an alternative title for use in menus, breadcrumbs, and so on. This field is optional. |
| `img` | Filename of the main image. Must be placed in the folder of the showcase |
| `caption` | The caption that will go below the image |
| `author` | FreeSewing username of the author |
Below is an example:
```md
---
date: 2020-09-09
title: FreeSewing 2.9 brings our Teagan T-shirt pattern
linktitle: "Our latest pattern is Teagan, a fitted T-shirt"
img: teagan2.jpg
caption: "Photo by Alex Andrews from Pexels"
author: joost
---
```
Add the frontmatter to the top of the `en.md` file.

View file

@ -1,23 +0,0 @@
---
title: Add images to the folder
order: 30
---
Add the images you want to use to the folder. Keep the following guidelines in mind:
- The main blog picture should be a landscape image
- The best resolution for the main image is 2000x1348 pixels
- None of the images should be larger than 2000px on their longest side
- Use lowercase for all filenames
<Note>
##### Please think twice before dropping a 7Mb image.
Git never forgets. So if you drop a couple of 7Mb images into our repo,
they will be there forever, making cloning the repo very slow.
So please resize your images before you commit your changes.
</Note>

View file

@ -1,14 +0,0 @@
---
title: Create a new file for the blog post
order: 20
---
In the folder you just created, create a new empty file, and name it `en.md`.
<Note>
While we support translation, we do not support adding original content in
any language other than English. This is why the file **must** be named
`en.md` and be written in English.
</Note>

View file

@ -1,18 +0,0 @@
---
title: Create a new folder for the blog post
order: 10
---
Our [markdown repository](https://github.com/freesewing/markdown/) holds all content
for both freesewing.org and freesewing.dev.
The content for blog posts on freesewing.org is in the `org/blog` folder.
You'll find a bunch of directories here for all the existing blog posts.
Create a new one keeping in mind that this will determine the URL under which the post
is available. So:
- No spaces
- No uppercase
- Stick to `a-z` and `-` to be safe

View file

@ -1,15 +1,11 @@
---
title: Adding a blog post on freesewing.org
title: Adding a blog post
for: editors
---
These are the steps required to add a new [blog post](https://freesewing.org/showcase/) to the website:
Blog posts have been migrated to [Strapi](https://strapi.io/), a headless CMS system.
<ReadMore list />
Our strapi instance can be accessed at [posts.freesewing.org](https://posts.freesewing.org/).
- Create a new folder in the `org/blog` directory of [our markdown repository](https://github.com/freesewing/markdown/)
- Add an `en.md` markdown file to this folder
- Add one of more images to the folder
- Add the frontmatter to the file
- Add the body of the file
If you don't have a Strapi account (yet), [reach out to us on Discord](https://discord.freesewing.org).

View file

@ -1,12 +0,0 @@
---
title: Add the body of the showcase post
order: 50
---
Below the frontmatter, you can write the body of your showcase post, [using markdown](/editors/markdown/).
<Tip>
You can look at [one of the many showcases](https://github.com/freesewing/markdown/tree/develop/org/showcase) for examples.
</Tip>

View file

@ -1,33 +0,0 @@
---
title: Add the frontmatter
order: 40
---
Frontmatter is metadata that we add to the top of the file.
Please refere to [working with frontmatter](/howtos/editors/frontmatter/) is you're not sure how to use it.
The following fields need to be filled in:
| Name | Description |
| ----:| ----------- |
| `date` | **Must** be in format `YYYY-MM-DD` |
| `title` | Title of the showcase |
| `img` | Filename of the main image. Must be placed in the folder of the showcase |
| `caption` | The caption that will go below the image |
| `patterns` | An array of designs/patterns that are being showcased. Lowercase only |
| `author` | FreeSewing username of the author |
Below is an example:
```md
---
date: 2018-09-29
title: Yoga Outfit by Paul
img: showcase.jpg
caption: "Aaron and Bruce yoga set with stripes by Paul (up-side-down)"
patterns: [aaron,bruce]
author: Tiger751023
---
```
Add the frontmatter to the top of the `en.md` file.

View file

@ -1,23 +0,0 @@
---
title: Add images to the folder
order: 30
---
Add the images you want to use to the folder. Keep the following guidelines in mind:
- The main showcase picture should, if possible, be a landscape image
- The best resolution for the main image is 2000x1348 pixels
- None of the images should be larger than 2000px on their longest side
- Use lowercase for all filenames
<Note>
##### Please think twice before dropping a 7Mb image.
Git never forgets. So if you drop a couple of 7Mb images into our repo,
they will be there forever, making cloning the repo very slow.
So please resize your images before you commit your changes.
</Note>

View file

@ -1,14 +0,0 @@
---
title: Create a new file for the showcase post
order: 20
---
In the folder you just created, create a new empty file, and name it `en.md`.
<Note>
While we support translation, we do not support adding original content in
any language other than English. This is why the file **must** be named
`en.md` and be written in English.
</Note>

View file

@ -1,18 +0,0 @@
---
title: Create a new folder for the showcase post
order: 10
---
Our [markdown repository](https://github.com/freesewing/markdown/) holds all content
for both freesewing.org and freesewing.dev.
The content for showcases on freesewing.org is in the `org/showcase` folder.
You'll find a bunch of directories here for all the existing showcases.
Create a new one keeping in mind that this will determine the URL under which the showcase
is available. So:
- No spaces
- No uppercase
- Stick to `a-z` and `-` to be safe

View file

@ -3,80 +3,8 @@ title: Adding a showcase on freesewing.org
for: editors
---
These are the steps required to add a new [showcase](https://freesewing.org/showcase/) to the website:
Showcase posts have been migrated to [Strapi](https://strapi.io/), a headless CMS system.
- Create a new folder in the `org/showcase` directory of [our markdown repository](https://github.com/freesewing/markdown/)
- Add an `en.md` markdown file to this folder
- Add one of more images to the folder
- Add the frontmatter to the file
- Add the body of the file
Our strapi instance can be accessed at [posts.freesewing.org](https://posts.freesewing.org/).
Let's look at each step in detail:
## Create a new folder for the showcase
Our [markdown repository](https://github.com/freesewing/markdown/) holds all content
for both freesewing.org and freesewing.dev.
The content for showcases on freesewing.org is in the `org/showcase` folder.
You'll find a bunch of directories here for all the existing showcases.
Create a new one keeping in mind that this will determine the URL under which the showcase
is available. So:
- No spaces
- No uppercase
- Stick to `a-z` and `-` to be safe
## Add an `en.md` file to the folder
Create an empty file in this folder and name it `en.md`.
## Add one of more images to the folder
Add the images you want to use to the folder.
<Note>We prefer if you use lowercase for all filenames</Note>
## Add the frontmatter
Frontmatter is metadata that we add to the top of the file.
Please refere to [working with frontmatter](/editors/frontmatter) is you're not sure how to use it.
The following fields need to be filled in:
| Name | Description |
| ---- | ----------- |
| `date` | Must be in format `YYYY-MM-DD` |
| `title` | Title of the showcase |
| `img` | Filename of the main image. Must be placed in the folder of the showcase |
| `caption` | The caption that will go below the image |
| `patterns` | An array of designs/patterns that are being showcased. Lowercase only |
| `author` | FreeSewing username of the author |
Below is an example:
```md
---
date: 2018-09-29
title: Yoga Outfit by Paul
img: showcase.jpg
caption: "Aaron and Bruce yoga set with stripes by Paul (up-side-down)"
patterns: [aaron,bruce]
author: Tiger751023
---
```
Add the frontmatter to the top of the `en.md` file.
## Add the body
Below the frontmatter, you can write the body of your post, [using markdown](/editors/markdown/).
<Tip>
You can look at [one of the many showcases](https://github.com/freesewing/markdown/tree/develop/org/showcase) for examples.
</Tip>
If you don't have a Strapi account (yet), [reach out to us on Discord](https://discord.freesewing.org).

View file

@ -1,5 +0,0 @@
---
title: Core library
---
<ReadMore root='howtos/core' />

View file

@ -1,5 +0,0 @@
---
title: Core library
---
<ReadMore root='howtos/core' />

View file

@ -1,5 +0,0 @@
---
title: Core library
---
<ReadMore root='howtos/core' />

View file

@ -1,5 +0,0 @@
---
title: Core library
---
<ReadMore root='howtos/core' />

View file

@ -1,5 +0,0 @@
---
title: Howtos
---
<ReadMore root='howtos' recurse />

View file

@ -1,5 +0,0 @@
---
title: Howtos
---
<ReadMore root='howtos' recurse />

View file

@ -1,5 +0,0 @@
---
title: Howtos
---
<ReadMore root='howtos' recurse />

View file

@ -1,5 +0,0 @@
---
title: Howtos
---
<ReadMore root='howtos' recurse />

View file

@ -1,147 +0,0 @@
---
title: Attributes
---
Attributes is an object that holds attributes for a variety of other objects.
Attributes are attached to [`Point`](/reference/api/point), [`Path`](/reference/api/path), and [`Snippet`](/reference/api/snippet) objects, as well as the internal [`Svg`](/reference/api/svg) object.
All of these have an instantiated Attributes object in their `attributes` property.
An Attributes object exposes the following methods:
## add()
```js
Attributes attributes.add(string key, string value)
```
Adds `value` to the attribute identified by `key`.
Adding multiple values to the same key will result in them being joined together (with a space) when rendering.
### Attributes.add() example
```js
let { Path, paths } = part.shorthand();
// This will render as: class="classA classB"
paths.demo = new Path();
paths.demo.attributes.add('class', 'classA');
paths.demo.attributes.add('class', 'classB');
// This does the same thing:
paths.demo = new Path()
.attr('class', 'classA')
.attr('class', 'classB');
// This also has the same result:
paths.demo = new Path()
.attr('class', 'classA classB');
```
## clone()
```js
Attributes attributes.clone()
```
Returns a new Attributes object that is a deep copy of this one.
## get()
```js
string attributes.get(string key)
```
Will return the value of attribute stored under `key`, or `false` if it's not set.
If key has multiple values, they will be joined together in a string, seperated by spaces.
### Attributes.get() example
```js
let { Path, paths } = part.shorthand();
paths.demo = new Path()
.attr('class', 'classA')
.attr('class', 'classB');
let class = paths.demo.attributes.get('class');
// class now holds: "classA classB"
```
## getAsArray()
```js
array attributes.getAsArray(string key)
```
Will return an array with the value of attribute stored under `key`, or `false` if it's not set.
### Attributes.getAsArray() example
```js
let { Path, paths } = part.shorthand();
paths.demo = new Path()
.attr('class', 'classA')
.attr('class', 'classB');
let class = paths.demo.attributes.getAsArray('class');
// class now holds: ["classA", "classB"]
```
## remove()
```js
Attributes attributes.remove(string key)
```
Removes the attribute values under key and returns the Attributes object.
### Attributes.remove() example
```js
let { Path, paths } = part.shorthand();
paths.demo = new Path()
.attr('class', 'classA')
.attr('class', 'classB');
let class = paths.example.attributes
.remove()
.get('class');
// class now holds: false
```
## set()
```js
Attributes attributes.set(string key, string value)
```
Sets the attribute identified by `key` to value `value`.
<Warning>
This will overwrite any value that's currently set on the attribute identified by `key`.
</Warning>
### Attributes.set() example
```js
let { Path, paths } = part.shorthand();
// This will render as: class="classB"
paths.demo = new Path();
paths.demo.attributes.set('class', 'classA');
paths.demo.attributes.set('class', 'classB');
// This does the same thing:
paths.demo = new Path()
.attr('class', 'classA', true)
.attr('class', 'classB', true);
```

View file

@ -1,33 +0,0 @@
---
title: API Reference
order: 500
---
Freesewing exports a single object with the following properties:
- `version`: A string containing the FreeSewing version number
In addition, FreeSewing's default export exposes the following method:
- `Design()`: A *super-constructor* to create new pattern designs.
## Design()
```js
function freesewing.Design(object config, object|array plugins)
```
Use this method to create a new pattern design. It takes the following arguments:
- `config` : The pattern configuration
- `plugins` : Either a plugin object, or an array of plugin objects to load in your pattern
<Tip>
This method will return a constructor method that should be called to
instantiate your pattern.
See [creating a new pattern design](/concepts/new-design) for an example.
</Tip>

View file

@ -1,33 +0,0 @@
---
title: API Reference
order: 500
---
Freesewing exports a single object with the following properties:
- `version`: A string containing the FreeSewing version number
In addition, FreeSewing's default export exposes the following method:
- `Design()`: A *super-constructor* to create new pattern designs.
## Design()
```js
function freesewing.Design(object config, object|array plugins)
```
Use this method to create a new pattern design. It takes the following arguments:
- `config` : The pattern configuration
- `plugins` : Either a plugin object, or an array of plugin objects to load in your pattern
<Tip>
This method will return a constructor method that should be called to
instantiate your pattern.
See [creating a new pattern design](/concepts/new-design) for an example.
</Tip>

View file

@ -1,33 +0,0 @@
---
title: API Reference
order: 500
---
Freesewing exports a single object with the following properties:
- `version`: A string containing the FreeSewing version number
In addition, FreeSewing's default export exposes the following method:
- `Design()`: A *super-constructor* to create new pattern designs.
## Design()
```js
function freesewing.Design(object config, object|array plugins)
```
Use this method to create a new pattern design. It takes the following arguments:
- `config` : The pattern configuration
- `plugins` : Either a plugin object, or an array of plugin objects to load in your pattern
<Tip>
This method will return a constructor method that should be called to
instantiate your pattern.
See [creating a new pattern design](/concepts/new-design) for an example.
</Tip>

View file

@ -1,33 +0,0 @@
---
title: API Reference
order: 500
---
Freesewing geeft een enkel object terug met de volgende eigenschappen:
- `version`: Een string met het FreeSewing versie nummer
En FreeSewing's standaard export geeft toegang tot de volgende methode:
- `Design()`: A *super-constructor* to create new pattern designs.
## Design()
```js
function freesewing.Design(object config, object|array plugins)
```
Gebruik deze methode om een nieuw patroon ontwerp te maken. Het gebruikt de volgende argumenten:
- `config` : De patroon configuratie
- `plugins` : Of een plugin object, of een array van plugin objecten die in jouw patroon geladen moeten worden.
<Tip>
Deze methode geeft constructor methode die moet worden aangeroepen om uw patroon
te beginnen.
See [creating a new pattern design](/concepts/new-design) for an example.
</Tip>

View file

@ -1,73 +0,0 @@
---
title: Snippet
---
A snippet is a reuseable bit of markup for your pattern. They are added to the SVG `defs` section, and rendered with the SVG `use` tag.
The snippet constructor takes two arguments:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](#point) on which to anchor the snippet
```js
Snippet new Snippet(def, Point);
```
A Snippet object comes with the following properties:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](../point) on which to anchor the snippet
- `attributes` : An [`Attributes`](../attributes) instance holding the snippet's attributes
In addition, a Snippet object exposes the following methods:
## attr()
```js
Snippet snippet.attr(
string name,
mixed value,
bool overwrite = false
)
```
This `Snippet.attr()` method calls [`Attributes.add()`](./attributes#add) under the hood, but returns the Snippet object. This allows you to chain different calls together.
If the third parameter is set to `true` it will call [`Attributes.set()`](./attributes#set) instead, thereby overwriting the value of the attribute.
### Snippet.attr() example
<Example part="snippet_attr" caption="An example of the Snippet.attr() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(50, 15);
snippets.demo = new Snippet("logo", points.anchor)
.attr("data-scale", 0.8)
.attr("data-rotate", 180);
```
## clone()
```js
Snippet snippet.clone()
```
### Snippet.clone() example
Returns a new Snippets object that is a deep copy of this one.
<Example part="snippet_clone" caption="An example of the Snippet.clone() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(35, 35);
snippets.demo = new Snippet("logo", points.anchor)
.attr("style", "color: #f006");
snippets.clone = snippets.demo
.clone()
.attr("data-scale", 0.5);
```

View file

@ -1,73 +0,0 @@
---
title: Snippet
---
A snippet is a reuseable bit of markup for your pattern. They are added to the SVG `defs` section, and rendered with the SVG `use` tag.
The snippet constructor takes two arguments:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](#point) on which to anchor the snippet
```js
Snippet new Snippet(def, Point);
```
A Snippet object comes with the following properties:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](../point) on which to anchor the snippet
- `attributes` : An [`Attributes`](../attributes) instance holding the snippet's attributes
In addition, a Snippet object exposes the following methods:
## attr()
```js
Snippet snippet.attr(
string name,
mixed value,
bool overwrite = false
)
```
This `Snippet.attr()` method calls [`Attributes.add()`](./attributes#add) under the hood, but returns the Snippet object. This allows you to chain different calls together.
If the third parameter is set to `true` it will call [`Attributes.set()`](./attributes#set) instead, thereby overwriting the value of the attribute.
### Snippet.attr() example
<Example part="snippet_attr" caption="An example of the Snippet.attr() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(50, 15);
snippets.demo = new Snippet("logo", points.anchor)
.attr("data-scale", 0.8)
.attr("data-rotate", 180);
```
## clone()
```js
Snippet snippet.clone()
```
### Snippet.clone() example
Returns a new Snippets object that is a deep copy of this one.
<Example part="snippet_clone" caption="An example of the Snippet.clone() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(35, 35);
snippets.demo = new Snippet("logo", points.anchor)
.attr("style", "color: #f006");
snippets.clone = snippets.demo
.clone()
.attr("data-scale", 0.5);
```

View file

@ -1,73 +0,0 @@
---
title: Snippet
---
A snippet is a reuseable bit of markup for your pattern. They are added to the SVG `defs` section, and rendered with the SVG `use` tag.
The snippet constructor takes two arguments:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](#point) on which to anchor the snippet
```js
Snippet new Snippet(def, Point);
```
A Snippet object comes with the following properties:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](../point) on which to anchor the snippet
- `attributes` : An [`Attributes`](../attributes) instance holding the snippet's attributes
In addition, a Snippet object exposes the following methods:
## attr()
```js
Snippet snippet.attr(
string name,
mixed value,
bool overwrite = false
)
```
This `Snippet.attr()` method calls [`Attributes.add()`](./attributes#add) under the hood, but returns the Snippet object. This allows you to chain different calls together.
If the third parameter is set to `true` it will call [`Attributes.set()`](./attributes#set) instead, thereby overwriting the value of the attribute.
### Snippet.attr() example
<Example part="snippet_attr" caption="An example of the Snippet.attr() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(50, 15);
snippets.demo = new Snippet("logo", points.anchor)
.attr("data-scale", 0.8)
.attr("data-rotate", 180);
```
## clone()
```js
Snippet snippet.clone()
```
### Snippet.clone() example
Returns a new Snippets object that is a deep copy of this one.
<Example part="snippet_clone" caption="An example of the Snippet.clone() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(35, 35);
snippets.demo = new Snippet("logo", points.anchor)
.attr("style", "color: #f006");
snippets.clone = snippets.demo
.clone()
.attr("data-scale", 0.5);
```

View file

@ -1,73 +0,0 @@
---
title: Snippet
---
A snippet is a reuseable bit of markup for your pattern. They are added to the SVG `defs` section, and rendered with the SVG `use` tag.
The snippet constructor takes two arguments:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](#point) on which to anchor the snippet
```js
Snippet new Snippet(def, Point);
```
A Snippet object comes with the following properties:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](../point) on which to anchor the snippet
- `attributes` : An [`Attributes`](../attributes) instance holding the snippet's attributes
In addition, a Snippet object exposes the following methods:
## attr()
```js
Snippet snippet.attr(
string name,
mixed value,
bool overwrite = false
)
```
This `Snippet.attr()` method calls [`Attributes.add()`](./attributes#add) under the hood, but returns the Snippet object. This allows you to chain different calls together.
If the third parameter is set to `true` it will call [`Attributes.set()`](./attributes#set) instead, thereby overwriting the value of the attribute.
### Snippet.attr() example
<Example part="snippet_attr" caption="An example of the Snippet.attr() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(50, 15);
snippets.demo = new Snippet("logo", points.anchor)
.attr("data-scale", 0.8)
.attr("data-rotate", 180);
```
## clone()
```js
Snippet snippet.clone()
```
### Snippet.clone() example
Returns a new Snippets object that is a deep copy of this one.
<Example part="snippet_clone" caption="An example of the Snippet.clone() method" />
```js
let { Point, points, Snippet, snippets } = part.shorthand();
points.anchor = new Point(35, 35);
snippets.demo = new Snippet("logo", points.anchor)
.attr("style", "color: #f006");
snippets.clone = snippets.demo
.clone()
.attr("data-scale", 0.5);
```

View file

@ -1,46 +0,0 @@
---
title: "Store"
components: true
---
## Description
The **Store** object holds a simple key/value store with methods for storing and retrieving information. A single store per pattern is shared by all pattern parts.
A store is typically used to share information between parts. For example the length of the neck opening in one part can be used to calculate the length for the collar in another part.
<Tip>
###### The store is available as shorthand
You can access the store instance from the [Part.shorthand](./part#shorthand) method;
```js
let { store } = part.shorthand();
```
</Tip>
## get()
```js
mixed store.get(string key)
```
Returnes the value stored under `key`.
## set()
```js
void store.set(string key, mixed value)
```
Stores the value of `value` in the store under key `key`.
## setIfUnset()
```js
void store.setIfUnset(string key, mixed value)
```
Stores the value of `value` in the store under key `key`, but only if that key does not already hold a value.

View file

@ -1,46 +0,0 @@
---
title: "Store"
components: true
---
## Description
The **Store** object holds a simple key/value store with methods for storing and retrieving information. A single store per pattern is shared by all pattern parts.
A store is typically used to share information between parts. For example the length of the neck opening in one part can be used to calculate the length for the collar in another part.
<Tip>
###### The store is available as shorthand
You can access the store instance from the [Part.shorthand](./part#shorthand) method;
```js
let { store } = part.shorthand();
```
</Tip>
## get()
```js
mixed store.get(string key)
```
Returnes the value stored under `key`.
## set()
```js
void store.set(string key, mixed value)
```
Stores the value of `value` in the store under key `key`.
## setIfUnset()
```js
void store.setIfUnset(string key, mixed value)
```
Stores the value of `value` in the store under key `key`, but only if that key does not already hold a value.

View file

@ -1,46 +0,0 @@
---
title: "Store"
components: true
---
## Description
The **Store** object holds a simple key/value store with methods for storing and retrieving information. A single store per pattern is shared by all pattern parts.
A store is typically used to share information between parts. For example the length of the neck opening in one part can be used to calculate the length for the collar in another part.
<Tip>
###### The store is available as shorthand
You can access the store instance from the [Part.shorthand](./part#shorthand) method;
```js
let { store } = part.shorthand();
```
</Tip>
## get()
```js
mixed store.get(string key)
```
Returnes the value stored under `key`.
## set()
```js
void store.set(string key, mixed value)
```
Stores the value of `value` in the store under key `key`.
## setIfUnset()
```js
void store.setIfUnset(string key, mixed value)
```
Stores the value of `value` in the store under key `key`, but only if that key does not already hold a value.

View file

@ -1,46 +0,0 @@
---
title: "Store"
components: true
---
## Description
The **Store** object holds a simple key/value store with methods for storing and retrieving information. A single store per pattern is shared by all pattern parts.
Een `store` wordt meestal gebruikt om informatie tussen delen van een patroon beschikbaar te kunnen maken. Bij voorbeeld de lengte van de halsopening in een patroondeel kan worden gebruikt om de lengte van de kraag in een ander deel te kunnen berekenen.
<Tip>
###### The store is available as shorthand
You can access the store instance from the [Part.shorthand](./part#shorthand) method;
```js
let { store } = part.shorthand();
```
</Tip>
## get()
```js
mixed store.get(string sleutel)
```
Geeft de waarde terug die onder `sleutel` opgeslagen is.
## set()
```js
void store.set(string sleutel, mixed waarde)
```
Slaat de waarde `waarde` op in de `store` onder de sleutel `sleutel`.
## setIfUnset()
```js
void store.setIfUnset(string sleutel, mixed waarde)
```
Slaat de waarde `waarde` op in de `store` onder de sleutel `sleutel`, maar alleen als die sleutel nog geen waarde heeft.

View file

@ -1,107 +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.

View file

@ -1,107 +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.

View file

@ -1,107 +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.

View file

@ -1,107 +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.

View file

@ -1,48 +0,0 @@
---
title: Backend API
---
<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 />

View file

@ -1,48 +0,0 @@
---
title: Backend API
---
<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 />

View file

@ -1,48 +0,0 @@
---
title: Backend API
---
<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 />

View file

@ -1,53 +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.

View file

@ -1,53 +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.

View file

@ -1,53 +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.

View file

@ -1,53 +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.

View file

@ -1,82 +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

View file

@ -1,82 +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

View file

@ -1,82 +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

View file

@ -1,82 +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

View file

@ -1,48 +0,0 @@
---
title: Backend API
---
<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 />

View file

@ -1,52 +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.

View file

@ -1,52 +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.

View file

@ -1,52 +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.

View file

@ -1,52 +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.

View file

@ -1,84 +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

View file

@ -1,84 +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

View file

@ -1,84 +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

View file

@ -1,84 +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

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -4,8 +4,6 @@ for: contributors
about: Complete list of FreeSewing designs that we've put out
---
import Workbenches from '../../../../src/components/mdx/workbenches'
We have a growing number of designs (sewing patterns).
For each of these, we provide a stand-alone instance of our development environment.
@ -13,4 +11,8 @@ This allows you to quickly recreate issues, or kick the tires.
The full list is below:
<Workbenches />
<Fixme>
Include list based on new iterator
</Fixme>

View file

@ -1,12 +0,0 @@
---
title: Hooks API
---
A **hook** is a lifecycle event.
You can register a method for a hook. When the hook is triggered, your method will be called. It will receive two parameters:
- An object relevant to the hook (see the specific hook for details)
- Data passed when the hook was registered (optional)
<ReadMore root='reference/hooks' title="Available hooks"/>

View file

@ -1,12 +0,0 @@
---
title: Hooks API
---
A **hook** is a lifecycle event.
You can register a method for a hook. When the hook is triggered, your method will be called. It will receive two parameters:
- An object relevant to the hook (see the specific hook for details)
- Data passed when the hook was registered (optional)
<ReadMore root='reference/hooks' title="Available hooks"/>

View file

@ -1,12 +0,0 @@
---
title: Hooks API
---
A **hook** is a lifecycle event.
You can register a method for a hook. When the hook is triggered, your method will be called. It will receive two parameters:
- An object relevant to the hook (see the specific hook for details)
- Data passed when the hook was registered (optional)
<ReadMore root='reference/hooks' title="Available hooks"/>

View file

@ -1,42 +0,0 @@
---
title: insertText
---
The `insertText` hook is called when text is about to be inserted during rendering.
Methods attached to the `insertText` hook will receive 2 parameters:
- `locale` : The language code of the language requested by the user (defaults to `en`)
- `text`: The text to be inserted
Unlike most hooks that receive an object that you can make changes to, for this hook you need to return a string.
This hook is typically used for translation, as is the case in [our i18n plugin](/reference/plugins/i18n/).
## Understanding the insertText hook
When we say that *this hook is called when text is about to be inserted*, that is a simplified view. In reality, this hook is called:
- For every value set on data-text
- For the combined result of these values, joined together with spaces
Let's use an example to clarify things:
```js
points.example
.attr('data-text', "seamAllowance")
.attr('data-text', ": 1cm")
```
For the example point above, the `insertText` hook will end up being called 3 times:
- First it will pass `seamAllowance` to the plugin
- Then it will pass `: 1cm` to the plugin
- Finally it will pass `seamAllowance : 1cm` to the plugin
Having the `insertText` hook only run once with `Seam allowance: 1cm` would be problematic because the seam allowance may differ, or perhaps we're using imperial units, and so on.
Instead, you can (and should) divide your text into chunks that need translating, and chunks that do not.
This is also why we're not inserting **Seam allowance** but rather **seamAllowance**; It is merely a key to indicate what translation we want to replace this text with.

View file

@ -1,42 +0,0 @@
---
title: insertText
---
The `insertText` hook is called when text is about to be inserted during rendering.
Methods attached to the `insertText` hook will receive 2 parameters:
- `locale` : The language code of the language requested by the user (defaults to `en`)
- `text`: The text to be inserted
Unlike most hooks that receive an object that you can make changes to, for this hook you need to return a string.
This hook is typically used for translation, as is the case in [our i18n plugin](/reference/plugins/i18n/).
## Understanding the insertText hook
When we say that *this hook is called when text is about to be inserted*, that is a simplified view. In reality, this hook is called:
- For every value set on data-text
- For the combined result of these values, joined together with spaces
Let's use an example to clarify things:
```js
points.example
.attr('data-text', "seamAllowance")
.attr('data-text', ": 1cm")
```
For the example point above, the `insertText` hook will end up being called 3 times:
- First it will pass `seamAllowance` to the plugin
- Then it will pass `: 1cm` to the plugin
- Finally it will pass `seamAllowance : 1cm` to the plugin
Having the `insertText` hook only run once with `Seam allowance: 1cm` would be problematic because the seam allowance may differ, or perhaps we're using imperial units, and so on.
Instead, you can (and should) divide your text into chunks that need translating, and chunks that do not.
This is also why we're not inserting **Seam allowance** but rather **seamAllowance**; It is merely a key to indicate what translation we want to replace this text with.

View file

@ -1,42 +0,0 @@
---
title: insertText
---
The `insertText` hook is called when text is about to be inserted during rendering.
Methods attached to the `insertText` hook will receive 2 parameters:
- `locale` : The language code of the language requested by the user (defaults to `en`)
- `text`: The text to be inserted
Unlike most hooks that receive an object that you can make changes to, for this hook you need to return a string.
This hook is typically used for translation, as is the case in [our i18n plugin](/reference/plugins/i18n/).
## Understanding the insertText hook
When we say that *this hook is called when text is about to be inserted*, that is a simplified view. In reality, this hook is called:
- For every value set on data-text
- For the combined result of these values, joined together with spaces
Let's use an example to clarify things:
```js
points.example
.attr('data-text', "seamAllowance")
.attr('data-text', ": 1cm")
```
For the example point above, the `insertText` hook will end up being called 3 times:
- First it will pass `seamAllowance` to the plugin
- Then it will pass `: 1cm` to the plugin
- Finally it will pass `seamAllowance : 1cm` to the plugin
Having the `insertText` hook only run once with `Seam allowance: 1cm` would be problematic because the seam allowance may differ, or perhaps we're using imperial units, and so on.
Instead, you can (and should) divide your text into chunks that need translating, and chunks that do not.
This is also why we're not inserting **Seam allowance** but rather **seamAllowance**; It is merely a key to indicate what translation we want to replace this text with.

View file

@ -1,42 +0,0 @@
---
title: insertText
---
The `insertText` hook is called when text is about to be inserted during rendering.
Methods attached to the `insertText` hook will receive 2 parameters:
- `locale` : The language code of the language requested by the user (defaults to `en`)
- `text`: The text to be inserted
Unlike most hooks that receive an object that you can make changes to, for this hook you need to return a string.
This hook is typically used for translation, as is the case in [our i18n plugin](/reference/plugins/i18n/).
## Understanding the insertText hook
When we say that *this hook is called when text is about to be inserted*, that is a simplified view. In reality, this hook is called:
- For every value set on data-text
- For the combined result of these values, joined together with spaces
Let's use an example to clarify things:
```js
points.example
.attr('data-text', "seamAllowance")
.attr('data-text', ": 1cm")
```
For the example point above, the `insertText` hook will end up being called 3 times:
- First it will pass `seamAllowance` to the plugin
- Then it will pass `: 1cm` to the plugin
- Finally it will pass `seamAllowance : 1cm` to the plugin
Having the `insertText` hook only run once with `Seam allowance: 1cm` would be problematic because the seam allowance may differ, or perhaps we're using imperial units, and so on.
Instead, you can (and should) divide your text into chunks that need translating, and chunks that do not.
This is also why we're not inserting **Seam allowance** but rather **seamAllowance**; It is merely a key to indicate what translation we want to replace this text with.

View file

@ -1,12 +0,0 @@
---
title: Hooks API
---
A **hook** is a lifecycle event.
You can register a method for a hook. When the hook is triggered, your method will be called. It will receive two parameters:
- An object relevant to the hook (see the specific hook for details)
- Data passed when the hook was registered (optional)
<ReadMore root='reference/hooks' title="Available hooks"/>

View file

@ -1,14 +0,0 @@
---
title: postDraft
---
The `postDraft` hook runs just after your pattern is drafted.
Your plugin will receive the Pattern object.
<Note>
The `postDraft` hook is rarely used.
</Note>

View file

@ -1,14 +0,0 @@
---
title: postDraft
---
The `postDraft` hook runs just after your pattern is drafted.
Your plugin will receive the Pattern object.
<Note>
The `postDraft` hook is rarely used.
</Note>

View file

@ -1,14 +0,0 @@
---
title: postDraft
---
The `postDraft` hook runs just after your pattern is drafted.
Your plugin will receive the Pattern object.
<Note>
The `postDraft` hook is rarely used.
</Note>

View file

@ -1,14 +0,0 @@
---
title: postDraft
---
The `postDraft` hook runs just after your pattern is drafted.
Your plugin will receive the Pattern object.
<Note>
The `postDraft` hook is rarely used.
</Note>

View file

@ -1,16 +0,0 @@
---
title: postRender
---
The `postRender` hook is triggered after the SVG is rendered.
Like the `preRender` hook, it receives [the SVG object](/api/svg) as its first parameter.
<Note>
The `postRender` hooks is rarely used.
</Note>

View file

@ -1,16 +0,0 @@
---
title: postRender
---
The `postRender` hook is triggered after the SVG is rendered.
Like the `preRender` hook, it receives [the SVG object](/api/svg) as its first parameter.
<Note>
The `postRender` hooks is rarely used.
</Note>

View file

@ -1,16 +0,0 @@
---
title: postRender
---
The `postRender` hook is triggered after the SVG is rendered.
Like the `preRender` hook, it receives [the SVG object](/api/svg) as its first parameter.
<Note>
The `postRender` hooks is rarely used.
</Note>

View file

@ -1,16 +0,0 @@
---
title: postRender
---
The `postRender` hook is triggered after the SVG is rendered.
Like the `preRender` hook, it receives [the SVG object](/api/svg) as its first parameter.
<Note>
The `postRender` hooks is rarely used.
</Note>

View file

@ -1,20 +0,0 @@
---
title: postSample
---
The `postSample` hook runs just after your pattern is sampled. Your plugin will receive the Pattern object.
It is triggered just before the end of either:
- the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method
- the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method
- the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method
<Note>
The `postSample` hook is rarely used.
</Note>

View file

@ -1,20 +0,0 @@
---
title: postSample
---
The `postSample` hook runs just after your pattern is sampled. Your plugin will receive the Pattern object.
It is triggered just before the end of either:
- the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method
- the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method
- the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method
<Note>
The `postSample` hook is rarely used.
</Note>

View file

@ -1,20 +0,0 @@
---
title: postSample
---
The `postSample` hook runs just after your pattern is sampled. Your plugin will receive the Pattern object.
It is triggered just before the end of either:
- the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method
- the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method
- the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method
<Note>
The `postSample` hook is rarely used.
</Note>

View file

@ -1,20 +0,0 @@
---
title: postSample
---
The `postSample` hook runs just after your pattern is sampled. Your plugin will receive the Pattern object.
It is triggered just before the end of either:
- the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method
- the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method
- the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method
<Note>
The `postSample` hook is rarely used.
</Note>

View file

@ -1,14 +0,0 @@
---
title: preDraft
---
The `preDraft` hook runs just before your pattern is drafted.
Your plugin will receive the Pattern object.
<Note>
The `preDraft` hook is rarely used.
</Note>

View file

@ -1,14 +0,0 @@
---
title: preDraft
---
The `preDraft` hook runs just before your pattern is drafted.
Your plugin will receive the Pattern object.
<Note>
The `preDraft` hook is rarely used.
</Note>

Some files were not shown because too many files have changed in this diff Show more