Skip to content

Commit 6ff4a88

Browse files
committed
Replace Pipelines "Behind the Scenes" with "Result Display Rendering"
The previous "Behind the Scenes" docs has some problems: * The title is not descriptive * Confusing context reference: The "You may have wondered" references `ls` output despite no applicable example in front of it - and is not stable against other docs section changes either way * Confusing false equivalence: Claims "one and the same" and then explains how they are not in fact the same The section is being replaced with a "Result Display Rendering", which * Mentions and explains the existence of a display output hook * Begins with establishing context: The section is about interactive shell pipeline result display output --- I kept the section small as not to duplicate content from the Hooks documentation page. Adding examples for current, different, or simplified displaying may be reasonable here, but would duplicate the hooks "Changing how Output is Displayed" and "Filtering or Diverting Command Output" sections.
1 parent fb3c7a2 commit 6ff4a88

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

book/pipelines.md

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -353,34 +353,10 @@ In this case, sleep takes `nothing` and instead expects an argument.
353353
So, we can supply the output of the `echo` command as an argument to it:
354354
`echo 1sec | sleep $in` or `sleep (echo 1sec)`
355355

356-
## Behind the Scenes
356+
## Result Display Rendering
357357

358-
You may have wondered how we see a table if [`ls`](/commands/docs/ls.md) is an input and not an output. Nu adds this output for us automatically using another command called [`table`](/commands/docs/table.md). The [`table`](/commands/docs/table.md) command is appended to any pipeline that doesn't have an output. This allows us to see the result.
359-
360-
In effect, the command:
361-
362-
```nu
363-
> ls
364-
```
365-
366-
And the pipeline:
367-
368-
```nu
369-
> ls | table
370-
```
371-
372-
Are one and the same.
373-
374-
::: tip Note
375-
The phrase _"are one and the same"_ above only applies to the graphical output in the shell, it does not mean the two data structures are the same:
376-
377-
```nushell
378-
(ls) == (ls | table)
379-
# => false
380-
```
381-
382-
`ls | table` is not even structured data!
383-
:::
358+
In interactive mode, when a pipeline ends, the [`display_output` hook configuration](hooks.md#changing-how-output-is-displayed) defines how the result will be displayed.
359+
The default configuration uses the [`table` command](/commands/docs/table.md) to render structured data as a visual table.
384360

385361
## Output Result to External Commands
386362

0 commit comments

Comments
 (0)