Merge pull request #6021 from BenJamesBen/pattern-draftpartforset-doc
fix(markdown): Add Pattern.draftPartForSet() documentation
This commit is contained in:
commit
1c05607f97
1 changed files with 29 additions and 1 deletions
|
@ -2,4 +2,32 @@
|
|||
title: Pattern.draftPartForSet()
|
||||
---
|
||||
|
||||
FIXME: write docs
|
||||
A pattern's `draftPartForSet()` method will draft a part using a
|
||||
given set of settings.
|
||||
|
||||
<Note>This method is chainable as it returns the Pattern object</Note>
|
||||
|
||||
## Pattern.draftPartForSet() signature
|
||||
|
||||
```js
|
||||
Pattern pattern.draftPartForSet(part, set)
|
||||
```
|
||||
|
||||
## Pattern.draftPartForSet() example
|
||||
|
||||
```js
|
||||
import { Aaron } from "@freesewing/aaron"
|
||||
|
||||
// Load a public test settings set from the FreeSewing backend
|
||||
const set = (
|
||||
await (
|
||||
await fetch("https://backend3.freesewing.org/curated-sets/1.json")
|
||||
).json()
|
||||
)
|
||||
|
||||
const pattern = new Aaron()
|
||||
|
||||
for (const part in pattern.parts) {
|
||||
const svg = pattern.draftPartForSet(part, set).render()
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue