From 6826a9aeac2d71484e866ed58b0574d8178baa2f Mon Sep 17 00:00:00 2001 From: Bruno Heridet Date: Wed, 13 May 2020 19:23:33 +0200 Subject: [PATCH] doc: add more from command pages (#1778) * doc: add from-url command page * doc: add missing link to existing from-xml page. * doc: add from-ini command page --- docs/commands/from-ini.md | 26 ++++++++++++++++++++++++++ docs/commands/from-toml.md | 2 +- docs/commands/from-url.md | 14 ++++++++++++++ docs/commands/from.md | 6 +++--- docs/commands/to-url.md | 2 +- 5 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 docs/commands/from-ini.md create mode 100644 docs/commands/from-url.md diff --git a/docs/commands/from-ini.md b/docs/commands/from-ini.md new file mode 100644 index 0000000000..7207f07ace --- /dev/null +++ b/docs/commands/from-ini.md @@ -0,0 +1,26 @@ +# from ini + +Converts ini data into table. Use this when nushell cannot determine the input file extension. + +## Example + +Let's say we have the following `.txt` file : +```shell +> open sample.txt +[SectionOne] + +key = value +integer = 1234 +string1 = 'Case 1' +``` + +This file is actually a ini file, but the file extension isn't `.ini`. That's okay, we can use the `from ini` command : + +```shell +> open sample.txt | from ini | get SectionOne +━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━ + key │ integer │ string1 +───────┼─────────┼────────── + value │ 1234 │ 'Case 1' +━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━ +``` diff --git a/docs/commands/from-toml.md b/docs/commands/from-toml.md index 10520b5c48..5e55bc7e3f 100644 --- a/docs/commands/from-toml.md +++ b/docs/commands/from-toml.md @@ -1,5 +1,5 @@ # from toml -Converts toml data into table. Use this when nushell cannot dertermine the input file extension. +Converts toml data into table. Use this when nushell cannot determine the input file extension. ## Example Let's say we have the following Rust .lock file : diff --git a/docs/commands/from-url.md b/docs/commands/from-url.md new file mode 100644 index 0000000000..ea3e2e81b7 --- /dev/null +++ b/docs/commands/from-url.md @@ -0,0 +1,14 @@ +# from url + +Parse [url-encoded string](https://url.spec.whatwg.org/#application/x-www-form-urlencoded) as a table. + +## Example + +```shell +> echo 'bread=baguette&cheese=comt%C3%A9&meat=ham&fat=butter' | from url +━━━━━━━━━━┯━━━━━━━━┯━━━━━━┯━━━━━━━━ + bread │ cheese │ meat │ fat +──────────┼────────┼──────┼──────── + baguette │ comté │ ham │ butter +━━━━━━━━━━┷━━━━━━━━┷━━━━━━┷━━━━━━━━ +``` diff --git a/docs/commands/from.md b/docs/commands/from.md index 60c6247337..ccaa9e92d4 100644 --- a/docs/commands/from.md +++ b/docs/commands/from.md @@ -10,17 +10,17 @@ Use this when nushell cannot determine the input file extension. * [from csv](from-csv.md) * from eml * [from ics](from-ics.md) -* from ini +* [from ini](from-ini.md) * [from json](from-json.md) * [from ods](from-ods.md) * from sqlite * from ssv * [from toml](from-toml.md) * [from tsv](from-tsv.md) -* from url +* [from url](from-url.md) * [from vcf](from-vcf.md) * [from xlsx](from-xlsx.md) -* from xml +* [from xml](from-xml.md) * [from yaml](from-yaml.md) *Subcommands without links are currently missing their documentation.* diff --git a/docs/commands/to-url.md b/docs/commands/to-url.md index 63b009f36a..ca5c916d76 100644 --- a/docs/commands/to-url.md +++ b/docs/commands/to-url.md @@ -1,6 +1,6 @@ # to url -Converts table data into url-formatted text. +Converts table data into [url-encoded text](https://url.spec.whatwg.org/#application/x-www-form-urlencoded). ## Example