add documentation for from-json, from-yaml, history, split-row

This commit is contained in:
Sebastian Jung 2019-11-28 19:33:17 +01:00
parent 5bdda06ca6
commit c77059f891
4 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,33 @@
# from-json
Parse text as `.json` and create table. Use this when nushell cannot dertermine the input file extension.
Syntax: `from-json {flags}`
### Flags:
--objects
treat each line as a separate value
## Examples
```shell
> open command_from-json
[
{
title: "from-json",
type: "command",
flags: true
}
]
```
```shell
> open command_from-json | from-json
━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━
title │ type │ flags
───────────┼─────────┼───────
from-json │ command │ Yes
━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━
```

View File

@ -0,0 +1,24 @@
# from-yaml
Parse text as `.yaml/.yml` and create table.
Syntax: `from-yaml`
## Examples
```shell
> open command_from-yaml
title: from-yaml
type: command
flags: false
```
```shell
> open command_from-yaml | from-yaml
━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━
title │ type │ flags
───────────┼─────────┼───────
from-yaml │ command │ No
━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━
```

17
docs/commands/history.md Normal file
View File

@ -0,0 +1,17 @@
# history
Displays the last 100 commands.
## Example
```shell
> history
━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# │ <value>
────┼───────────────────────────────────────────────────────────────────────────
...
97 │ ls
98 │ ls | where accessed < 1d
99 │ cd
━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

View File

@ -0,0 +1,34 @@
# split-row
Split row contents over multiple rows via the separator.
Syntax: `split-row <separator>`
### Parameters:
* `<separator>` the character that denotes what separates rows
## Examples
We can build a table from a file that looks like this
```shell
> open table.txt
4, 0, 2, 0, 7, 8
```
using the `split-row` command.
```shell
open table.txt | split-row ", "
━━━┯━━━━━━━━━
# │ <value>
───┼─────────
0 │ 4
1 │ 0
2 │ 2
3 │ 0
4 │ 7
5 │ 8
━━━┷━━━━━━━━━
```