From c77059f891a8dbcb4a3d69402570d5f7dc14210c Mon Sep 17 00:00:00 2001 From: Sebastian Jung Date: Thu, 28 Nov 2019 19:33:17 +0100 Subject: [PATCH] add documentation for from-json, from-yaml, history, split-row --- docs/commands/from-json.md | 33 +++++++++++++++++++++++++++++++++ docs/commands/from-yaml.md | 24 ++++++++++++++++++++++++ docs/commands/history.md | 17 +++++++++++++++++ docs/commands/split-row.md | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 docs/commands/from-json.md create mode 100644 docs/commands/from-yaml.md create mode 100644 docs/commands/history.md create mode 100644 docs/commands/split-row.md diff --git a/docs/commands/from-json.md b/docs/commands/from-json.md new file mode 100644 index 000000000..bb07d880f --- /dev/null +++ b/docs/commands/from-json.md @@ -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 +━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━ +``` \ No newline at end of file diff --git a/docs/commands/from-yaml.md b/docs/commands/from-yaml.md new file mode 100644 index 000000000..1c81c7dc9 --- /dev/null +++ b/docs/commands/from-yaml.md @@ -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 +━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━ + +``` diff --git a/docs/commands/history.md b/docs/commands/history.md new file mode 100644 index 000000000..095cfeff3 --- /dev/null +++ b/docs/commands/history.md @@ -0,0 +1,17 @@ +# history + +Displays the last 100 commands. + +## Example + +```shell +> history +━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + # │ +────┼─────────────────────────────────────────────────────────────────────────── + ... + 97 │ ls + 98 │ ls | where accessed < 1d + 99 │ cd +━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` \ No newline at end of file diff --git a/docs/commands/split-row.md b/docs/commands/split-row.md new file mode 100644 index 000000000..50744fcc6 --- /dev/null +++ b/docs/commands/split-row.md @@ -0,0 +1,34 @@ +# split-row + +Split row contents over multiple rows via the separator. + +Syntax: `split-row ` + +### Parameters: +* `` 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 ", " +━━━┯━━━━━━━━━ + # │ +───┼───────── + 0 │ 4 + 1 │ 0 + 2 │ 2 + 3 │ 0 + 4 │ 7 + 5 │ 8 +━━━┷━━━━━━━━━ +``` \ No newline at end of file