1
0
Fork 0

chore(markdown): Update option docs

This commit is contained in:
Joost De Cock 2022-02-05 17:44:23 +01:00
parent d0e05fe455
commit 52ddbaaa02
28 changed files with 952 additions and 631 deletions

View file

@ -2,19 +2,29 @@
title: inject
---
The `inject` key in the pattern configuration file allow you to configure
the rules for injecting one part into another.
By *injecting* we mean that rather than starting out with a fresh part,
you'll get a part that has the points, paths, and snippets of the injected part.
## Structure
A plain object of key/value pairs of parts.
The `value` part will be injected in the `key` part.
## Example
```js
inject: {
front: "back"
}
```
An object of key/value pairs of parts. The `value` part will be injected in the `key` part.
By *injected* we mean rather than starting out with a fresh part, you'll get a part that
has the points, paths, and snippets of the `value` part.
In this example, the `back` part will be injected in the `front` part.
In doing so, the `front` part will start out as a copy of the `back` part.
<Tip>
See [the Howto on Part inheritance](/howtos/code/inject) for an example.
See [the Howto on Part inheritance](/howtos/code/inject) for a hands-on example.
</Tip>