Skip to content

Commit

Permalink
remove all | table from the book (nushell#976)
Browse files Browse the repository at this point in the history
* remove all `| table` from the book

Command used:
```nushell
sd ' ?\| table$' '' **/*
git restore commands/
```

* put back the `| table` which explains the table outputs

* add a Note about `ls` and `ls | table` being *the same*
  • Loading branch information
amtoine committed Jul 18, 2023
1 parent 0660d90 commit 82ceb7b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion book/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Values that flow through a pipeline in Nu often have a set of additional informa
Let's run the [`open`](/commands/docs/open.md) command again, but this time, we'll look at the tags it gives back:

```
> metadata (open Cargo.toml) | table
> metadata (open Cargo.toml)
╭──────┬───────────────────╮
│ span │ {record 2 fields} │
╰──────┴───────────────────╯
Expand Down
9 changes: 9 additions & 0 deletions book/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ And the pipeline:

Are one and the same.

> **Note**
> the sentence *are one and the same* above only applies for the graphical output in the shell,
> it does not mean the two data structures are them same
> ```nushell
> > (ls) == (ls | table)
> false
> ```
> `ls | table` is not even structured data!
## Output result to external commands

Sometimes you want to output Nushell structured data to an external command for further processing. However, Nushell's default formatting options for structured data may not be what you want.
Expand Down
2 changes: 1 addition & 1 deletion de/book/pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Dies erlaubt es den Output in dieser Form zu sehen. Tatsächlich ist der Befehl:
und die Pipeline,

```
> ls | table
> ls
```

ein und dasselbe.
2 changes: 1 addition & 1 deletion snippets/introduction/sys_example.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> sys | table
> sys
╭───────┬───────────────────╮
│ host │ {record 6 fields} │
│ cpu │ [table 4 rows] │
Expand Down
2 changes: 1 addition & 1 deletion snippets/loading_data/cargo-toml.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> open Cargo.lock | from toml | table
> open Cargo.lock | from toml
──────────┬───────────────────
metadata │ [row 107 columns]
package │ [table 130 rows]
Expand Down
2 changes: 1 addition & 1 deletion snippets/loading_data/rust-lang-feed.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> http get https://blog.rust-lang.org/feed.xml | table
> http get https://blog.rust-lang.org/feed.xml
╭────────────┬──────────────────╮
│ tag │ feed │
│ attributes │ {record 1 field} │
Expand Down
2 changes: 1 addition & 1 deletion snippets/loading_data/vscode.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> open editors/vscode/package.json | table
> open editors/vscode/package.json
──────────────────┬───────────────────────────────────────────────────────────────────────────────
name │ lark
description │ Lark support for VS Code
Expand Down
2 changes: 1 addition & 1 deletion snippets/types_of_data/cell-paths.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> [{langs:[Rust JS Python], releases:60}].0 | table
> [{langs:[Rust JS Python], releases:60}].0
╭──────────┬────────────────╮
│ langs │ [list 3 items] │
│ releases │ 60 │
Expand Down
2 changes: 1 addition & 1 deletion zh-CN/book/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ error: Expected a string from pipeline
让我们再次运行[`open`](/commands/docs/open.md)命令,但这一次,我们将看一下它所反馈的标签:

```
> metadata (open Cargo.toml) | table
> metadata (open Cargo.toml)
╭──────┬───────────────────╮
│ span │ {record 2 fields} │
╰──────┴───────────────────╯
Expand Down
2 changes: 1 addition & 1 deletion zh-CN/book/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Nu 在两个外部命令之间以与其他 Shell 相同的方式处理数据管
和以下管道:

```
> ls | table
> ls
```

是一样的。

0 comments on commit 82ceb7b

Please sign in to comment.