nushell/docs/commands/to.md
Joseph T. Lyons bf2363947b
Add pretty flag to to md (#2640)
* First draft for adding a `pretty` flag to `to md`

* rustfmt

* Fix Clippy warnings

* rustfmt

* Using Clippy suggestion broken code, reverting and putting in a statement to ignore clippy warning

* Add test for `to md -p`
2020-10-15 16:20:55 +13:00

54 lines
1.7 KiB
Markdown

# to
Converts table data into a string or binary. The target format is specified as a subcommand, like `to csv` or `to json`.
## Available Subcommands
* to bson
* [to csv](to-csv.md)
* to html
* [to json](to-json.md)
* [to md](to-md.md)
* to sqlite
* [to toml](to-toml.md)
* [to tsv](to-tsv.md)
* [to url](to-url.md)
* [to xml](to-xml.md)
* [to yaml](to-yaml.md)
*Subcommands without links are currently missing their documentation.*
## Example
```shell
> shells
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━
# │ │ name │ path
───┼───┼────────────┼────────────────────────
0 │ X │ filesystem │ /home/shaurya
1 │ │ filesystem │ /home/shaurya/Pictures
2 │ │ filesystem │ /home/shaurya/Desktop
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━
```
```shell
> shells | to csv
,name,path
X,filesystem,/home/shaurya
,filesystem,/home/shaurya/Pictures
,filesystem,/home/shaurya/Desktop
```
```shell
> open sample.url
━━━━━━━━━━┯━━━━━━━━┯━━━━━━┯━━━━━━━━
bread │ cheese │ meat │ fat
──────────┼────────┼──────┼────────
baguette │ comté │ ham │ butter
━━━━━━━━━━┷━━━━━━━━┷━━━━━━┷━━━━━━━━
```
```shell
> open sample.url | to url
bread=baguette&cheese=comt%C3%A9&meat=ham&fat=butter
```