From c7698242963f0156874ac6002155891dd69da21a Mon Sep 17 00:00:00 2001 From: Jan Klass Date: Fri, 1 Nov 2024 19:31:49 +0100 Subject: [PATCH] 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. --- book/modules/using_modules.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/book/modules/using_modules.md b/book/modules/using_modules.md index 849e001e7ca..ba458d2888a 100644 --- a/book/modules/using_modules.md +++ b/book/modules/using_modules.md @@ -75,19 +75,33 @@ The path to the module can be: This allows you to install modules to a location that is easily accessible via a relative path regardless of the current directory. ::: -- 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. +- An absolute path to a Nushell module file: ::: details Example ```nu use ~/nushell/modules/std-rfc/bulk-rename.nu - # Or + ``` + + ::: + +- A relative path to a Nushell module file: + + ::: details Example + + ```nu cd ~/nushell/modules use std-rfc/bulk-rename.nu ``` ::: + ::: important Important! Importing modules from `$env.NU_LIB_DIRS` + 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. + + This allows you to install modules to a location that is easily accessible via a relative path regardless of the current directory. + ::: + - A virtual directory: ::: details Example