chore: Port FreeSewing.dev to docusaurus
The replaces the NextJS site powering FreeSewing.dev with a Docusaurus setup. It's part of my efforts to simplify FreeSewing's setup so we can focus on our core value proposition.
This commit is contained in:
parent
497633d1d3
commit
ab3204f9f1
692 changed files with 11037 additions and 20674 deletions
35
sites/dev/docs/reference/hooks/presetdraft/readme.mdx
Normal file
35
sites/dev/docs/reference/hooks/presetdraft/readme.mdx
Normal file
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
title: preSetDraft
|
||||
---
|
||||
|
||||
The `preSetDraft` lifecycle hook runs just before a set (of settings) is
|
||||
drafted. It will fire once for each set when calling `Pattern.draft()`.
|
||||
|
||||
## Signature
|
||||
|
||||
```js
|
||||
null hook(Pattern pattern)
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
pattern.on('preSetDraft', pattern => {
|
||||
// Mutate the pattern object here
|
||||
}
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
The `preSetDraft` fires once for each set in the pattern.
|
||||
|
||||
The pattern tracks the active set on the `activeSet` property.
|
||||
So if you are using this hook and would like to get access to teh active set, you can do so like this:
|
||||
|
||||
```js
|
||||
pattern.on('preSetDraft', ({ settings, activeSet }) => {
|
||||
const set = settings[Number(activeSet)]
|
||||
|
||||
// Now set holds the active set of settings
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue