Skip to content

Commit 198fcff

Browse files
authored
Lang and snippets updates (#1699)
Fix comment and code-block styles on: * lang-guide * snippets
1 parent 18cf302 commit 198fcff

38 files changed

+243
-242
lines changed

lang-guide/chapters/strings_and_text.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ Sometimes you need to nest quotes. I think this could use some work because some
118118
The key to always remember is that double quotes recognize and interpret escapes so if you have any `\` characters in your string, they will be interpreted as escapes. The following is an example of a question we get frequently on Discord.
119119

120120
```nu
121-
Why doesn't this work?
122-
> cd "C:\Program Files\somedir"
121+
# Why doesn't this work?
122+
cd "C:\Program Files\somedir"
123123
```
124124

125125
It doesn't work because it sees `\P` and `\s` as escapes that are not recognized.

lang-guide/chapters/types/basic_types/table.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
Table literals can be created using a syntax similar to that of a list literal. Because tables also contain columns and not just values, we also specify the column names:
1818

1919
```nu
20-
> [[column1, column2]; [Value1, Value2] [Value3, Value4]]
21-
╭───┬─────────┬─────────╮
22-
│ # │ column1 │ column2 │
23-
├───┼─────────┼─────────┤
24-
│ 0 │ Value1 │ Value2 │
25-
│ 1 │ Value3 │ Value4 │
26-
╰───┴─────────┴─────────╯
20+
[[column1, column2]; [Value1, Value2] [Value3, Value4]]
21+
# => ╭───┬─────────┬─────────╮
22+
# => │ # │ column1 │ column2 │
23+
# => ├───┼─────────┼─────────┤
24+
# => │ 0 │ Value1 │ Value2 │
25+
# => │ 1 │ Value3 │ Value4 │
26+
# => ╰───┴─────────┴─────────╯
2727
```
2828

2929
In this syntax, the headers are separated from the data cells using a semicolon(`;`). The semicolon separator is mandatory in a table-literal. It must follow the headers.
@@ -33,13 +33,13 @@ In this syntax, the headers are separated from the data cells using a semicolon(
3333
You can also create a table as a list of records, JSON-style:
3434

3535
```nu
36-
> [{name: "Sam", rank: 10}, {name: "Bob", rank: 7}]
37-
╭───┬──────┬──────╮
38-
│ # │ name │ rank │
39-
├───┼──────┼──────┤
40-
│ 0 │ Sam │ 10 │
41-
│ 1 │ Bob │ 7 │
42-
╰───┴──────┴──────╯
36+
[{name: "Sam", rank: 10}, {name: "Bob", rank: 7}]
37+
# => ╭───┬──────┬──────╮
38+
# => │ # │ name │ rank │
39+
# => ├───┼──────┼──────┤
40+
# => │ 0 │ Sam │ 10 │
41+
# => │ 1 │ Bob │ 7 │
42+
# => ╰───┴──────┴──────╯
4343
```
4444

4545
This list-of-records pattern plays on the Nushell data model, which sees a list of records as equivalent to a table. This is useful in cases where the length of a table may not be known ahead of time. In such a case, a stream of records likewise represents a table.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
> cd new_directory
1+
cd new_directory
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
> ./new_directory
1+
./new_directory
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Change to the parent directory
2-
> cd ..
2+
cd ..
33
# or
4-
> ..
4+
..
55
# Go up two levels (parent's parent)
6-
> cd ...
6+
cd ...
77
# or
8-
> ...
8+
...
99
# Go up three levels (parent of parent's parent)
10-
> cd ....
11-
# Etc.
10+
cd ....
11+
# Etc.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
> cd ../sibling
1+
cd ../sibling
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
> cd nushell
2-
nushell> cargo build --workspace; cargo run
1+
cd nushell
2+
# ./nushell
3+
cargo build --workspace; cargo run
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nushell> cargo build --release --workspace; cargo run --release
1+
cargo build --release --workspace; cargo run --release
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
> git clone https://github.com/nushell/nushell.git
2-
> cd nushell
3-
nushell> cargo install --path . --locked
1+
git clone https://github.com/nushell/nushell.git
2+
cd nushell
3+
# ./nushell
4+
cargo install --path . --locked
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
> cargo install nu --locked
1+
cargo install nu --locked

0 commit comments

Comments
 (0)