1
0
Fork 0
freesewing/markdown/dev/reference/api/config/dependencies/en.md

44 lines
1.2 KiB
Markdown
Raw Normal View History

---
title: dependencies
---
2022-02-05 17:44:23 +01:00
The `dependencies` key in the pattern configuration file allow you to configure
dependencies between different parts of your pattern.
2022-02-19 08:04:25 +01:00
For example, you may only be able to draft the sleeve after having drafted the
2022-02-05 17:44:23 +01:00
part that contains the armhole the sleeve should fit in.
Dependencies control the order in which parts get drafted, but are also used
2022-02-19 08:04:25 +01:00
when users requests to [only draft some parts of a
2022-02-05 17:44:23 +01:00
pattern](/reference/api/settings/only).
Behind the scenes, FreeSewing will draft all dependencies, and make sure to not
render them if they were not requested.
## Structure
2022-02-19 08:04:25 +01:00
A plain object of `key`-`value` pairs that controls the order in which pattern
2022-02-05 17:44:23 +01:00
parts will get drafted.
The value can either be a string, or an array of strings.
Those strings should be part names.
You read the configuration as: `key` depends on `value`.
## Example
```js
dependencies: {
front: "back",
sleeveplacket: ["sleeve", "cuff"]
}
```
2022-02-05 17:44:23 +01:00
In this example:
2022-02-19 08:04:25 +01:00
- The `front` part depends on the `back` part
- The `sleeveplacket` part depends on the `sleeve` and `cuff` parts.
<Tip>
See [Part dependencies](/advanced/dependencies) for more in-depth information on dependencies.
</Tip>