You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiple match filters can be added, results must match all of them.
148
148
149
-
##### `import-tree.map`
149
+
##### 🌴 `import-tree.map`
150
150
151
151
`map` can be used to transform each path by providing a function.
152
152
@@ -166,7 +166,7 @@ lib.pipe import-tree [
166
166
# => list of contents of all files.
167
167
```
168
168
169
-
##### `import-tree.addPath`
169
+
##### 🌵 `import-tree.addPath`
170
170
171
171
`addPath` can be used to prepend paths to be filtered as a setup for import-tree.
172
172
@@ -175,7 +175,7 @@ lib.pipe import-tree [
175
175
import-tree [./vendor ./modules]
176
176
```
177
177
178
-
##### `import-tree.addAPI`
178
+
##### 🎄 `import-tree.addAPI`
179
179
180
180
`addAPI` extends the current import-tree object with new methods.
181
181
@@ -187,35 +187,35 @@ import-tree.addAPI {
187
187
}
188
188
```
189
189
190
-
##### `import-tree.withLib`
190
+
##### 🌿 `import-tree.withLib`
191
191
192
192
`withLib` is required prior to invocation of any of `.leafs` or `.pipeTo` when not used as part of a nix modules evaluation.
193
193
194
194
```nix
195
195
import-tree.withLib pkgs.lib
196
196
```
197
197
198
-
##### `import-tree.pipeTo`
198
+
##### 🌱 `import-tree.pipeTo`
199
199
200
200
`pipeTo` takes a function that will receive the list of paths.
201
201
202
202
```nix
203
203
import-tree.pipeTo lib.id # equivalent to `.leafs`
204
204
```
205
205
206
-
##### `import-tree.leafs`
206
+
##### 🍃 `import-tree.leafs`
207
207
208
208
`leafs` takes no arguments, it is equivalent to calling `import-tree.pipeTo lib.id`.
209
209
210
210
```nix
211
211
import-tree.leafs
212
212
```
213
213
214
-
##### `import-tree.new`
214
+
##### 🌲 `import-tree.new`
215
215
216
216
Returns a fresh import-tree with empty state.
217
217
218
-
##### `import-tree.initFilter`
218
+
##### 🌳 `import-tree.initFilter`
219
219
220
220
*Replaces* the initial filter which defaults to: Include files with `.nix` suffix and not having `/_` infix.
221
221
@@ -224,7 +224,7 @@ import-tree.initFilter (p: lib.hasSuffix ".nix" p && !lib.hasInfix "/ignored/" p
224
224
import-tree.initFilter (lib.hasSuffix ".md")
225
225
```
226
226
227
-
##### `import-tree.files`
227
+
##### 🌴 `import-tree.files`
228
228
229
229
A shorthand for `import-tree.leafs.result`. Returns a list of matching files.
230
230
@@ -237,7 +237,7 @@ lib.pipe import-tree [
237
237
]
238
238
```
239
239
240
-
##### `import-tree.result`
240
+
##### 🌵 `import-tree.result`
241
241
242
242
Exactly the same as calling the import-tree object with an empty list `[ ]`.
243
243
@@ -262,18 +262,13 @@ to learn about the Dendritic pattern advantages.
262
262
263
263
### Sharing pre-configured subtrees of modules
264
264
265
-
<details>
266
-
<summary>
267
-
268
265
Since the import-tree API is _extensible_ and lets you add paths or
269
266
filters at configuration time, configuration-library authors can
270
267
provide custom import-tree instances with an API suited for their
271
268
particular idioms.
272
269
273
270
@vic is using this on [Dendrix](https://github.com/vic/dendrix) for [community conventions](https://github.com/vic/dendrix/blob/main/dev/modules/community/_pipeline.nix) on tagging files.
274
271
275
-
</summary>
276
-
277
272
This would allow us to have community-driven *sets* of configurations,
278
273
much like those popular for editors: spacemacs/lazy-vim distributions.
0 commit comments