Skip to content

Commit 1abe662

Browse files
committed
Split absolute and relative path examples
The concern before this one already has split sections. Rather than a block with two mixed concerns, and a need for "or" text in a mixed-concern example attempting to demonstrate two things at once, having two blocks makes it much more obvious, distinct, and reference-able (when the reader is only interested in one aspect). It also simplifies the NU_LIB_DIRS concern a lot. Instead of a long block headline with a lot of mixed information, we do the same as the other concern earlier in the document: note the information in an important note block.
1 parent 41f99b4 commit 1abe662

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

book/modules/using_modules.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,33 @@ The path to the module can be:
7575
This allows you to install modules to a location that is easily accessible via a relative path regardless of the current directory.
7676
:::
7777

78-
- An absolute or relative path to a Nushell module file. As above, Nushell will search the `$env.NU_LIB_DIRS` for a matching relative path.
78+
- An absolute path to a Nushell module file:
7979

8080
::: details Example
8181

8282
```nu
8383
use ~/nushell/modules/std-rfc/bulk-rename.nu
84-
# Or
84+
```
85+
86+
:::
87+
88+
- A relative path to a Nushell module file:
89+
90+
::: details Example
91+
92+
```nu
8593
cd ~/nushell/modules
8694
use std-rfc/bulk-rename.nu
8795
```
8896

8997
:::
9098

99+
::: important Important! Importing modules from `$env.NU_LIB_DIRS`
100+
When importing a module via a relative path, Nushell first searches from the current directory. If a matching module is not found at that location, Nushell then searches each directory in the `$env.NU_LIB_DIRS` list.
101+
102+
This allows you to install modules to a location that is easily accessible via a relative path regardless of the current directory.
103+
:::
104+
91105
- A virtual directory:
92106

93107
::: details Example

0 commit comments

Comments
 (0)