From c0a1d18e3d35648b70aa2922a4b29a2d85ab56d2 Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Tue, 22 Feb 2022 01:26:00 +0800 Subject: [PATCH] update #4455, regenerate commands' docs and update make_docs script (#4586) * feat: update #4455, regenerate commands' docs * chore: update make_docs script --- docs/commands/alias.md | 1 - docs/commands/all.md | 1 - docs/commands/ansi.md | 1 - docs/commands/ansi_gradient.md | 1 - docs/commands/ansi_strip.md | 1 - docs/commands/any.md | 1 - docs/commands/append.md | 1 - docs/commands/benchmark.md | 1 - docs/commands/build-string.md | 1 - docs/commands/cal.md | 1 - docs/commands/cd.md | 1 - docs/commands/char.md | 1 - docs/commands/clear.md | 1 - docs/commands/collect.md | 1 - docs/commands/columns.md | 1 - docs/commands/compact.md | 1 - docs/commands/cp.md | 1 - docs/commands/dataframe.md | 1 - docs/commands/date.md | 1 - docs/commands/date_format.md | 1 - docs/commands/date_humanize.md | 1 - docs/commands/date_list-timezone.md | 1 - docs/commands/date_now.md | 1 - docs/commands/date_to-table.md | 1 - docs/commands/date_to-timezone.md | 1 - docs/commands/debug.md | 1 - docs/commands/decode.md | 1 - docs/commands/def-env.md | 6 ++++++ docs/commands/def.md | 1 - docs/commands/default.md | 1 - docs/commands/describe.md | 1 - docs/commands/detect_columns.md | 1 - docs/commands/dfr.md | 1 - docs/commands/dfr_aggregate.md | 3 +-- docs/commands/dfr_all-false.md | 1 - docs/commands/dfr_all-true.md | 1 - docs/commands/dfr_append.md | 1 - docs/commands/dfr_arg-max.md | 1 - docs/commands/dfr_arg-min.md | 1 - docs/commands/dfr_arg-sort.md | 1 - docs/commands/dfr_arg-true.md | 1 - docs/commands/dfr_arg-unique.md | 1 - docs/commands/dfr_column.md | 1 - docs/commands/dfr_concatenate.md | 1 - docs/commands/dfr_contains.md | 1 - docs/commands/dfr_count-null.md | 1 - docs/commands/dfr_count-unique.md | 1 - docs/commands/dfr_cumulative.md | 1 - docs/commands/dfr_describe.md | 1 - docs/commands/dfr_drop-duplicates.md | 1 - docs/commands/dfr_drop-nulls.md | 1 - docs/commands/dfr_drop.md | 1 - docs/commands/dfr_dtypes.md | 1 - docs/commands/dfr_filter-with.md | 1 - docs/commands/dfr_first.md | 1 - docs/commands/dfr_get-day.md | 1 - docs/commands/dfr_get-hour.md | 1 - docs/commands/dfr_get-minute.md | 1 - docs/commands/dfr_get-month.md | 1 - docs/commands/dfr_get-nanosecond.md | 1 - docs/commands/dfr_get-ordinal.md | 1 - docs/commands/dfr_get-second.md | 1 - docs/commands/dfr_get-week.md | 1 - docs/commands/dfr_get-weekday.md | 1 - docs/commands/dfr_get-year.md | 1 - docs/commands/dfr_get.md | 1 - docs/commands/dfr_group-by.md | 1 - docs/commands/dfr_is-duplicated.md | 1 - docs/commands/dfr_is-in.md | 1 - docs/commands/dfr_is-not-null.md | 1 - docs/commands/dfr_is-null.md | 1 - docs/commands/dfr_is-unique.md | 1 - docs/commands/dfr_join.md | 1 - docs/commands/dfr_last.md | 1 - docs/commands/dfr_melt.md | 1 - docs/commands/dfr_not.md | 1 - docs/commands/dfr_open.md | 1 - docs/commands/dfr_pivot.md | 1 - docs/commands/dfr_rename-col.md | 1 - docs/commands/dfr_rename.md | 1 - docs/commands/dfr_replace-all.md | 1 - docs/commands/dfr_replace.md | 1 - docs/commands/dfr_rolling.md | 1 - docs/commands/dfr_sample.md | 1 - docs/commands/dfr_set-with-idx.md | 1 - docs/commands/dfr_set.md | 1 - docs/commands/dfr_shape.md | 1 - docs/commands/dfr_shift.md | 1 - docs/commands/dfr_slice.md | 1 - docs/commands/dfr_sort.md | 1 - docs/commands/dfr_str-lengths.md | 1 - docs/commands/dfr_str-slice.md | 1 - docs/commands/dfr_strftime.md | 1 - docs/commands/dfr_take.md | 1 - docs/commands/dfr_to-csv.md | 1 - docs/commands/dfr_to-df.md | 1 - docs/commands/dfr_to-dummies.md | 1 - docs/commands/dfr_to-lowercase.md | 1 - docs/commands/dfr_to-nu.md | 1 - docs/commands/dfr_to-parquet.md | 1 - docs/commands/dfr_to-uppercase.md | 1 - docs/commands/dfr_unique.md | 1 - docs/commands/dfr_value-counts.md | 1 - docs/commands/dfr_with-column.md | 1 - docs/commands/do.md | 1 - docs/commands/drop.md | 1 - docs/commands/drop_column.md | 1 - docs/commands/drop_nth.md | 1 - docs/commands/du.md | 1 - docs/commands/each.md | 1 - docs/commands/each_group.md | 1 - docs/commands/each_window.md | 1 - docs/commands/echo.md | 1 - docs/commands/empty.md | 1 - docs/commands/enter.md | 1 - docs/commands/env.md | 1 - docs/commands/error_make.md | 1 - docs/commands/every.md | 1 - docs/commands/exec.md | 1 - docs/commands/exit.md | 1 - docs/commands/export.md | 1 - docs/commands/export_def-env.md | 6 ++++++ docs/commands/export_def.md | 6 ++++++ docs/commands/export_env.md | 6 ++++++ docs/commands/extern.md | 1 - docs/commands/fetch.md | 3 +-- docs/commands/find.md | 1 - docs/commands/first.md | 1 - docs/commands/flatten.md | 3 +-- docs/commands/fmt.md | 1 - docs/commands/for.md | 1 - docs/commands/format.md | 1 - docs/commands/from.md | 1 - docs/commands/from_csv.md | 1 - docs/commands/from_eml.md | 1 - docs/commands/from_ics.md | 1 - docs/commands/from_ini.md | 1 - docs/commands/from_json.md | 5 ++--- docs/commands/from_nuon.md | 23 +++++++++++++++++++++++ docs/commands/from_ods.md | 1 - docs/commands/from_ssv.md | 1 - docs/commands/from_toml.md | 1 - docs/commands/from_tsv.md | 11 +++++++++++ docs/commands/from_url.md | 1 - docs/commands/from_vcf.md | 1 - docs/commands/from_xlsx.md | 1 - docs/commands/from_xml.md | 1 - docs/commands/from_yaml.md | 1 - docs/commands/from_yml.md | 11 +++++++++++ docs/commands/g.md | 1 - docs/commands/get.md | 1 - docs/commands/grid.md | 1 - docs/commands/group-by.md | 1 - docs/commands/hash.md | 1 - docs/commands/hash_base64.md | 1 - docs/commands/hash_md5.md | 1 - docs/commands/hash_sha256.md | 1 - docs/commands/headers.md | 1 - docs/commands/help.md | 1 - docs/commands/hide.md | 16 ++++++++++++++++ docs/commands/history.md | 16 ++++++++++++++++ docs/commands/if.md | 1 - docs/commands/ignore.md | 1 - docs/commands/input.md | 1 - docs/commands/insert.md | 1 - docs/commands/into.md | 1 - docs/commands/into_binary.md | 1 - docs/commands/into_bool.md | 1 - docs/commands/into_datetime.md | 1 - docs/commands/into_decimal.md | 1 - docs/commands/into_filesize.md | 1 - docs/commands/into_int.md | 1 - docs/commands/into_string.md | 1 - docs/commands/keep.md | 1 - docs/commands/keep_until.md | 1 - docs/commands/keep_while.md | 1 - docs/commands/keybindings.md | 1 - docs/commands/keybindings_default.md | 1 - docs/commands/keybindings_list.md | 1 - docs/commands/keybindings_listen.md | 1 - docs/commands/kill.md | 1 - docs/commands/last.md | 1 - docs/commands/length.md | 1 - docs/commands/let-env.md | 1 - docs/commands/let.md | 1 - docs/commands/lines.md | 1 - docs/commands/load-env.md | 1 - docs/commands/ls.md | 1 - docs/commands/math.md | 1 - docs/commands/math_abs.md | 1 - docs/commands/math_avg.md | 1 - docs/commands/math_ceil.md | 1 - docs/commands/math_eval.md | 1 - docs/commands/math_floor.md | 1 - docs/commands/math_max.md | 1 - docs/commands/math_median.md | 1 - docs/commands/math_min.md | 1 - docs/commands/math_mode.md | 1 - docs/commands/math_product.md | 1 - docs/commands/math_round.md | 1 - docs/commands/math_sqrt.md | 1 - docs/commands/math_stddev.md | 1 - docs/commands/math_sum.md | 1 - docs/commands/math_variance.md | 1 - docs/commands/merge.md | 1 - docs/commands/metadata.md | 1 - docs/commands/mkdir.md | 1 - docs/commands/module.md | 16 ++++++++++++++++ docs/commands/move.md | 1 - docs/commands/mv.md | 1 - docs/commands/n.md | 1 - docs/commands/nth.md | 1 - docs/commands/nu-highlight.md | 1 - docs/commands/open.md | 1 - docs/commands/p.md | 1 - docs/commands/par-each.md | 1 - docs/commands/par-each_group.md | 1 - docs/commands/parse.md | 1 - docs/commands/path.md | 1 - docs/commands/path_basename.md | 1 - docs/commands/path_dirname.md | 1 - docs/commands/path_exists.md | 1 - docs/commands/path_expand.md | 1 - docs/commands/path_join.md | 1 - docs/commands/path_parse.md | 1 - docs/commands/path_relative-to.md | 1 - docs/commands/path_split.md | 1 - docs/commands/path_type.md | 1 - docs/commands/pivot.md | 1 - docs/commands/post.md | 3 +-- docs/commands/prepend.md | 1 - docs/commands/print.md | 1 - docs/commands/ps.md | 1 - docs/commands/random.md | 1 - docs/commands/random_bool.md | 1 - docs/commands/random_chars.md | 1 - docs/commands/random_decimal.md | 1 - docs/commands/random_dice.md | 1 - docs/commands/random_integer.md | 1 - docs/commands/random_uuid.md | 1 - docs/commands/range.md | 1 - docs/commands/reduce.md | 1 - docs/commands/register.md | 11 +++++++++++ docs/commands/reject.md | 1 - docs/commands/rename.md | 1 - docs/commands/reverse.md | 1 - docs/commands/rm.md | 1 - docs/commands/roll.md | 1 - docs/commands/roll_down.md | 1 - docs/commands/roll_left.md | 1 - docs/commands/roll_right.md | 1 - docs/commands/roll_up.md | 1 - docs/commands/rotate.md | 1 - docs/commands/run-external.md | 1 - docs/commands/save.md | 13 ++++++++++++- docs/commands/select.md | 1 - docs/commands/seq.md | 1 - docs/commands/seq_date.md | 1 - docs/commands/shells.md | 1 - docs/commands/shuffle.md | 6 ++++++ docs/commands/size.md | 1 - docs/commands/skip.md | 1 - docs/commands/skip_until.md | 1 - docs/commands/skip_while.md | 1 - docs/commands/sleep.md | 1 - docs/commands/sort-by.md | 1 - docs/commands/source.md | 16 ++++++++++++++++ docs/commands/split-by.md | 5 ++--- docs/commands/split.md | 1 - docs/commands/split_chars.md | 1 - docs/commands/split_column.md | 1 - docs/commands/split_row.md | 1 - docs/commands/str.md | 1 - docs/commands/str_camel-case.md | 1 - docs/commands/str_capitalize.md | 1 - docs/commands/str_collect.md | 1 - docs/commands/str_contains.md | 1 - docs/commands/str_downcase.md | 1 - docs/commands/str_ends-with.md | 1 - docs/commands/str_find-replace.md | 1 - docs/commands/str_index-of.md | 1 - docs/commands/str_kebab-case.md | 1 - docs/commands/str_length.md | 1 - docs/commands/str_lpad.md | 1 - docs/commands/str_pascal-case.md | 1 - docs/commands/str_reverse.md | 1 - docs/commands/str_rpad.md | 1 - docs/commands/str_screaming-snake-case.md | 1 - docs/commands/str_snake-case.md | 1 - docs/commands/str_starts-with.md | 1 - docs/commands/str_substring.md | 1 - docs/commands/str_to-datetime.md | 1 - docs/commands/str_to-decimal.md | 1 - docs/commands/str_to-int.md | 1 - docs/commands/str_trim.md | 1 - docs/commands/str_upcase.md | 1 - docs/commands/sys.md | 1 - docs/commands/table.md | 11 +++++++++++ docs/commands/term_size.md | 1 - docs/commands/to.md | 1 - docs/commands/to_csv.md | 5 ++--- docs/commands/to_html.md | 1 - docs/commands/to_json.md | 16 +++++++++++++--- docs/commands/to_md.md | 1 - docs/commands/to_nuon.md | 18 ++++++++++++++++++ docs/commands/to_toml.md | 1 - docs/commands/to_tsv.md | 1 - docs/commands/to_url.md | 1 - docs/commands/to_xml.md | 1 - docs/commands/to_yaml.md | 1 - docs/commands/touch.md | 1 - docs/commands/transpose.md | 1 - docs/commands/tutor.md | 1 - docs/commands/unalias.md | 1 - docs/commands/uniq.md | 1 - docs/commands/update.md | 1 - docs/commands/update_cells.md | 1 - docs/commands/url.md | 1 - docs/commands/url_host.md | 1 - docs/commands/url_path.md | 1 - docs/commands/url_query.md | 1 - docs/commands/url_scheme.md | 1 - docs/commands/use.md | 16 ++++++++++++++++ docs/commands/version.md | 1 - docs/commands/view-source.md | 1 - docs/commands/where.md | 1 - docs/commands/which.md | 1 - docs/commands/with-env.md | 1 - docs/commands/wrap.md | 1 - docs/commands/zip.md | 1 - docs/make_docs.nu | 6 ++++-- 331 files changed, 234 insertions(+), 328 deletions(-) create mode 100644 docs/commands/from_nuon.md create mode 100644 docs/commands/to_nuon.md diff --git a/docs/commands/alias.md b/docs/commands/alias.md index 3f3b71dcce..df184075ca 100644 --- a/docs/commands/alias.md +++ b/docs/commands/alias.md @@ -21,4 +21,3 @@ Alias ll to ls -l ```shell > alias ll = ls -l ``` - diff --git a/docs/commands/all.md b/docs/commands/all.md index 272ebac66b..263f92e386 100644 --- a/docs/commands/all.md +++ b/docs/commands/all.md @@ -25,4 +25,3 @@ Check that all values are even ```shell > echo [2 4 6 8] | all? ($it mod 2) == 0 ``` - diff --git a/docs/commands/ansi.md b/docs/commands/ansi.md index b9c1952784..f1ff577f4c 100644 --- a/docs/commands/ansi.md +++ b/docs/commands/ansi.md @@ -43,4 +43,3 @@ Use ansi to color text with a style (blue on red in bold) ```shell > $"(ansi -e { fg: '#0000ff' bg: '#ff0000' attr: b })Hello Nu World(ansi reset)" ``` - diff --git a/docs/commands/ansi_gradient.md b/docs/commands/ansi_gradient.md index 44278c33f9..f0e70ab0f7 100644 --- a/docs/commands/ansi_gradient.md +++ b/docs/commands/ansi_gradient.md @@ -39,4 +39,3 @@ draw text in a gradient by specifying foreground end color - start color is assu ```shell > echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgend 0xe81cff ``` - diff --git a/docs/commands/ansi_strip.md b/docs/commands/ansi_strip.md index beebcebac3..ebd3ceedc3 100644 --- a/docs/commands/ansi_strip.md +++ b/docs/commands/ansi_strip.md @@ -20,4 +20,3 @@ strip ansi escape sequences from string ```shell > echo [ (ansi green) (ansi cursor_on) "hello" ] | str collect | ansi strip ``` - diff --git a/docs/commands/any.md b/docs/commands/any.md index 5c78858338..0729341c73 100644 --- a/docs/commands/any.md +++ b/docs/commands/any.md @@ -25,4 +25,3 @@ Check if any of the values is odd ```shell > echo [2 4 1 6 8] | any? ($it mod 2) == 1 ``` - diff --git a/docs/commands/append.md b/docs/commands/append.md index 5e2fd23690..ea8422ab0f 100644 --- a/docs/commands/append.md +++ b/docs/commands/append.md @@ -30,4 +30,3 @@ Append Ints and Strings ```shell > [0,1] | append [2,nu,4,shell] ``` - diff --git a/docs/commands/benchmark.md b/docs/commands/benchmark.md index dff15e71d2..8346db615e 100644 --- a/docs/commands/benchmark.md +++ b/docs/commands/benchmark.md @@ -20,4 +20,3 @@ Benchmarks a command within a block ```shell > benchmark { sleep 500ms } ``` - diff --git a/docs/commands/build-string.md b/docs/commands/build-string.md index 9cade6eca3..4460349076 100644 --- a/docs/commands/build-string.md +++ b/docs/commands/build-string.md @@ -25,4 +25,3 @@ Builds a string from letters a b c ```shell > build-string (1 + 2) = one ' ' plus ' ' two ``` - diff --git a/docs/commands/cal.md b/docs/commands/cal.md index 43761715cf..a11f2a5a69 100644 --- a/docs/commands/cal.md +++ b/docs/commands/cal.md @@ -35,4 +35,3 @@ This month's calendar with the week starting on monday ```shell > cal --week-start monday ``` - diff --git a/docs/commands/cd.md b/docs/commands/cd.md index 95a8663244..d3dc19afe9 100644 --- a/docs/commands/cd.md +++ b/docs/commands/cd.md @@ -20,4 +20,3 @@ Change to your home directory ```shell > cd ~ ``` - diff --git a/docs/commands/char.md b/docs/commands/char.md index 023c319d78..f3a2817006 100644 --- a/docs/commands/char.md +++ b/docs/commands/char.md @@ -38,4 +38,3 @@ Output multi-byte Unicode character ```shell > char -u 1F468 200D 1F466 200D 1F466 ``` - diff --git a/docs/commands/clear.md b/docs/commands/clear.md index 707beba4e6..f691daacfb 100644 --- a/docs/commands/clear.md +++ b/docs/commands/clear.md @@ -16,4 +16,3 @@ Clear the terminal ```shell > clear ``` - diff --git a/docs/commands/collect.md b/docs/commands/collect.md index 55d28ce70d..f8e09ca6d0 100644 --- a/docs/commands/collect.md +++ b/docs/commands/collect.md @@ -20,4 +20,3 @@ Use the second value in the stream ```shell > echo 1 2 3 | collect { |x| echo $x.1 } ``` - diff --git a/docs/commands/columns.md b/docs/commands/columns.md index fc10da024a..06f8821022 100644 --- a/docs/commands/columns.md +++ b/docs/commands/columns.md @@ -26,4 +26,3 @@ Get the second column from the table ```shell > [[name,age,grade]; [bill,20,a]] | columns | select 1 ``` - diff --git a/docs/commands/compact.md b/docs/commands/compact.md index dd022fdc89..54f99847ae 100644 --- a/docs/commands/compact.md +++ b/docs/commands/compact.md @@ -30,4 +30,3 @@ Filter out all instances of nothing from a list (Returns [1,2] ```shell > echo [1, $nothing, 2] | compact ``` - diff --git a/docs/commands/cp.md b/docs/commands/cp.md index 3ffecf1cf9..5bfbb1b000 100644 --- a/docs/commands/cp.md +++ b/docs/commands/cp.md @@ -27,4 +27,3 @@ Recursively copy dir_a to dir_b ```shell > cp -r dir_a dir_b ``` - diff --git a/docs/commands/dataframe.md b/docs/commands/dataframe.md index a92966d885..f92aa1bbae 100644 --- a/docs/commands/dataframe.md +++ b/docs/commands/dataframe.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> dataframe ``` - diff --git a/docs/commands/date.md b/docs/commands/date.md index b4c7213322..00fbc8d4b6 100644 --- a/docs/commands/date.md +++ b/docs/commands/date.md @@ -9,4 +9,3 @@ date ## Signature ```> date ``` - diff --git a/docs/commands/date_format.md b/docs/commands/date_format.md index e7d1d88765..002d1c1ed4 100644 --- a/docs/commands/date_format.md +++ b/docs/commands/date_format.md @@ -36,4 +36,3 @@ Format a given date using a given format string. ```shell > "2021-10-22 20:00:12 +01:00" | date format "%Y-%m-%d" ``` - diff --git a/docs/commands/date_humanize.md b/docs/commands/date_humanize.md index 1c055d4ea4..dd5a68226a 100644 --- a/docs/commands/date_humanize.md +++ b/docs/commands/date_humanize.md @@ -21,4 +21,3 @@ Print a 'humanized' format for the date, relative to now. ```shell > "2021-10-22 20:00:12 +01:00" | date humanize ``` - diff --git a/docs/commands/date_list-timezone.md b/docs/commands/date_list-timezone.md index 0152705b6b..1be9be2e13 100644 --- a/docs/commands/date_list-timezone.md +++ b/docs/commands/date_list-timezone.md @@ -16,4 +16,3 @@ Show timezone(s) that contains 'Shanghai' ```shell > date list-timezone | where timezone =~ Shanghai ``` - diff --git a/docs/commands/date_now.md b/docs/commands/date_now.md index 42aca8f4f2..0d7bb378d1 100644 --- a/docs/commands/date_now.md +++ b/docs/commands/date_now.md @@ -16,4 +16,3 @@ Get the current date and display it in a given format string. ```shell > date now | date format "%Y-%m-%d %H:%M:%S" ``` - diff --git a/docs/commands/date_to-table.md b/docs/commands/date_to-table.md index 7730df2ab9..20c32b0272 100644 --- a/docs/commands/date_to-table.md +++ b/docs/commands/date_to-table.md @@ -26,4 +26,3 @@ Print the date in a structured table. ```shell > '2020-04-12 22:10:57 +0200' | date to-table ``` - diff --git a/docs/commands/date_to-timezone.md b/docs/commands/date_to-timezone.md index 45facf1087..35631f0a04 100644 --- a/docs/commands/date_to-timezone.md +++ b/docs/commands/date_to-timezone.md @@ -35,4 +35,3 @@ Get the current date in Hawaii ```shell > "2020-10-10 10:00:00 +02:00" | date to-timezone "+0500" ``` - diff --git a/docs/commands/debug.md b/docs/commands/debug.md index 3cf7146f62..e240d02115 100644 --- a/docs/commands/debug.md +++ b/docs/commands/debug.md @@ -20,4 +20,3 @@ Describe the type of a string ```shell > 'hello' | debug ``` - diff --git a/docs/commands/decode.md b/docs/commands/decode.md index caf50f30c7..ec99d045f2 100644 --- a/docs/commands/decode.md +++ b/docs/commands/decode.md @@ -20,4 +20,3 @@ Decode the output of an external command ```shell > cat myfile.q | decode utf-8 ``` - diff --git a/docs/commands/def-env.md b/docs/commands/def-env.md index 2e6c507428..45020044fb 100644 --- a/docs/commands/def-env.md +++ b/docs/commands/def-env.md @@ -16,3 +16,9 @@ Define a custom command, which participates in the caller environment - `params`: parameters - `block`: body of the definition +## Examples + +Set environment variable by call a custom command +```shell +> def-env foo [] { let-env BAR = "BAZ" }; foo; $env.BAR +``` diff --git a/docs/commands/def.md b/docs/commands/def.md index eec60c22d3..c6b57984a5 100644 --- a/docs/commands/def.md +++ b/docs/commands/def.md @@ -27,4 +27,3 @@ Define a command and run it with parameter(s) ```shell > def say-sth [sth: string] { echo $sth }; say-sth hi ``` - diff --git a/docs/commands/default.md b/docs/commands/default.md index 5d131fd5ee..13f06bc9d9 100644 --- a/docs/commands/default.md +++ b/docs/commands/default.md @@ -21,4 +21,3 @@ Give a default 'target' to all file entries ```shell > ls -la | default target 'nothing' ``` - diff --git a/docs/commands/describe.md b/docs/commands/describe.md index 8d10779567..4a417fe42f 100644 --- a/docs/commands/describe.md +++ b/docs/commands/describe.md @@ -16,4 +16,3 @@ Describe the type of a string ```shell > 'hello' | describe ``` - diff --git a/docs/commands/detect_columns.md b/docs/commands/detect_columns.md index ce8ee7c49a..66d7884469 100644 --- a/docs/commands/detect_columns.md +++ b/docs/commands/detect_columns.md @@ -26,4 +26,3 @@ Splits a multi-line string into columns with headers detected ```shell > echo $'c1 c2 c3(char nl)a b c' | detect columns ``` - diff --git a/docs/commands/dfr.md b/docs/commands/dfr.md index 72823100b8..d6de134698 100644 --- a/docs/commands/dfr.md +++ b/docs/commands/dfr.md @@ -9,4 +9,3 @@ Dataframe commands ## Signature ```> dfr ``` - diff --git a/docs/commands/dfr_aggregate.md b/docs/commands/dfr_aggregate.md index 5eab69c81b..cf8c937d92 100644 --- a/docs/commands/dfr_aggregate.md +++ b/docs/commands/dfr_aggregate.md @@ -12,7 +12,7 @@ Performs an aggregation operation on a dataframe and groupby object ## Parameters - - `operation_name`: + - `operation_name`: Dataframes: mean, sum, min, max, quantile, median, var, std GroupBy: mean, sum, min, max, first, last, nunique, quantile, median, var, std, count - `--quantile {number}`: quantile value for quantile operation @@ -34,4 +34,3 @@ Aggregate sum in series ```shell > [4 1 5 6] | dfr to-df | dfr aggregate sum ``` - diff --git a/docs/commands/dfr_all-false.md b/docs/commands/dfr_all-false.md index c909882d8c..3530af79f5 100644 --- a/docs/commands/dfr_all-false.md +++ b/docs/commands/dfr_all-false.md @@ -23,4 +23,3 @@ Checks the result from a comparison let res = ($s > 9); $res | dfr all-false ``` - diff --git a/docs/commands/dfr_all-true.md b/docs/commands/dfr_all-true.md index 9b63b48c04..ee35eecdcc 100644 --- a/docs/commands/dfr_all-true.md +++ b/docs/commands/dfr_all-true.md @@ -23,4 +23,3 @@ Checks the result from a comparison let res = ($s > 9); $res | dfr all-true ``` - diff --git a/docs/commands/dfr_append.md b/docs/commands/dfr_append.md index 08384bf59f..4b56b91b28 100644 --- a/docs/commands/dfr_append.md +++ b/docs/commands/dfr_append.md @@ -28,4 +28,3 @@ Appends a dataframe merging at the end of columns > let a = ([[a b]; [1 2] [3 4]] | dfr to-df); $a | dfr append $a --col ``` - diff --git a/docs/commands/dfr_arg-max.md b/docs/commands/dfr_arg-max.md index 2014de1695..63d6d8eeda 100644 --- a/docs/commands/dfr_arg-max.md +++ b/docs/commands/dfr_arg-max.md @@ -16,4 +16,3 @@ Returns index for max value ```shell > [1 3 2] | dfr to-df | dfr arg-max ``` - diff --git a/docs/commands/dfr_arg-min.md b/docs/commands/dfr_arg-min.md index 34beae7417..0436de9401 100644 --- a/docs/commands/dfr_arg-min.md +++ b/docs/commands/dfr_arg-min.md @@ -16,4 +16,3 @@ Returns index for min value ```shell > [1 3 2] | dfr to-df | dfr arg-min ``` - diff --git a/docs/commands/dfr_arg-sort.md b/docs/commands/dfr_arg-sort.md index dab3b6bcae..6291dbee72 100644 --- a/docs/commands/dfr_arg-sort.md +++ b/docs/commands/dfr_arg-sort.md @@ -25,4 +25,3 @@ Returns indexes for a sorted series ```shell > [1 2 2 3 3] | dfr to-df | dfr arg-sort -r ``` - diff --git a/docs/commands/dfr_arg-true.md b/docs/commands/dfr_arg-true.md index ba24b2340b..902b4a4fe4 100644 --- a/docs/commands/dfr_arg-true.md +++ b/docs/commands/dfr_arg-true.md @@ -16,4 +16,3 @@ Returns indexes where values are true ```shell > [$false $true $false] | dfr to-df | dfr arg-true ``` - diff --git a/docs/commands/dfr_arg-unique.md b/docs/commands/dfr_arg-unique.md index 4e0a7a4370..5cd57bead9 100644 --- a/docs/commands/dfr_arg-unique.md +++ b/docs/commands/dfr_arg-unique.md @@ -16,4 +16,3 @@ Returns indexes for unique values ```shell > [1 2 2 3 3] | dfr to-df | dfr arg-unique ``` - diff --git a/docs/commands/dfr_column.md b/docs/commands/dfr_column.md index 64e6c6d59c..580e4a7197 100644 --- a/docs/commands/dfr_column.md +++ b/docs/commands/dfr_column.md @@ -20,4 +20,3 @@ Returns the selected column as series ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr column a ``` - diff --git a/docs/commands/dfr_concatenate.md b/docs/commands/dfr_concatenate.md index 3595c10d23..0530a3bf74 100644 --- a/docs/commands/dfr_concatenate.md +++ b/docs/commands/dfr_concatenate.md @@ -21,4 +21,3 @@ Concatenate string > let other = ([za xs cd] | dfr to-df); [abc abc abc] | dfr to-df | dfr concatenate $other ``` - diff --git a/docs/commands/dfr_contains.md b/docs/commands/dfr_contains.md index 57b0418013..130867c57d 100644 --- a/docs/commands/dfr_contains.md +++ b/docs/commands/dfr_contains.md @@ -20,4 +20,3 @@ Returns boolean indicating if pattern was found ```shell > [abc acb acb] | dfr to-df | dfr contains ab ``` - diff --git a/docs/commands/dfr_count-null.md b/docs/commands/dfr_count-null.md index 7a2fe62c46..3003a60288 100644 --- a/docs/commands/dfr_count-null.md +++ b/docs/commands/dfr_count-null.md @@ -17,4 +17,3 @@ Counts null values > let s = ([1 1 0 0 3 3 4] | dfr to-df); ($s / $s) | dfr count-null ``` - diff --git a/docs/commands/dfr_count-unique.md b/docs/commands/dfr_count-unique.md index 62254704f1..3e18189a61 100644 --- a/docs/commands/dfr_count-unique.md +++ b/docs/commands/dfr_count-unique.md @@ -16,4 +16,3 @@ Counts unique values ```shell > [1 1 2 2 3 3 4] | dfr to-df | dfr count-unique ``` - diff --git a/docs/commands/dfr_cumulative.md b/docs/commands/dfr_cumulative.md index d87eb669f7..71abb2e040 100644 --- a/docs/commands/dfr_cumulative.md +++ b/docs/commands/dfr_cumulative.md @@ -21,4 +21,3 @@ Cumulative sum for a series ```shell > [1 2 3 4 5] | dfr to-df | dfr cumulative sum ``` - diff --git a/docs/commands/dfr_describe.md b/docs/commands/dfr_describe.md index 9b6636647f..f4474d344c 100644 --- a/docs/commands/dfr_describe.md +++ b/docs/commands/dfr_describe.md @@ -16,4 +16,3 @@ dataframe description ```shell > [[a b]; [1 1] [1 1]] | dfr to-df | dfr describe ``` - diff --git a/docs/commands/dfr_drop-duplicates.md b/docs/commands/dfr_drop-duplicates.md index 518ee6a499..e16bedeaab 100644 --- a/docs/commands/dfr_drop-duplicates.md +++ b/docs/commands/dfr_drop-duplicates.md @@ -21,4 +21,3 @@ drop duplicates ```shell > [[a b]; [1 2] [3 4] [1 2]] | dfr to-df | dfr drop-duplicates ``` - diff --git a/docs/commands/dfr_drop-nulls.md b/docs/commands/dfr_drop-nulls.md index deab1a9215..c990158008 100644 --- a/docs/commands/dfr_drop-nulls.md +++ b/docs/commands/dfr_drop-nulls.md @@ -29,4 +29,3 @@ drop null values in dataframe > let s = ([1 2 0 0 3 4] | dfr to-df); ($s / $s) | dfr drop-nulls ``` - diff --git a/docs/commands/dfr_drop.md b/docs/commands/dfr_drop.md index aa1ee0a3d5..d3373456bf 100644 --- a/docs/commands/dfr_drop.md +++ b/docs/commands/dfr_drop.md @@ -20,4 +20,3 @@ drop column a ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr drop a ``` - diff --git a/docs/commands/dfr_dtypes.md b/docs/commands/dfr_dtypes.md index 858346e9da..99b528259d 100644 --- a/docs/commands/dfr_dtypes.md +++ b/docs/commands/dfr_dtypes.md @@ -16,4 +16,3 @@ Dataframe dtypes ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr dtypes ``` - diff --git a/docs/commands/dfr_filter-with.md b/docs/commands/dfr_filter-with.md index 1fcc5afbd4..ed588884d1 100644 --- a/docs/commands/dfr_filter-with.md +++ b/docs/commands/dfr_filter-with.md @@ -21,4 +21,3 @@ Filter dataframe using a bool mask > let mask = ([$true $false] | dfr to-df); [[a b]; [1 2] [3 4]] | dfr to-df | dfr filter-with $mask ``` - diff --git a/docs/commands/dfr_first.md b/docs/commands/dfr_first.md index 2b40d2c70d..de743be158 100644 --- a/docs/commands/dfr_first.md +++ b/docs/commands/dfr_first.md @@ -20,4 +20,3 @@ Create new dataframe with head rows ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr first 1 ``` - diff --git a/docs/commands/dfr_get-day.md b/docs/commands/dfr_get-day.md index 9cc9567f12..9a692c8f63 100644 --- a/docs/commands/dfr_get-day.md +++ b/docs/commands/dfr_get-day.md @@ -18,4 +18,3 @@ Returns day from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-day ``` - diff --git a/docs/commands/dfr_get-hour.md b/docs/commands/dfr_get-hour.md index 443640f97f..e51823c64b 100644 --- a/docs/commands/dfr_get-hour.md +++ b/docs/commands/dfr_get-hour.md @@ -18,4 +18,3 @@ Returns hour from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-hour ``` - diff --git a/docs/commands/dfr_get-minute.md b/docs/commands/dfr_get-minute.md index fbccf721d6..7316bd0c4f 100644 --- a/docs/commands/dfr_get-minute.md +++ b/docs/commands/dfr_get-minute.md @@ -18,4 +18,3 @@ Returns minute from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-minute ``` - diff --git a/docs/commands/dfr_get-month.md b/docs/commands/dfr_get-month.md index 57130547bd..4257dccabf 100644 --- a/docs/commands/dfr_get-month.md +++ b/docs/commands/dfr_get-month.md @@ -18,4 +18,3 @@ Returns month from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-month ``` - diff --git a/docs/commands/dfr_get-nanosecond.md b/docs/commands/dfr_get-nanosecond.md index c305567c98..18f5e84ebd 100644 --- a/docs/commands/dfr_get-nanosecond.md +++ b/docs/commands/dfr_get-nanosecond.md @@ -18,4 +18,3 @@ Returns nanosecond from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-nanosecond ``` - diff --git a/docs/commands/dfr_get-ordinal.md b/docs/commands/dfr_get-ordinal.md index 484cd2c981..db4aa854a4 100644 --- a/docs/commands/dfr_get-ordinal.md +++ b/docs/commands/dfr_get-ordinal.md @@ -18,4 +18,3 @@ Returns ordinal from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-ordinal ``` - diff --git a/docs/commands/dfr_get-second.md b/docs/commands/dfr_get-second.md index 882776c6b5..b7dc1fc64e 100644 --- a/docs/commands/dfr_get-second.md +++ b/docs/commands/dfr_get-second.md @@ -18,4 +18,3 @@ Returns second from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-second ``` - diff --git a/docs/commands/dfr_get-week.md b/docs/commands/dfr_get-week.md index 775ab66787..1cc9d4f799 100644 --- a/docs/commands/dfr_get-week.md +++ b/docs/commands/dfr_get-week.md @@ -18,4 +18,3 @@ Returns week from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-week ``` - diff --git a/docs/commands/dfr_get-weekday.md b/docs/commands/dfr_get-weekday.md index 41a084c5a4..542e1d28e2 100644 --- a/docs/commands/dfr_get-weekday.md +++ b/docs/commands/dfr_get-weekday.md @@ -18,4 +18,3 @@ Returns weekday from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-weekday ``` - diff --git a/docs/commands/dfr_get-year.md b/docs/commands/dfr_get-year.md index 3c8af69095..d77d9ff75c 100644 --- a/docs/commands/dfr_get-year.md +++ b/docs/commands/dfr_get-year.md @@ -18,4 +18,3 @@ Returns year from a date let df = ([$dt $dt] | dfr to-df); $df | dfr get-year ``` - diff --git a/docs/commands/dfr_get.md b/docs/commands/dfr_get.md index 5207313430..a291a0341f 100644 --- a/docs/commands/dfr_get.md +++ b/docs/commands/dfr_get.md @@ -20,4 +20,3 @@ Creates dataframe with selected columns ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr get a ``` - diff --git a/docs/commands/dfr_group-by.md b/docs/commands/dfr_group-by.md index 64db45ca93..3582750ca6 100644 --- a/docs/commands/dfr_group-by.md +++ b/docs/commands/dfr_group-by.md @@ -20,4 +20,3 @@ Grouping by column a ```shell > [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a ``` - diff --git a/docs/commands/dfr_is-duplicated.md b/docs/commands/dfr_is-duplicated.md index 0e264a9835..6e80bc78b6 100644 --- a/docs/commands/dfr_is-duplicated.md +++ b/docs/commands/dfr_is-duplicated.md @@ -16,4 +16,3 @@ Create mask indicating duplicated values ```shell > [5 6 6 6 8 8 8] | dfr to-df | dfr is-duplicated ``` - diff --git a/docs/commands/dfr_is-in.md b/docs/commands/dfr_is-in.md index 2537726a13..dfcf67a23a 100644 --- a/docs/commands/dfr_is-in.md +++ b/docs/commands/dfr_is-in.md @@ -21,4 +21,3 @@ Checks if elements from a series are contained in right series > let other = ([1 3 6] | dfr to-df); [5 6 6 6 8 8 8] | dfr to-df | dfr is-in $other ``` - diff --git a/docs/commands/dfr_is-not-null.md b/docs/commands/dfr_is-not-null.md index 631e31becd..9b7453a656 100644 --- a/docs/commands/dfr_is-not-null.md +++ b/docs/commands/dfr_is-not-null.md @@ -18,4 +18,3 @@ Create mask where values are not null let res = ($s / $s); $res | dfr is-not-null ``` - diff --git a/docs/commands/dfr_is-null.md b/docs/commands/dfr_is-null.md index 1a59cae557..c101520c6a 100644 --- a/docs/commands/dfr_is-null.md +++ b/docs/commands/dfr_is-null.md @@ -18,4 +18,3 @@ Create mask where values are null let res = ($s / $s); $res | dfr is-null ``` - diff --git a/docs/commands/dfr_is-unique.md b/docs/commands/dfr_is-unique.md index 670f9dcdc0..844f43d921 100644 --- a/docs/commands/dfr_is-unique.md +++ b/docs/commands/dfr_is-unique.md @@ -16,4 +16,3 @@ Create mask indicating unique values ```shell > [5 6 6 6 8 8 8] | dfr to-df | dfr is-unique ``` - diff --git a/docs/commands/dfr_join.md b/docs/commands/dfr_join.md index 0b6de5e016..ad92a0bced 100644 --- a/docs/commands/dfr_join.md +++ b/docs/commands/dfr_join.md @@ -25,4 +25,3 @@ inner join dataframe > let right = ([[a b c]; [1 2 5] [3 4 5] [5 6 6]] | dfr to-df); $right | dfr join $right -l [a b] -r [a b] ``` - diff --git a/docs/commands/dfr_last.md b/docs/commands/dfr_last.md index 6234ee4329..3300905616 100644 --- a/docs/commands/dfr_last.md +++ b/docs/commands/dfr_last.md @@ -20,4 +20,3 @@ Create new dataframe with last rows ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr last 1 ``` - diff --git a/docs/commands/dfr_melt.md b/docs/commands/dfr_melt.md index f939c4b552..f7e31d4fa0 100644 --- a/docs/commands/dfr_melt.md +++ b/docs/commands/dfr_melt.md @@ -23,4 +23,3 @@ melt dataframe ```shell > [[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | dfr to-df | dfr melt -c [b c] -v [a d] ``` - diff --git a/docs/commands/dfr_not.md b/docs/commands/dfr_not.md index a81943de3b..e244f4cfa7 100644 --- a/docs/commands/dfr_not.md +++ b/docs/commands/dfr_not.md @@ -16,4 +16,3 @@ Inverts boolean mask ```shell > [$true $false $true] | dfr to-df | dfr not ``` - diff --git a/docs/commands/dfr_open.md b/docs/commands/dfr_open.md index 19c6b66b71..2ba3ae81bc 100644 --- a/docs/commands/dfr_open.md +++ b/docs/commands/dfr_open.md @@ -25,4 +25,3 @@ Takes a file name and creates a dataframe ```shell > dfr open test.csv ``` - diff --git a/docs/commands/dfr_pivot.md b/docs/commands/dfr_pivot.md index 6680724106..399b4951f1 100644 --- a/docs/commands/dfr_pivot.md +++ b/docs/commands/dfr_pivot.md @@ -22,4 +22,3 @@ Pivot a dataframe on b and aggregation on col c ```shell > [[a b c]; [one x 1] [two y 2]] | dfr to-df | dfr group-by a | dfr pivot b c sum ``` - diff --git a/docs/commands/dfr_rename-col.md b/docs/commands/dfr_rename-col.md index f1c9f3e6e1..f3515d99a0 100644 --- a/docs/commands/dfr_rename-col.md +++ b/docs/commands/dfr_rename-col.md @@ -21,4 +21,3 @@ Renames a dataframe column ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr rename-col a a_new ``` - diff --git a/docs/commands/dfr_rename.md b/docs/commands/dfr_rename.md index 68fc84e9aa..5d86123549 100644 --- a/docs/commands/dfr_rename.md +++ b/docs/commands/dfr_rename.md @@ -20,4 +20,3 @@ Renames a series ```shell > [5 6 7 8] | dfr to-df | dfr rename new_name ``` - diff --git a/docs/commands/dfr_replace-all.md b/docs/commands/dfr_replace-all.md index f9cda671e4..e23cbd78c0 100644 --- a/docs/commands/dfr_replace-all.md +++ b/docs/commands/dfr_replace-all.md @@ -21,4 +21,3 @@ Replaces string ```shell > [abac abac abac] | dfr to-df | dfr replace-all -p a -r A ``` - diff --git a/docs/commands/dfr_replace.md b/docs/commands/dfr_replace.md index cb6e1c1c69..b4850aca53 100644 --- a/docs/commands/dfr_replace.md +++ b/docs/commands/dfr_replace.md @@ -21,4 +21,3 @@ Replaces string ```shell > [abc abc abc] | dfr to-df | dfr replace -p ab -r AB ``` - diff --git a/docs/commands/dfr_rolling.md b/docs/commands/dfr_rolling.md index 83d2673970..cb21085a6d 100644 --- a/docs/commands/dfr_rolling.md +++ b/docs/commands/dfr_rolling.md @@ -26,4 +26,3 @@ Rolling max for a series ```shell > [1 2 3 4 5] | dfr to-df | dfr rolling max 2 | dfr drop-nulls ``` - diff --git a/docs/commands/dfr_sample.md b/docs/commands/dfr_sample.md index 0647f52a16..13ff12014f 100644 --- a/docs/commands/dfr_sample.md +++ b/docs/commands/dfr_sample.md @@ -27,4 +27,3 @@ Shows sample row using fraction and replace ```shell > [[a b]; [1 2] [3 4] [5 6]] | dfr to-df | dfr sample -f 0.5 -e ``` - diff --git a/docs/commands/dfr_set-with-idx.md b/docs/commands/dfr_set-with-idx.md index 9dd1228dac..55a41052f5 100644 --- a/docs/commands/dfr_set-with-idx.md +++ b/docs/commands/dfr_set-with-idx.md @@ -23,4 +23,3 @@ Set value in selected rows from series let indices = ([0 2] | dfr to-df); $series | dfr set-with-idx 6 -i $indices ``` - diff --git a/docs/commands/dfr_set.md b/docs/commands/dfr_set.md index 5fccaa9a98..5999f4b58d 100644 --- a/docs/commands/dfr_set.md +++ b/docs/commands/dfr_set.md @@ -23,4 +23,3 @@ Shifts the values by a given period let mask = ($s | dfr is-null); $s | dfr set 0 --mask $mask ``` - diff --git a/docs/commands/dfr_shape.md b/docs/commands/dfr_shape.md index 21b4f2e483..b2b16ec834 100644 --- a/docs/commands/dfr_shape.md +++ b/docs/commands/dfr_shape.md @@ -16,4 +16,3 @@ Shows row and column shape ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr shape ``` - diff --git a/docs/commands/dfr_shift.md b/docs/commands/dfr_shift.md index 68dc9a9980..71b3d229f7 100644 --- a/docs/commands/dfr_shift.md +++ b/docs/commands/dfr_shift.md @@ -20,4 +20,3 @@ Shifts the values by a given period ```shell > [1 2 2 3 3] | dfr to-df | dfr shift 2 | dfr drop-nulls ``` - diff --git a/docs/commands/dfr_slice.md b/docs/commands/dfr_slice.md index 589f491948..59f64eda12 100644 --- a/docs/commands/dfr_slice.md +++ b/docs/commands/dfr_slice.md @@ -21,4 +21,3 @@ Create new dataframe from a slice of the rows ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr slice 0 1 ``` - diff --git a/docs/commands/dfr_sort.md b/docs/commands/dfr_sort.md index 5004359d73..db83ad70da 100644 --- a/docs/commands/dfr_sort.md +++ b/docs/commands/dfr_sort.md @@ -26,4 +26,3 @@ Create new sorted series ```shell > [3 4 1 2] | dfr to-df | dfr sort ``` - diff --git a/docs/commands/dfr_str-lengths.md b/docs/commands/dfr_str-lengths.md index 8bce5ae757..98770ee999 100644 --- a/docs/commands/dfr_str-lengths.md +++ b/docs/commands/dfr_str-lengths.md @@ -16,4 +16,3 @@ Returns string lengths ```shell > [a ab abc] | dfr to-df | dfr str-lengths ``` - diff --git a/docs/commands/dfr_str-slice.md b/docs/commands/dfr_str-slice.md index ae02cd7626..18b56d2471 100644 --- a/docs/commands/dfr_str-slice.md +++ b/docs/commands/dfr_str-slice.md @@ -21,4 +21,3 @@ Creates slices from the strings ```shell > [abcded abc321 abc123] | dfr to-df | dfr str-slice 1 -l 2 ``` - diff --git a/docs/commands/dfr_strftime.md b/docs/commands/dfr_strftime.md index 7162c1299b..e51f169bc5 100644 --- a/docs/commands/dfr_strftime.md +++ b/docs/commands/dfr_strftime.md @@ -22,4 +22,3 @@ Formats date let df = ([$dt $dt] | dfr to-df); $df | dfr strftime "%Y/%m/%d" ``` - diff --git a/docs/commands/dfr_take.md b/docs/commands/dfr_take.md index cb5886dc49..96146c5d58 100644 --- a/docs/commands/dfr_take.md +++ b/docs/commands/dfr_take.md @@ -29,4 +29,3 @@ Takes selected rows from series let indices = ([0 2] | dfr to-df); $series | dfr take $indices ``` - diff --git a/docs/commands/dfr_to-csv.md b/docs/commands/dfr_to-csv.md index ae170dd6a9..c97f79f479 100644 --- a/docs/commands/dfr_to-csv.md +++ b/docs/commands/dfr_to-csv.md @@ -27,4 +27,3 @@ Saves dataframe to csv file using other delimiter ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-csv test.csv -d '|' ``` - diff --git a/docs/commands/dfr_to-df.md b/docs/commands/dfr_to-df.md index 820834785f..c4186fdbf5 100644 --- a/docs/commands/dfr_to-df.md +++ b/docs/commands/dfr_to-df.md @@ -31,4 +31,3 @@ Takes a list of booleans and creates a dataframe ```shell > [$true $true $false] | dfr to-df ``` - diff --git a/docs/commands/dfr_to-dummies.md b/docs/commands/dfr_to-dummies.md index 63e2f330a6..e282878381 100644 --- a/docs/commands/dfr_to-dummies.md +++ b/docs/commands/dfr_to-dummies.md @@ -21,4 +21,3 @@ Create new dataframe with dummy variables from a series ```shell > [1 2 2 3 3] | dfr to-df | dfr to-dummies ``` - diff --git a/docs/commands/dfr_to-lowercase.md b/docs/commands/dfr_to-lowercase.md index a10d526040..a497c18a08 100644 --- a/docs/commands/dfr_to-lowercase.md +++ b/docs/commands/dfr_to-lowercase.md @@ -16,4 +16,3 @@ Modifies strings to lowercase ```shell > [Abc aBc abC] | dfr to-df | dfr to-lowercase ``` - diff --git a/docs/commands/dfr_to-nu.md b/docs/commands/dfr_to-nu.md index c0980cbbe3..ad37a0e325 100644 --- a/docs/commands/dfr_to-nu.md +++ b/docs/commands/dfr_to-nu.md @@ -26,4 +26,3 @@ Shows tail rows from dataframe ```shell > [[a b]; [1 2] [3 4] [5 6]] | dfr to-df | dfr to-nu -t -n 1 ``` - diff --git a/docs/commands/dfr_to-parquet.md b/docs/commands/dfr_to-parquet.md index 62efad3282..8d3a216d08 100644 --- a/docs/commands/dfr_to-parquet.md +++ b/docs/commands/dfr_to-parquet.md @@ -20,4 +20,3 @@ Saves dataframe to csv file ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-parquet test.parquet ``` - diff --git a/docs/commands/dfr_to-uppercase.md b/docs/commands/dfr_to-uppercase.md index d89b2f3a11..4e47ebefaa 100644 --- a/docs/commands/dfr_to-uppercase.md +++ b/docs/commands/dfr_to-uppercase.md @@ -16,4 +16,3 @@ Modifies strings to uppercase ```shell > [Abc aBc abC] | dfr to-df | dfr to-uppercase ``` - diff --git a/docs/commands/dfr_unique.md b/docs/commands/dfr_unique.md index 19bd68766e..587108b24a 100644 --- a/docs/commands/dfr_unique.md +++ b/docs/commands/dfr_unique.md @@ -16,4 +16,3 @@ Returns unique values from a series ```shell > [2 2 2 2 2] | dfr to-df | dfr unique ``` - diff --git a/docs/commands/dfr_value-counts.md b/docs/commands/dfr_value-counts.md index cf5788f0d5..a3dffb6e8d 100644 --- a/docs/commands/dfr_value-counts.md +++ b/docs/commands/dfr_value-counts.md @@ -16,4 +16,3 @@ Calculates value counts ```shell > [5 5 5 5 6 6] | dfr to-df | dfr value-counts ``` - diff --git a/docs/commands/dfr_with-column.md b/docs/commands/dfr_with-column.md index 76b740dd50..7d70b9de25 100644 --- a/docs/commands/dfr_with-column.md +++ b/docs/commands/dfr_with-column.md @@ -21,4 +21,3 @@ Adds a series to the dataframe ```shell > [[a b]; [1 2] [3 4]] | dfr to-df | dfr with-column ([5 6] | dfr to-df) --name c ``` - diff --git a/docs/commands/do.md b/docs/commands/do.md index 5678f11a72..6643f26804 100644 --- a/docs/commands/do.md +++ b/docs/commands/do.md @@ -27,4 +27,3 @@ Run the block and ignore errors ```shell > do -i { thisisnotarealcommand } ``` - diff --git a/docs/commands/drop.md b/docs/commands/drop.md index 4253fb2ac1..efd84620e4 100644 --- a/docs/commands/drop.md +++ b/docs/commands/drop.md @@ -30,4 +30,3 @@ Remove the last two items of a list/table ```shell > [0,1,2,3] | drop 2 ``` - diff --git a/docs/commands/drop_column.md b/docs/commands/drop_column.md index 50c581de4c..8343baa60c 100644 --- a/docs/commands/drop_column.md +++ b/docs/commands/drop_column.md @@ -20,4 +20,3 @@ Remove the last column of a table ```shell > echo [[lib, extension]; [nu-lib, rs] [nu-core, rb]] | drop column ``` - diff --git a/docs/commands/drop_nth.md b/docs/commands/drop_nth.md index dd612fe51d..9b26489f69 100644 --- a/docs/commands/drop_nth.md +++ b/docs/commands/drop_nth.md @@ -41,4 +41,3 @@ Drop range rows from second to fourth ```shell > echo [first second third fourth fifth] | drop nth (1..3) ``` - diff --git a/docs/commands/du.md b/docs/commands/du.md index 3fa5e2622a..ec29935b5a 100644 --- a/docs/commands/du.md +++ b/docs/commands/du.md @@ -25,4 +25,3 @@ Disk usage of the current directory ```shell > du ``` - diff --git a/docs/commands/each.md b/docs/commands/each.md index 2f9056a54e..5c1460c426 100644 --- a/docs/commands/each.md +++ b/docs/commands/each.md @@ -21,4 +21,3 @@ Multiplies elements in list ```shell > [1 2 3] | each { |it| 2 * $it } ``` - diff --git a/docs/commands/each_group.md b/docs/commands/each_group.md index acd2fceca3..2d54b0fec8 100644 --- a/docs/commands/each_group.md +++ b/docs/commands/each_group.md @@ -21,4 +21,3 @@ Echo the sum of each pair ```shell > echo [1 2 3 4] | each group 2 { |it| $it.0 + $it.1 } ``` - diff --git a/docs/commands/each_window.md b/docs/commands/each_window.md index 99dbe77988..de874ec616 100644 --- a/docs/commands/each_window.md +++ b/docs/commands/each_window.md @@ -27,4 +27,3 @@ A sliding window of two elements, with a stride of 3 ```shell > [1, 2, 3, 4, 5, 6, 7, 8] | each window 2 --stride 3 { |x| $x.0 + $x.1 } ``` - diff --git a/docs/commands/echo.md b/docs/commands/echo.md index 588e916b5a..3463fe4638 100644 --- a/docs/commands/echo.md +++ b/docs/commands/echo.md @@ -25,4 +25,3 @@ Print the value of the special '$nu' variable ```shell > echo $nu ``` - diff --git a/docs/commands/empty.md b/docs/commands/empty.md index 3c274605f5..a8b20b56f8 100644 --- a/docs/commands/empty.md +++ b/docs/commands/empty.md @@ -31,4 +31,3 @@ use a block if setting the empty cell contents is wanted ```shell > [[2020/04/16 2020/07/10 2020/11/16]; ['' [27] [37]]] | empty? 2020/04/16 -b { |_| [33 37] } ``` - diff --git a/docs/commands/enter.md b/docs/commands/enter.md index 6135c03a83..0e29c38241 100644 --- a/docs/commands/enter.md +++ b/docs/commands/enter.md @@ -13,4 +13,3 @@ Enters a new shell at the given path. ## Parameters - `path`: the path to enter as a new shell - diff --git a/docs/commands/env.md b/docs/commands/env.md index 0519955282..953b1ea620 100644 --- a/docs/commands/env.md +++ b/docs/commands/env.md @@ -26,4 +26,3 @@ Another way to check whether the env variable `PATH` exists ```shell > 'PATH' in (env).name ``` - diff --git a/docs/commands/error_make.md b/docs/commands/error_make.md index df678ca820..88cfc17c66 100644 --- a/docs/commands/error_make.md +++ b/docs/commands/error_make.md @@ -23,4 +23,3 @@ Create a custom error for a custom command error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } } } ``` - diff --git a/docs/commands/every.md b/docs/commands/every.md index 009e8a60a6..4c40fc2070 100644 --- a/docs/commands/every.md +++ b/docs/commands/every.md @@ -26,4 +26,3 @@ Skip every second row ```shell > [1 2 3 4 5] | every 2 --skip ``` - diff --git a/docs/commands/exec.md b/docs/commands/exec.md index 3a7ee53383..e012e8e7fd 100644 --- a/docs/commands/exec.md +++ b/docs/commands/exec.md @@ -26,4 +26,3 @@ Execute 'nautilus' ```shell > exec nautilus ``` - diff --git a/docs/commands/exit.md b/docs/commands/exit.md index 3adcb71ec5..575605245e 100644 --- a/docs/commands/exit.md +++ b/docs/commands/exit.md @@ -26,4 +26,3 @@ Exit all shells (exiting Nu) ```shell > exit --now ``` - diff --git a/docs/commands/export.md b/docs/commands/export.md index 65d60b284f..b70bfb4c94 100644 --- a/docs/commands/export.md +++ b/docs/commands/export.md @@ -9,4 +9,3 @@ Export custom commands or environment variables from a module. ## Signature ```> export ``` - diff --git a/docs/commands/export_def-env.md b/docs/commands/export_def-env.md index 82c15c42f1..7b078041c8 100644 --- a/docs/commands/export_def-env.md +++ b/docs/commands/export_def-env.md @@ -16,3 +16,9 @@ Define a custom command that participates in the environment and export it from - `params`: parameters - `block`: body of the definition +## Examples + +Define a custom command that participates in the environment in a module and call it +```shell +> module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR +``` diff --git a/docs/commands/export_def.md b/docs/commands/export_def.md index b20d576bbc..c6263aac44 100644 --- a/docs/commands/export_def.md +++ b/docs/commands/export_def.md @@ -16,3 +16,9 @@ Define a custom command and export it from a module - `params`: parameters - `block`: body of the definition +## Examples + +Define a custom command in a module and call it +```shell +> module spam { export def foo [] { "foo" } }; use spam foo; foo +``` diff --git a/docs/commands/export_env.md b/docs/commands/export_env.md index 5a3403c266..a692c84429 100644 --- a/docs/commands/export_env.md +++ b/docs/commands/export_env.md @@ -15,3 +15,9 @@ Export a block from a module that will be evaluated as an environment variable w - `name`: name of the environment variable - `block`: body of the environment variable definition +## Examples + +Import and evaluate environment variable from a module +```shell +> module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV +``` diff --git a/docs/commands/extern.md b/docs/commands/extern.md index b41d37d8c6..f80834c399 100644 --- a/docs/commands/extern.md +++ b/docs/commands/extern.md @@ -14,4 +14,3 @@ Define a signature for an external command - `def_name`: definition name - `params`: parameters - diff --git a/docs/commands/fetch.md b/docs/commands/fetch.md index 40e644655c..6f2fcccb2b 100644 --- a/docs/commands/fetch.md +++ b/docs/commands/fetch.md @@ -16,7 +16,7 @@ Fetch the contents from a URL (HTTP GET operation). - `--user {any}`: the username when authenticating - `--password {any}`: the password when authenticating - `--timeout {int}`: timeout period in seconds - - `--headers {any}`: custom headers you want to add + - `--headers {any}`: custom headers you want to add - `--raw`: fetch contents as text rather than a table ## Examples @@ -35,4 +35,3 @@ Fetch content from url.com, with custom header ```shell > fetch -H [my-header-key my-header-value] url.com ``` - diff --git a/docs/commands/find.md b/docs/commands/find.md index 206003cc36..5ba8e207dc 100644 --- a/docs/commands/find.md +++ b/docs/commands/find.md @@ -46,4 +46,3 @@ Find if a service is not running ```shell > echo [[version patch]; [0.1.0 $false] [0.1.1 $true] [0.2.0 $false]] | find -p { |it| $it.patch } ``` - diff --git a/docs/commands/first.md b/docs/commands/first.md index 1e6553451a..17cc2af1cf 100644 --- a/docs/commands/first.md +++ b/docs/commands/first.md @@ -25,4 +25,3 @@ Return the first 2 items of a list/table ```shell > [1 2 3] | first 2 ``` - diff --git a/docs/commands/flatten.md b/docs/commands/flatten.md index c428bb89da..080fa3b8d1 100644 --- a/docs/commands/flatten.md +++ b/docs/commands/flatten.md @@ -18,7 +18,7 @@ Flatten the table. flatten a table ```shell -> [[N, u, s, h, e, l, l]] | flatten +> [[N, u, s, h, e, l, l]] | flatten ``` flatten a table, get the first item @@ -40,4 +40,3 @@ Flatten inner table ```shell > { a: b, d: [ 1 2 3 4 ], e: [ 4 3 ] } | flatten ``` - diff --git a/docs/commands/fmt.md b/docs/commands/fmt.md index fbd485b63e..12b3a5a114 100644 --- a/docs/commands/fmt.md +++ b/docs/commands/fmt.md @@ -16,4 +16,3 @@ format numbers ```shell > 42 | fmt ``` - diff --git a/docs/commands/for.md b/docs/commands/for.md index 97d59525d3..f6a2378036 100644 --- a/docs/commands/for.md +++ b/docs/commands/for.md @@ -33,4 +33,3 @@ Number each item and echo a message ```shell > for $it in ['bob' 'fred'] --numbered { $"($it.index) is ($it.item)" } ``` - diff --git a/docs/commands/format.md b/docs/commands/format.md index a6b4da7df0..9853ad6285 100644 --- a/docs/commands/format.md +++ b/docs/commands/format.md @@ -25,4 +25,3 @@ Print elements from some columns of a table ```shell > echo [[col1, col2]; [v1, v2] [v3, v4]] | format '{col2}' ``` - diff --git a/docs/commands/from.md b/docs/commands/from.md index 8d8216d24d..e1bb2d26b2 100644 --- a/docs/commands/from.md +++ b/docs/commands/from.md @@ -9,4 +9,3 @@ Parse a string or binary data into structured data ## Signature ```> from ``` - diff --git a/docs/commands/from_csv.md b/docs/commands/from_csv.md index b1e8ac55a6..fa26f8e0f9 100644 --- a/docs/commands/from_csv.md +++ b/docs/commands/from_csv.md @@ -36,4 +36,3 @@ Convert semicolon-separated data to a table ```shell > open data.txt | from csv --separator ';' ``` - diff --git a/docs/commands/from_eml.md b/docs/commands/from_eml.md index 78c0ffcbcb..efe727454e 100644 --- a/docs/commands/from_eml.md +++ b/docs/commands/from_eml.md @@ -33,4 +33,3 @@ To: someone@somewhere.com Test' | from eml -b 1 ``` - diff --git a/docs/commands/from_ics.md b/docs/commands/from_ics.md index 746fa89521..56edc02ed0 100644 --- a/docs/commands/from_ics.md +++ b/docs/commands/from_ics.md @@ -17,4 +17,3 @@ Converts ics formatted string to table > 'BEGIN:VCALENDAR END:VCALENDAR' | from ics ``` - diff --git a/docs/commands/from_ini.md b/docs/commands/from_ini.md index f0a390e483..dd6f04aa4f 100644 --- a/docs/commands/from_ini.md +++ b/docs/commands/from_ini.md @@ -18,4 +18,3 @@ Converts ini formatted string to table a=1 b=2' | from ini ``` - diff --git a/docs/commands/from_json.md b/docs/commands/from_json.md index b4bef77241..0ed7446d4c 100644 --- a/docs/commands/from_json.md +++ b/docs/commands/from_json.md @@ -18,11 +18,10 @@ Convert from json to structured data Converts json formatted string to table ```shell -> '{ a:1 }' | from json +> '{ "a": 1 }' | from json ``` Converts json formatted string to table ```shell -> '{ a:1, b: [1, 2] }' | from json +> '{ "a": 1, "b": [1, 2] }' | from json ``` - diff --git a/docs/commands/from_nuon.md b/docs/commands/from_nuon.md new file mode 100644 index 0000000000..071a3264d7 --- /dev/null +++ b/docs/commands/from_nuon.md @@ -0,0 +1,23 @@ +--- +title: from nuon +layout: command +version: 0.59.0 +--- + +Convert from nuon to structured data + +## Signature + +```> from nuon ``` + +## Examples + +Converts nuon formatted string to table +```shell +> '{ a:1 }' | from nuon +``` + +Converts nuon formatted string to table +```shell +> '{ a:1, b: [1, 2] }' | from nuon +``` diff --git a/docs/commands/from_ods.md b/docs/commands/from_ods.md index 8946d0d10a..7156eaa212 100644 --- a/docs/commands/from_ods.md +++ b/docs/commands/from_ods.md @@ -25,4 +25,3 @@ Convert binary .ods data to a table, specifying the tables ```shell > open test.txt | from ods -s [Spreadsheet1] ``` - diff --git a/docs/commands/from_ssv.md b/docs/commands/from_ssv.md index 8f2833a034..7100aa562a 100644 --- a/docs/commands/from_ssv.md +++ b/docs/commands/from_ssv.md @@ -29,4 +29,3 @@ Converts ssv formatted string to table but not treating the first row as column > 'FOO BAR 1 2' | from ssv -n ``` - diff --git a/docs/commands/from_toml.md b/docs/commands/from_toml.md index 2aeab4316c..bcea313214 100644 --- a/docs/commands/from_toml.md +++ b/docs/commands/from_toml.md @@ -22,4 +22,3 @@ Converts toml formatted string to table > 'a = 1 b = [1, 2]' | from toml ``` - diff --git a/docs/commands/from_tsv.md b/docs/commands/from_tsv.md index 9a7c493d04..84f1f7116b 100644 --- a/docs/commands/from_tsv.md +++ b/docs/commands/from_tsv.md @@ -14,3 +14,14 @@ Parse text as .tsv and create table. - `--noheaders`: don't treat the first row as column names +## Examples + +Create a tsv file with header columns and open it +```shell +> echo $'c1(char tab)c2(char tab)c3(char nl)1(char tab)2(char tab)3' | save tsv-data | open tsv-data | from tsv +``` + +Create a tsv file without header columns and open it +```shell +> echo $'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv -n +``` diff --git a/docs/commands/from_url.md b/docs/commands/from_url.md index c33ad5d359..391419feae 100644 --- a/docs/commands/from_url.md +++ b/docs/commands/from_url.md @@ -16,4 +16,3 @@ Convert url encoded string into a table ```shell > 'bread=baguette&cheese=comt%C3%A9&meat=ham&fat=butter' | from url ``` - diff --git a/docs/commands/from_vcf.md b/docs/commands/from_vcf.md index 92169f55e7..fb3d554509 100644 --- a/docs/commands/from_vcf.md +++ b/docs/commands/from_vcf.md @@ -20,4 +20,3 @@ FN:Bar EMAIL:foo@bar.com END:VCARD' | from vcf ``` - diff --git a/docs/commands/from_xlsx.md b/docs/commands/from_xlsx.md index fac03ebf2a..e45408c6e2 100644 --- a/docs/commands/from_xlsx.md +++ b/docs/commands/from_xlsx.md @@ -25,4 +25,3 @@ Convert binary .xlsx data to a table, specifying the tables ```shell > open test.txt | from xlsx -s [Spreadsheet1] ``` - diff --git a/docs/commands/from_xml.md b/docs/commands/from_xml.md index 51558afb66..61844e4aa7 100644 --- a/docs/commands/from_xml.md +++ b/docs/commands/from_xml.md @@ -19,4 +19,3 @@ Converts xml formatted string to table Event ' | from xml ``` - diff --git a/docs/commands/from_yaml.md b/docs/commands/from_yaml.md index 1ec63706b7..7ac7ec7b33 100644 --- a/docs/commands/from_yaml.md +++ b/docs/commands/from_yaml.md @@ -21,4 +21,3 @@ Converts yaml formatted string to table ```shell > '[ a: 1, b: [1, 2] ]' | from yaml ``` - diff --git a/docs/commands/from_yml.md b/docs/commands/from_yml.md index 31d2cb5a79..f177d69424 100644 --- a/docs/commands/from_yml.md +++ b/docs/commands/from_yml.md @@ -10,3 +10,14 @@ Parse text as .yaml/.yml and create table. ```> from yml ``` +## Examples + +Converts yaml formatted string to table +```shell +> 'a: 1' | from yaml +``` + +Converts yaml formatted string to table +```shell +> '[ a: 1, b: [1, 2] ]' | from yaml +``` diff --git a/docs/commands/g.md b/docs/commands/g.md index 54318ba7f3..f401242b9a 100644 --- a/docs/commands/g.md +++ b/docs/commands/g.md @@ -13,4 +13,3 @@ Switch to a given shell. ## Parameters - `shell_number`: shell number to change to - diff --git a/docs/commands/get.md b/docs/commands/get.md index 2dc145d66f..fb6be37424 100644 --- a/docs/commands/get.md +++ b/docs/commands/get.md @@ -37,4 +37,3 @@ Extract the cpu list from the sys information record ```shell > sys | get cpu ``` - diff --git a/docs/commands/grid.md b/docs/commands/grid.md index 5175f9d86d..85415c99a5 100644 --- a/docs/commands/grid.md +++ b/docs/commands/grid.md @@ -15,4 +15,3 @@ Renders the output to a textual terminal grid. - `--width {int}`: number of terminal columns wide (not output columns) - `--color`: draw output with color - `--separator {string}`: character to separate grid with - diff --git a/docs/commands/group-by.md b/docs/commands/group-by.md index b9407cc196..72c3f84a98 100644 --- a/docs/commands/group-by.md +++ b/docs/commands/group-by.md @@ -25,4 +25,3 @@ you can also group by raw values by leaving out the argument ```shell > echo ['1' '3' '1' '3' '2' '1' '1'] | group-by ``` - diff --git a/docs/commands/hash.md b/docs/commands/hash.md index 1384d9c54c..e01293b7b4 100644 --- a/docs/commands/hash.md +++ b/docs/commands/hash.md @@ -9,4 +9,3 @@ Apply hash function. ## Signature ```> hash ``` - diff --git a/docs/commands/hash_base64.md b/docs/commands/hash_base64.md index b7ceed25a7..f0ee5f3a27 100644 --- a/docs/commands/hash_base64.md +++ b/docs/commands/hash_base64.md @@ -34,4 +34,3 @@ Base64 decode a value ```shell > echo 'dXNlcm5hbWU6cGFzc3dvcmQ=' | hash base64 --decode ``` - diff --git a/docs/commands/hash_md5.md b/docs/commands/hash_md5.md index 2f5091770e..e992824dc0 100644 --- a/docs/commands/hash_md5.md +++ b/docs/commands/hash_md5.md @@ -25,4 +25,3 @@ md5 encode a file ```shell > open ./nu_0_24_1_windows.zip | hash md5 ``` - diff --git a/docs/commands/hash_sha256.md b/docs/commands/hash_sha256.md index 21acd0921f..73514b08ef 100644 --- a/docs/commands/hash_sha256.md +++ b/docs/commands/hash_sha256.md @@ -25,4 +25,3 @@ sha256 encode a file ```shell > open ./nu_0_24_1_windows.zip | hash sha256 ``` - diff --git a/docs/commands/headers.md b/docs/commands/headers.md index 8415786e56..3b24732ef0 100644 --- a/docs/commands/headers.md +++ b/docs/commands/headers.md @@ -21,4 +21,3 @@ Don't panic on rows with different headers ```shell > "a b c|1 2 3|1 2 3 4" | split row "|" | split column " " | headers ``` - diff --git a/docs/commands/help.md b/docs/commands/help.md index 8d66060a95..15a11ab592 100644 --- a/docs/commands/help.md +++ b/docs/commands/help.md @@ -41,4 +41,3 @@ search for string in command usage ```shell > help --find char ``` - diff --git a/docs/commands/hide.md b/docs/commands/hide.md index 644bebea83..85ce028f15 100644 --- a/docs/commands/hide.md +++ b/docs/commands/hide.md @@ -14,3 +14,19 @@ Hide symbols in the current scope - `pattern`: import pattern +## Examples + +Hide the alias just defined +```shell +> alias lll = ls -l; hide lll +``` + +Hide a custom command +```shell +> def say-hi [] { echo 'Hi!' }; hide say-hi +``` + +Hide an environment variable +```shell +> let-env HZ_ENV_ABC = 1; hide HZ_ENV_ABC; 'HZ_ENV_ABC' in (env).name +``` diff --git a/docs/commands/history.md b/docs/commands/history.md index 4da7c19080..79962ac4a7 100644 --- a/docs/commands/history.md +++ b/docs/commands/history.md @@ -14,3 +14,19 @@ Get the command history - `--clear`: Clears out the history entries +## Examples + +Get current history length +```shell +> history | length +``` + +Show last 5 commands you have ran +```shell +> history | last 5 +``` + +Search all the commands from history that contains 'cargo' +```shell +> history | wrap cmd | where cmd =~ cargo +``` diff --git a/docs/commands/if.md b/docs/commands/if.md index 4600dd1aa4..89fc68df03 100644 --- a/docs/commands/if.md +++ b/docs/commands/if.md @@ -32,4 +32,3 @@ Chain multiple if's together ```shell > if 5 < 3 { 'yes!' } else if 4 < 5 { 'no!' } else { 'okay!' } ``` - diff --git a/docs/commands/ignore.md b/docs/commands/ignore.md index 957912281c..58756bc1b4 100644 --- a/docs/commands/ignore.md +++ b/docs/commands/ignore.md @@ -16,4 +16,3 @@ Ignore the output of an echo command ```shell > echo done | ignore ``` - diff --git a/docs/commands/input.md b/docs/commands/input.md index 5862bc2bd2..08a9ac0b27 100644 --- a/docs/commands/input.md +++ b/docs/commands/input.md @@ -21,4 +21,3 @@ Get input from the user, and assign to a variable ```shell > let user-input = (input) ``` - diff --git a/docs/commands/insert.md b/docs/commands/insert.md index 41a26e52ec..6d19883a58 100644 --- a/docs/commands/insert.md +++ b/docs/commands/insert.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> insert ``` - diff --git a/docs/commands/into.md b/docs/commands/into.md index 9e59d44028..2ce3439248 100644 --- a/docs/commands/into.md +++ b/docs/commands/into.md @@ -9,4 +9,3 @@ Apply into function. ## Signature ```> into ``` - diff --git a/docs/commands/into_binary.md b/docs/commands/into_binary.md index 2157dd3748..3a547b1176 100644 --- a/docs/commands/into_binary.md +++ b/docs/commands/into_binary.md @@ -45,4 +45,3 @@ convert a decimal to a nushell binary primitive ```shell > 1.234 | into binary ``` - diff --git a/docs/commands/into_bool.md b/docs/commands/into_bool.md index 693a5cce89..f57dfe642b 100644 --- a/docs/commands/into_bool.md +++ b/docs/commands/into_bool.md @@ -40,4 +40,3 @@ convert string to boolean ```shell > 'true' | into bool ``` - diff --git a/docs/commands/into_datetime.md b/docs/commands/into_datetime.md index 310e04c837..c7bfdc671b 100644 --- a/docs/commands/into_datetime.md +++ b/docs/commands/into_datetime.md @@ -44,4 +44,3 @@ Convert timestamp (no larger than 8e+12) to datetime using a specified timezone ```shell > '1614434140' | into datetime -o +9 ``` - diff --git a/docs/commands/into_decimal.md b/docs/commands/into_decimal.md index e8d0fbc5f7..31cd066666 100644 --- a/docs/commands/into_decimal.md +++ b/docs/commands/into_decimal.md @@ -30,4 +30,3 @@ Convert decimal to integer ```shell > '-5.9' | into decimal ``` - diff --git a/docs/commands/into_filesize.md b/docs/commands/into_filesize.md index 25aa74b53c..52f004355d 100644 --- a/docs/commands/into_filesize.md +++ b/docs/commands/into_filesize.md @@ -40,4 +40,3 @@ Convert file size to filesize ```shell > 4KB | into filesize ``` - diff --git a/docs/commands/into_int.md b/docs/commands/into_int.md index a992dbf3df..7c36dfb47a 100644 --- a/docs/commands/into_int.md +++ b/docs/commands/into_int.md @@ -56,4 +56,3 @@ Convert to integer from hex ```shell > 'FF' | into int -r 16 ``` - diff --git a/docs/commands/into_string.md b/docs/commands/into_string.md index d6f036773f..ad5914b950 100644 --- a/docs/commands/into_string.md +++ b/docs/commands/into_string.md @@ -66,4 +66,3 @@ convert filesize to string ```shell > ls Cargo.toml | get size | into string ``` - diff --git a/docs/commands/keep.md b/docs/commands/keep.md index dfb5285567..d2e8aaed41 100644 --- a/docs/commands/keep.md +++ b/docs/commands/keep.md @@ -25,4 +25,3 @@ Keep the first value ```shell > echo [2 4 6 8] | keep ``` - diff --git a/docs/commands/keep_until.md b/docs/commands/keep_until.md index f5185f1f1d..3c0c8bc92a 100644 --- a/docs/commands/keep_until.md +++ b/docs/commands/keep_until.md @@ -20,4 +20,3 @@ Keep until the element is positive ```shell > echo [-1 -2 9 1] | keep until $it > 0 ``` - diff --git a/docs/commands/keep_while.md b/docs/commands/keep_while.md index 4a5fbf188e..28ae0ba074 100644 --- a/docs/commands/keep_while.md +++ b/docs/commands/keep_while.md @@ -20,4 +20,3 @@ Keep while the element is negative ```shell > echo [-1 -2 9 1] | keep while $it < 0 ``` - diff --git a/docs/commands/keybindings.md b/docs/commands/keybindings.md index db18538f5b..cccc886092 100644 --- a/docs/commands/keybindings.md +++ b/docs/commands/keybindings.md @@ -9,4 +9,3 @@ Keybindings related commands ## Signature ```> keybindings ``` - diff --git a/docs/commands/keybindings_default.md b/docs/commands/keybindings_default.md index 41d9bb49c0..7e923e054c 100644 --- a/docs/commands/keybindings_default.md +++ b/docs/commands/keybindings_default.md @@ -16,4 +16,3 @@ Get list with default keybindings ```shell > keybindings default ``` - diff --git a/docs/commands/keybindings_list.md b/docs/commands/keybindings_list.md index c66c3ae937..de4ed901c8 100644 --- a/docs/commands/keybindings_list.md +++ b/docs/commands/keybindings_list.md @@ -34,4 +34,3 @@ Get list with all the available options ```shell > keybindings list ``` - diff --git a/docs/commands/keybindings_listen.md b/docs/commands/keybindings_listen.md index 5916c7641e..438b165a12 100644 --- a/docs/commands/keybindings_listen.md +++ b/docs/commands/keybindings_listen.md @@ -16,4 +16,3 @@ Type and see key event codes ```shell > keybindings listen ``` - diff --git a/docs/commands/kill.md b/docs/commands/kill.md index 0f50614932..459075da03 100644 --- a/docs/commands/kill.md +++ b/docs/commands/kill.md @@ -34,4 +34,3 @@ Send INT signal ```shell > kill -s 2 12345 ``` - diff --git a/docs/commands/last.md b/docs/commands/last.md index 15f01a08c8..bcacef46a7 100644 --- a/docs/commands/last.md +++ b/docs/commands/last.md @@ -20,4 +20,3 @@ Get the last 2 items ```shell > [1,2,3] | last 2 ``` - diff --git a/docs/commands/length.md b/docs/commands/length.md index cf1f780f2a..9394399aae 100644 --- a/docs/commands/length.md +++ b/docs/commands/length.md @@ -25,4 +25,3 @@ Count the number of columns in the calendar table ```shell > cal | length -c ``` - diff --git a/docs/commands/let-env.md b/docs/commands/let-env.md index 80dda34bcb..e276678c97 100644 --- a/docs/commands/let-env.md +++ b/docs/commands/let-env.md @@ -21,4 +21,3 @@ Create an environment variable and display it ```shell > let-env MY_ENV_VAR = 1; $env.MY_ENV_VAR ``` - diff --git a/docs/commands/let.md b/docs/commands/let.md index ee931ea909..57b0309b60 100644 --- a/docs/commands/let.md +++ b/docs/commands/let.md @@ -31,4 +31,3 @@ Set a variable based on the condition ```shell > let x = if $false { -1 } else { 1 } ``` - diff --git a/docs/commands/lines.md b/docs/commands/lines.md index 735bcd6a15..748dfc1e5c 100644 --- a/docs/commands/lines.md +++ b/docs/commands/lines.md @@ -20,4 +20,3 @@ Split multi-line string into lines ```shell > echo $'two(char nl)lines' | lines ``` - diff --git a/docs/commands/load-env.md b/docs/commands/load-env.md index 27df1f6cef..41decc5c04 100644 --- a/docs/commands/load-env.md +++ b/docs/commands/load-env.md @@ -25,4 +25,3 @@ Load variables from an argument ```shell > load-env {NAME: ABE, AGE: UNKNOWN}; echo $env.NAME ``` - diff --git a/docs/commands/ls.md b/docs/commands/ls.md index 6dccfe59c2..deeff589cf 100644 --- a/docs/commands/ls.md +++ b/docs/commands/ls.md @@ -35,4 +35,3 @@ List all rust files ```shell > ls *.rs ``` - diff --git a/docs/commands/math.md b/docs/commands/math.md index 3359f4d665..0b7ce54682 100644 --- a/docs/commands/math.md +++ b/docs/commands/math.md @@ -9,4 +9,3 @@ Use mathematical functions as aggregate functions on a list of numbers or tables ## Signature ```> math ``` - diff --git a/docs/commands/math_abs.md b/docs/commands/math_abs.md index 8111e08344..da3314eb32 100644 --- a/docs/commands/math_abs.md +++ b/docs/commands/math_abs.md @@ -16,4 +16,3 @@ Get absolute of each value in a list of numbers ```shell > [-50 -100.0 25] | math abs ``` - diff --git a/docs/commands/math_avg.md b/docs/commands/math_avg.md index 4cb05c0ac6..29ac2c6afe 100644 --- a/docs/commands/math_avg.md +++ b/docs/commands/math_avg.md @@ -16,4 +16,3 @@ Get the average of a list of numbers ```shell > [-50 100.0 25] | math avg ``` - diff --git a/docs/commands/math_ceil.md b/docs/commands/math_ceil.md index 69de4ec4dd..14afa6a0dc 100644 --- a/docs/commands/math_ceil.md +++ b/docs/commands/math_ceil.md @@ -16,4 +16,3 @@ Apply the ceil function to a list of numbers ```shell > [1.5 2.3 -3.1] | math ceil ``` - diff --git a/docs/commands/math_eval.md b/docs/commands/math_eval.md index 11618a26ae..58073faa3c 100644 --- a/docs/commands/math_eval.md +++ b/docs/commands/math_eval.md @@ -20,4 +20,3 @@ Evalulate math in the pipeline ```shell > '10 / 4' | math eval ``` - diff --git a/docs/commands/math_floor.md b/docs/commands/math_floor.md index 298850d170..c043dbbc8b 100644 --- a/docs/commands/math_floor.md +++ b/docs/commands/math_floor.md @@ -16,4 +16,3 @@ Apply the floor function to a list of numbers ```shell > [1.5 2.3 -3.1] | math floor ``` - diff --git a/docs/commands/math_max.md b/docs/commands/math_max.md index e9840fe09e..75ec8cca8e 100644 --- a/docs/commands/math_max.md +++ b/docs/commands/math_max.md @@ -16,4 +16,3 @@ Find the maximum of list of numbers ```shell > [-50 100 25] | math max ``` - diff --git a/docs/commands/math_median.md b/docs/commands/math_median.md index 7b1dde9203..5b8024b3de 100644 --- a/docs/commands/math_median.md +++ b/docs/commands/math_median.md @@ -16,4 +16,3 @@ Get the median of a list of numbers ```shell > [3 8 9 12 12 15] | math median ``` - diff --git a/docs/commands/math_min.md b/docs/commands/math_min.md index 448d624c52..2ae18c4f6e 100644 --- a/docs/commands/math_min.md +++ b/docs/commands/math_min.md @@ -16,4 +16,3 @@ Get the minimum of a list of numbers ```shell > [-50 100 25] | math min ``` - diff --git a/docs/commands/math_mode.md b/docs/commands/math_mode.md index 338e96b642..b79775b725 100644 --- a/docs/commands/math_mode.md +++ b/docs/commands/math_mode.md @@ -16,4 +16,3 @@ Get the mode(s) of a list of numbers ```shell > [3 3 9 12 12 15] | math mode ``` - diff --git a/docs/commands/math_product.md b/docs/commands/math_product.md index b6633a8850..013920121e 100644 --- a/docs/commands/math_product.md +++ b/docs/commands/math_product.md @@ -16,4 +16,3 @@ Get the product of a list of numbers ```shell > [2 3 3 4] | math product ``` - diff --git a/docs/commands/math_round.md b/docs/commands/math_round.md index ac1a1b4756..46b3bce1d7 100644 --- a/docs/commands/math_round.md +++ b/docs/commands/math_round.md @@ -25,4 +25,3 @@ Apply the round function with precision specified ```shell > [1.555 2.333 -3.111] | math round -p 2 ``` - diff --git a/docs/commands/math_sqrt.md b/docs/commands/math_sqrt.md index b1ce577086..bd8f92e3f7 100644 --- a/docs/commands/math_sqrt.md +++ b/docs/commands/math_sqrt.md @@ -16,4 +16,3 @@ Apply the square root function to a list of numbers ```shell > [9 16] | math sqrt ``` - diff --git a/docs/commands/math_stddev.md b/docs/commands/math_stddev.md index cae8a1da22..a7df587553 100644 --- a/docs/commands/math_stddev.md +++ b/docs/commands/math_stddev.md @@ -25,4 +25,3 @@ Get the sample stddev of a list of numbers ```shell > [1 2 3 4 5] | math stddev -s ``` - diff --git a/docs/commands/math_sum.md b/docs/commands/math_sum.md index 02cff30272..a9f19f5077 100644 --- a/docs/commands/math_sum.md +++ b/docs/commands/math_sum.md @@ -21,4 +21,3 @@ Get the disk usage for the current directory ```shell > ls | get size | math sum ``` - diff --git a/docs/commands/math_variance.md b/docs/commands/math_variance.md index 8d6130918a..b81f2dee10 100644 --- a/docs/commands/math_variance.md +++ b/docs/commands/math_variance.md @@ -25,4 +25,3 @@ Get the sample variance of a list of numbers ```shell > [1 2 3 4 5] | math variance -s ``` - diff --git a/docs/commands/merge.md b/docs/commands/merge.md index fd29c91681..e6341c3ce2 100644 --- a/docs/commands/merge.md +++ b/docs/commands/merge.md @@ -25,4 +25,3 @@ Merge two records ```shell > {a: 1, b: 2} | merge { {c: 3} } ``` - diff --git a/docs/commands/metadata.md b/docs/commands/metadata.md index 311d384cf9..d155e97686 100644 --- a/docs/commands/metadata.md +++ b/docs/commands/metadata.md @@ -25,4 +25,3 @@ Get the metadata of the input ```shell > ls | metadata ``` - diff --git a/docs/commands/mkdir.md b/docs/commands/mkdir.md index 2090042cd5..145aeae595 100644 --- a/docs/commands/mkdir.md +++ b/docs/commands/mkdir.md @@ -26,4 +26,3 @@ Make multiple directories and show the paths created ```shell > mkdir -s foo/bar foo2 ``` - diff --git a/docs/commands/module.md b/docs/commands/module.md index a3498ee0a5..46829d4bb8 100644 --- a/docs/commands/module.md +++ b/docs/commands/module.md @@ -15,3 +15,19 @@ Define a custom module - `module_name`: module name - `block`: body of the module +## Examples + +Define a custom command in a module and call it +```shell +> module spam { export def foo [] { "foo" } }; use spam foo; foo +``` + +Define an environment variable in a module and evaluate it +```shell +> module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV +``` + +Define a custom command that participates in the environment in a module and call it +```shell +> module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR +``` diff --git a/docs/commands/move.md b/docs/commands/move.md index 392c31e0d5..99b0596f43 100644 --- a/docs/commands/move.md +++ b/docs/commands/move.md @@ -32,4 +32,3 @@ Move columns of a record ```shell > { name: foo, value: a, index: 1 } | move name --before index ``` - diff --git a/docs/commands/mv.md b/docs/commands/mv.md index 4403147cf5..0228223231 100644 --- a/docs/commands/mv.md +++ b/docs/commands/mv.md @@ -31,4 +31,3 @@ Move many files into a directory ```shell > mv *.txt my/subdirectory ``` - diff --git a/docs/commands/n.md b/docs/commands/n.md index 4929de276b..ae7d7ec833 100644 --- a/docs/commands/n.md +++ b/docs/commands/n.md @@ -9,4 +9,3 @@ Switch to the next shell. ## Signature ```> n ``` - diff --git a/docs/commands/nth.md b/docs/commands/nth.md index 3e89bdcd1c..a38304fc34 100644 --- a/docs/commands/nth.md +++ b/docs/commands/nth.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> nth ``` - diff --git a/docs/commands/nu-highlight.md b/docs/commands/nu-highlight.md index cab86185cc..17e71d2728 100644 --- a/docs/commands/nu-highlight.md +++ b/docs/commands/nu-highlight.md @@ -16,4 +16,3 @@ Describe the type of a string ```shell > 'let x = 3' | nu-highlight ``` - diff --git a/docs/commands/open.md b/docs/commands/open.md index ccc4e0824b..a2cdcd9341 100644 --- a/docs/commands/open.md +++ b/docs/commands/open.md @@ -31,4 +31,3 @@ Open a file, using the input to get filename ```shell > echo 'myfile.txt' | open ``` - diff --git a/docs/commands/p.md b/docs/commands/p.md index da7c5c2130..750419827c 100644 --- a/docs/commands/p.md +++ b/docs/commands/p.md @@ -9,4 +9,3 @@ Switch to the previous shell. ## Signature ```> p ``` - diff --git a/docs/commands/par-each.md b/docs/commands/par-each.md index 9e58ce7ab7..8cc3dcfa9a 100644 --- a/docs/commands/par-each.md +++ b/docs/commands/par-each.md @@ -21,4 +21,3 @@ Multiplies elements in list ```shell > [1 2 3] | par-each { |it| 2 * $it } ``` - diff --git a/docs/commands/par-each_group.md b/docs/commands/par-each_group.md index a64bcb4923..9197a8f7f6 100644 --- a/docs/commands/par-each_group.md +++ b/docs/commands/par-each_group.md @@ -21,4 +21,3 @@ Multiplies elements in list ```shell > echo [1 2 3 4] | par-each group 2 { $it.0 + $it.1 } ``` - diff --git a/docs/commands/parse.md b/docs/commands/parse.md index fc48bee36f..aa6b74610c 100644 --- a/docs/commands/parse.md +++ b/docs/commands/parse.md @@ -26,4 +26,3 @@ Parse a string using regex pattern ```shell > echo "hi there" | parse -r "(?P\w+) (?P\w+)" ``` - diff --git a/docs/commands/path.md b/docs/commands/path.md index 8942d4d1b6..6b7f7110bb 100644 --- a/docs/commands/path.md +++ b/docs/commands/path.md @@ -9,4 +9,3 @@ Explore and manipulate paths. ## Signature ```> path ``` - diff --git a/docs/commands/path_basename.md b/docs/commands/path_basename.md index a1d3026dc2..f090d20a32 100644 --- a/docs/commands/path_basename.md +++ b/docs/commands/path_basename.md @@ -31,4 +31,3 @@ Replace basename of a path ```shell > '/home/joe/test.txt' | path basename -r 'spam.png' ``` - diff --git a/docs/commands/path_dirname.md b/docs/commands/path_dirname.md index 98402b302f..bc175774b1 100644 --- a/docs/commands/path_dirname.md +++ b/docs/commands/path_dirname.md @@ -37,4 +37,3 @@ Replace the part that would be returned with a custom path ```shell > '/home/joe/code/test.txt' | path dirname -n 2 -r /home/viking ``` - diff --git a/docs/commands/path_exists.md b/docs/commands/path_exists.md index 73e4c5275c..16a3eb6c45 100644 --- a/docs/commands/path_exists.md +++ b/docs/commands/path_exists.md @@ -25,4 +25,3 @@ Check if a file exists in a column ```shell > ls | path exists -c [ name ] ``` - diff --git a/docs/commands/path_expand.md b/docs/commands/path_expand.md index 5525e5ccf2..a042a211cb 100644 --- a/docs/commands/path_expand.md +++ b/docs/commands/path_expand.md @@ -31,4 +31,3 @@ Expand a relative path ```shell > 'foo/../bar' | path expand ``` - diff --git a/docs/commands/path_join.md b/docs/commands/path_join.md index b1645ed975..5f3e908ab6 100644 --- a/docs/commands/path_join.md +++ b/docs/commands/path_join.md @@ -36,4 +36,3 @@ Join a structured path into a path ```shell > [[ parent stem extension ]; [ '/home/viking' 'spam' 'txt' ]] | path join ``` - diff --git a/docs/commands/path_parse.md b/docs/commands/path_parse.md index bfc6662bc3..908052dd4b 100644 --- a/docs/commands/path_parse.md +++ b/docs/commands/path_parse.md @@ -36,4 +36,3 @@ Parse all paths under the 'name' column ```shell > ls | path parse -c [ name ] ``` - diff --git a/docs/commands/path_relative-to.md b/docs/commands/path_relative-to.md index a30d7ff01e..cc300ffde2 100644 --- a/docs/commands/path_relative-to.md +++ b/docs/commands/path_relative-to.md @@ -31,4 +31,3 @@ Find a relative path from two relative paths ```shell > 'eggs/bacon/sausage/spam' | path relative-to 'eggs/bacon/sausage' ``` - diff --git a/docs/commands/path_split.md b/docs/commands/path_split.md index 937ad40485..a62a94ff9b 100644 --- a/docs/commands/path_split.md +++ b/docs/commands/path_split.md @@ -25,4 +25,3 @@ Split all paths under the 'name' column ```shell > ls ('.' | path expand) | path split -c [ name ] ``` - diff --git a/docs/commands/path_type.md b/docs/commands/path_type.md index 629931d5d6..1e11d97d22 100644 --- a/docs/commands/path_type.md +++ b/docs/commands/path_type.md @@ -25,4 +25,3 @@ Show type of a filepath in a column ```shell > ls | path type -c [ name ] ``` - diff --git a/docs/commands/pivot.md b/docs/commands/pivot.md index e3cefc9554..5400dfeb2f 100644 --- a/docs/commands/pivot.md +++ b/docs/commands/pivot.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> pivot ``` - diff --git a/docs/commands/post.md b/docs/commands/post.md index a4fd8956d8..3474eb6c08 100644 --- a/docs/commands/post.md +++ b/docs/commands/post.md @@ -18,7 +18,7 @@ Post a body to a URL (HTTP POST operation). - `--password {any}`: the password when authenticating - `--content-type {any}`: the MIME type of content to post - `--content-length {any}`: the length of the content being posted - - `--headers {any}`: custom headers you want to add + - `--headers {any}`: custom headers you want to add - `--raw`: return values as a string instead of a table - `--insecure`: allow insecure server connections when using SSL @@ -38,4 +38,3 @@ Post content to url.com, with custom header ```shell > post -H [my-header-key my-header-value] url.com ``` - diff --git a/docs/commands/prepend.md b/docs/commands/prepend.md index 6f40704393..26b6ee602b 100644 --- a/docs/commands/prepend.md +++ b/docs/commands/prepend.md @@ -30,4 +30,3 @@ Prepend Ints and Strings ```shell > [2,nu,4,shell] | prepend [0,1,rocks] ``` - diff --git a/docs/commands/print.md b/docs/commands/print.md index f983380a94..9edb18013c 100644 --- a/docs/commands/print.md +++ b/docs/commands/print.md @@ -25,4 +25,3 @@ Print the sum of 2 and 3 ```shell > print (2 + 3) ``` - diff --git a/docs/commands/ps.md b/docs/commands/ps.md index 1b121edbd5..a50e407db4 100644 --- a/docs/commands/ps.md +++ b/docs/commands/ps.md @@ -20,4 +20,3 @@ List the system processes ```shell > ps ``` - diff --git a/docs/commands/random.md b/docs/commands/random.md index 7e0bdfd9ad..df8b3e8618 100644 --- a/docs/commands/random.md +++ b/docs/commands/random.md @@ -9,4 +9,3 @@ Generate a random values. ## Signature ```> random ``` - diff --git a/docs/commands/random_bool.md b/docs/commands/random_bool.md index 068c9d0162..f62162a3f8 100644 --- a/docs/commands/random_bool.md +++ b/docs/commands/random_bool.md @@ -25,4 +25,3 @@ Generate a random boolean value with a 75% chance of "true" ```shell > random bool --bias 0.75 ``` - diff --git a/docs/commands/random_chars.md b/docs/commands/random_chars.md index 894a7ae0c1..e2b5079a06 100644 --- a/docs/commands/random_chars.md +++ b/docs/commands/random_chars.md @@ -25,4 +25,3 @@ Generate random chars with specified length ```shell > random chars -l 20 ``` - diff --git a/docs/commands/random_decimal.md b/docs/commands/random_decimal.md index fdf224eed2..b7ba191a8f 100644 --- a/docs/commands/random_decimal.md +++ b/docs/commands/random_decimal.md @@ -35,4 +35,3 @@ Generate a random decimal between 1.0 and 1.1 ```shell > random decimal 1.0..1.1 ``` - diff --git a/docs/commands/random_dice.md b/docs/commands/random_dice.md index e1fd1fcc69..b7a5e98f6d 100644 --- a/docs/commands/random_dice.md +++ b/docs/commands/random_dice.md @@ -26,4 +26,3 @@ Roll 10 dice with 12 sides each ```shell > random dice -d 10 -s 12 ``` - diff --git a/docs/commands/random_integer.md b/docs/commands/random_integer.md index dfd1e7e0b4..d83f1dcc48 100644 --- a/docs/commands/random_integer.md +++ b/docs/commands/random_integer.md @@ -35,4 +35,3 @@ Generate a random integer between 1 and 10 ```shell > random integer 1..10 ``` - diff --git a/docs/commands/random_uuid.md b/docs/commands/random_uuid.md index caeb52881f..ed81c1d354 100644 --- a/docs/commands/random_uuid.md +++ b/docs/commands/random_uuid.md @@ -16,4 +16,3 @@ Generate a random uuid4 string ```shell > random uuid ``` - diff --git a/docs/commands/range.md b/docs/commands/range.md index d005e7b260..7c6fb365c5 100644 --- a/docs/commands/range.md +++ b/docs/commands/range.md @@ -30,4 +30,3 @@ Get the next to last 2 items ```shell > [0,1,2,3,4,5] | range (-3)..-2 ``` - diff --git a/docs/commands/reduce.md b/docs/commands/reduce.md index 162b592f6c..7fd9860a65 100644 --- a/docs/commands/reduce.md +++ b/docs/commands/reduce.md @@ -43,4 +43,3 @@ Find the longest string and its index } } ``` - diff --git a/docs/commands/register.md b/docs/commands/register.md index f6e59064d2..9deff8d9fe 100644 --- a/docs/commands/register.md +++ b/docs/commands/register.md @@ -17,3 +17,14 @@ Register a plugin - `--encoding {string}`: Encoding used to communicate with plugin. Options: [capnp, json] - `--shell {path}`: path of shell used to run plugin (cmd, sh, python, etc) +## Examples + +Register `nu_plugin_extra_query` plugin from ~/.cargo/bin/ dir +```shell +> register -e capnp ~/.cargo/bin/nu_plugin_extra_query +``` + +Register `nu_plugin_extra_query` plugin from `nu -c`(plugin will be available in that nu session only) +```shell +> let plugin = ((which nu).path.0 | path dirname | path join 'nu_plugin_extra_query'); nu -c $'register -e capnp ($plugin); version' +``` diff --git a/docs/commands/reject.md b/docs/commands/reject.md index e7cd2881ee..259a72c499 100644 --- a/docs/commands/reject.md +++ b/docs/commands/reject.md @@ -25,4 +25,3 @@ Reject the specified field in a record ```shell > echo {a: 1, b: 2} | reject a ``` - diff --git a/docs/commands/rename.md b/docs/commands/rename.md index d5f0f2e9e4..f8a37e2a87 100644 --- a/docs/commands/rename.md +++ b/docs/commands/rename.md @@ -31,4 +31,3 @@ Rename a specific column ```shell > [[a, b, c]; [1, 2, 3]] | rename -c [a ham] ``` - diff --git a/docs/commands/reverse.md b/docs/commands/reverse.md index d3e4678676..1735a900b1 100644 --- a/docs/commands/reverse.md +++ b/docs/commands/reverse.md @@ -16,4 +16,3 @@ Reverse the items ```shell > [0,1,2,3] | reverse ``` - diff --git a/docs/commands/rm.md b/docs/commands/rm.md index 639ddf1e5c..136ca85023 100644 --- a/docs/commands/rm.md +++ b/docs/commands/rm.md @@ -40,4 +40,3 @@ Delete a file, and suppress errors if no file is found ```shell > rm --force file.txt ``` - diff --git a/docs/commands/roll.md b/docs/commands/roll.md index d51ac1fcce..c57f4c9a45 100644 --- a/docs/commands/roll.md +++ b/docs/commands/roll.md @@ -9,4 +9,3 @@ Rolling commands for tables ## Signature ```> roll ``` - diff --git a/docs/commands/roll_down.md b/docs/commands/roll_down.md index 93c1f680ae..b8b149c41a 100644 --- a/docs/commands/roll_down.md +++ b/docs/commands/roll_down.md @@ -20,4 +20,3 @@ Rolls rows down ```shell > [[a b]; [1 2] [3 4] [5 6]] | roll down ``` - diff --git a/docs/commands/roll_left.md b/docs/commands/roll_left.md index 2fb196910b..b8ec384ca3 100644 --- a/docs/commands/roll_left.md +++ b/docs/commands/roll_left.md @@ -26,4 +26,3 @@ Rolls columns to the left with fixed headers ```shell > [[a b c]; [1 2 3] [4 5 6]] | roll left --cells-only ``` - diff --git a/docs/commands/roll_right.md b/docs/commands/roll_right.md index d7e7c38750..74a1797236 100644 --- a/docs/commands/roll_right.md +++ b/docs/commands/roll_right.md @@ -26,4 +26,3 @@ Rolls columns to the right with fixed headers ```shell > [[a b c]; [1 2 3] [4 5 6]] | roll right --cells-only ``` - diff --git a/docs/commands/roll_up.md b/docs/commands/roll_up.md index 7508717266..1923c1a9c4 100644 --- a/docs/commands/roll_up.md +++ b/docs/commands/roll_up.md @@ -20,4 +20,3 @@ Rolls rows up ```shell > [[a b]; [1 2] [3 4] [5 6]] | roll up ``` - diff --git a/docs/commands/rotate.md b/docs/commands/rotate.md index 2b1d441df1..a749453b5b 100644 --- a/docs/commands/rotate.md +++ b/docs/commands/rotate.md @@ -46,4 +46,3 @@ Rotate table counter-clockwise and change columns names ```shell > [[a b]; [1 2]] | rotate --ccw col_a col_b ``` - diff --git a/docs/commands/run-external.md b/docs/commands/run-external.md index 292c1ccc5d..1e740cff6b 100644 --- a/docs/commands/run-external.md +++ b/docs/commands/run-external.md @@ -14,4 +14,3 @@ Runs external command - `...rest`: external command to run - `--last-expression`: last-expression - diff --git a/docs/commands/save.md b/docs/commands/save.md index d103d470eb..aa0cb84c8c 100644 --- a/docs/commands/save.md +++ b/docs/commands/save.md @@ -13,5 +13,16 @@ Save a file. ## Parameters - `filename`: the filename to use - - `--raw`: open file as raw binary + - `--raw`: save file as raw binary +## Examples + +Save a string to foo.txt in current directory +```shell +> echo 'save me' | save foo.txt +``` + +Save a record to foo.json in current directory +```shell +> echo { a: 1, b: 2 } | save foo.json +``` diff --git a/docs/commands/select.md b/docs/commands/select.md index 3837449607..1a629f2aff 100644 --- a/docs/commands/select.md +++ b/docs/commands/select.md @@ -25,4 +25,3 @@ Select the name and size columns ```shell > ls | select name size ``` - diff --git a/docs/commands/seq.md b/docs/commands/seq.md index 3226070dff..49a1590fe1 100644 --- a/docs/commands/seq.md +++ b/docs/commands/seq.md @@ -43,4 +43,3 @@ sequence 1 to 10 with pipe separator padded by 2s ```shell > seq -s ' | ' -w 1 2 10 ``` - diff --git a/docs/commands/seq_date.md b/docs/commands/seq_date.md index 8e0659e2b0..65b7f19aa9 100644 --- a/docs/commands/seq_date.md +++ b/docs/commands/seq_date.md @@ -52,4 +52,3 @@ starting on May 5th, 2020, print the next 10 days in your locale's date format, ```shell > seq date -o %x -s ':' -d 10 -b '2020-05-01' ``` - diff --git a/docs/commands/shells.md b/docs/commands/shells.md index 74c2999d90..0cb8b3ea47 100644 --- a/docs/commands/shells.md +++ b/docs/commands/shells.md @@ -9,4 +9,3 @@ Lists all open shells. ## Signature ```> shells ``` - diff --git a/docs/commands/shuffle.md b/docs/commands/shuffle.md index f6c072bc7b..3460fdcd28 100644 --- a/docs/commands/shuffle.md +++ b/docs/commands/shuffle.md @@ -10,3 +10,9 @@ Shuffle rows randomly. ```> shuffle ``` +## Examples + +Shuffle rows randomly (execute it several times and see the difference) +```shell +> echo [[version patch]; [1.0.0 $false] [3.0.1 $true] [2.0.0 $false]] | shuffle +``` diff --git a/docs/commands/size.md b/docs/commands/size.md index cc21f7a025..651b5db6ac 100644 --- a/docs/commands/size.md +++ b/docs/commands/size.md @@ -21,4 +21,3 @@ Counts Unicode characters correctly in a string ```shell > "Amélie Amelie" | size ``` - diff --git a/docs/commands/skip.md b/docs/commands/skip.md index 16ef0f2b7b..abf7180448 100644 --- a/docs/commands/skip.md +++ b/docs/commands/skip.md @@ -25,4 +25,3 @@ Skip the first value ```shell > echo [2 4 6 8] | skip ``` - diff --git a/docs/commands/skip_until.md b/docs/commands/skip_until.md index 711d935643..7d3545dd52 100644 --- a/docs/commands/skip_until.md +++ b/docs/commands/skip_until.md @@ -20,4 +20,3 @@ Skip until the element is positive ```shell > echo [-2 0 2 -1] | skip until $it > 0 ``` - diff --git a/docs/commands/skip_while.md b/docs/commands/skip_while.md index 8a3c1d65df..9fed5b0dcc 100644 --- a/docs/commands/skip_while.md +++ b/docs/commands/skip_while.md @@ -20,4 +20,3 @@ Skip while the element is negative ```shell > echo [-2 0 2 -1] | skip while $it < 0 ``` - diff --git a/docs/commands/sleep.md b/docs/commands/sleep.md index 1aaa6a79e3..84f65c40ba 100644 --- a/docs/commands/sleep.md +++ b/docs/commands/sleep.md @@ -31,4 +31,3 @@ Send output after 1sec ```shell > sleep 1sec; echo done ``` - diff --git a/docs/commands/sort-by.md b/docs/commands/sort-by.md index de74addf60..e7fc0a5758 100644 --- a/docs/commands/sort-by.md +++ b/docs/commands/sort-by.md @@ -47,4 +47,3 @@ Sort strings (reversed case-insensitive) ```shell > echo [airplane Truck Car] | sort-by -i -r ``` - diff --git a/docs/commands/source.md b/docs/commands/source.md index 4ce9c438ce..96dc47d5c0 100644 --- a/docs/commands/source.md +++ b/docs/commands/source.md @@ -14,3 +14,19 @@ Runs a script file in the current context. - `filename`: the filepath to the script file to source +## Examples + +Runs foo.nu in the current context +```shell +> source foo.nu +``` + +Runs foo.nu in current context and call the command defined, suppose foo.nu has content: `def say-hi [] { echo 'Hi!' }` +```shell +> source ./foo.nu; say-hi +``` + +Runs foo.nu in current context and call the `main` command automatically, suppose foo.nu has content: `def main [] { echo 'Hi!' }` +```shell +> source ./foo.nu +``` diff --git a/docs/commands/split-by.md b/docs/commands/split-by.md index 3c95339340..8303343c7c 100644 --- a/docs/commands/split-by.md +++ b/docs/commands/split-by.md @@ -18,7 +18,7 @@ Create a new table splitted. split items by column named "lang" ```shell -> +> { '2019': [ { name: 'andres', lang: 'rb', year: '2019' }, @@ -28,6 +28,5 @@ split items by column named "lang" { name: 'storm', lang: 'rs', 'year': '2021' } ] } | split-by lang - + ``` - diff --git a/docs/commands/split.md b/docs/commands/split.md index c8816f8cb8..1cbd152df7 100644 --- a/docs/commands/split.md +++ b/docs/commands/split.md @@ -9,4 +9,3 @@ Split contents across desired subcommand (like row, column) via the separator. ## Signature ```> split ``` - diff --git a/docs/commands/split_chars.md b/docs/commands/split_chars.md index d8b755a756..b580cca2c8 100644 --- a/docs/commands/split_chars.md +++ b/docs/commands/split_chars.md @@ -16,4 +16,3 @@ Split the string's characters into separate rows ```shell > 'hello' | split chars ``` - diff --git a/docs/commands/split_column.md b/docs/commands/split_column.md index c535b7b9a9..b19905b45b 100644 --- a/docs/commands/split_column.md +++ b/docs/commands/split_column.md @@ -27,4 +27,3 @@ Split a string into columns of char and remove the empty columns ```shell > echo 'abc' | split column -c '' ``` - diff --git a/docs/commands/split_row.md b/docs/commands/split_row.md index 9ccba2eafa..3f61a2ed8e 100644 --- a/docs/commands/split_row.md +++ b/docs/commands/split_row.md @@ -25,4 +25,3 @@ Split a string into rows by the specified separator ```shell > echo 'a--b--c' | split row '--' ``` - diff --git a/docs/commands/str.md b/docs/commands/str.md index 55fc906d22..4d7cc8d13c 100644 --- a/docs/commands/str.md +++ b/docs/commands/str.md @@ -9,4 +9,3 @@ Various commands for working with string data. ## Signature ```> str ``` - diff --git a/docs/commands/str_camel-case.md b/docs/commands/str_camel-case.md index 441ceb0e03..48b1d34e5b 100644 --- a/docs/commands/str_camel-case.md +++ b/docs/commands/str_camel-case.md @@ -35,4 +35,3 @@ convert a column from a table to camelCase ```shell > [[lang, gems]; [nu_test, 100]] | str camel-case lang ``` - diff --git a/docs/commands/str_capitalize.md b/docs/commands/str_capitalize.md index 76bc30763f..76d7ce1ec8 100644 --- a/docs/commands/str_capitalize.md +++ b/docs/commands/str_capitalize.md @@ -30,4 +30,3 @@ Capitalize a column in a table ```shell > [[lang, gems]; [nu_test, 100]] | str capitalize lang ``` - diff --git a/docs/commands/str_collect.md b/docs/commands/str_collect.md index d36303e5a0..a46d4fe9d4 100644 --- a/docs/commands/str_collect.md +++ b/docs/commands/str_collect.md @@ -25,4 +25,3 @@ Create a string from input with a separator ```shell > ['nu', 'shell'] | str collect '-' ``` - diff --git a/docs/commands/str_contains.md b/docs/commands/str_contains.md index 38ec794dba..b07a69faf5 100644 --- a/docs/commands/str_contains.md +++ b/docs/commands/str_contains.md @@ -47,4 +47,3 @@ Check if string contains pattern ```shell > 'hello' | str contains 'banana' ``` - diff --git a/docs/commands/str_downcase.md b/docs/commands/str_downcase.md index 37b136cda7..329c84a7cd 100644 --- a/docs/commands/str_downcase.md +++ b/docs/commands/str_downcase.md @@ -35,4 +35,3 @@ Downcase contents ```shell > [[ColA ColB]; [Test ABC]] | str downcase ColA ColB ``` - diff --git a/docs/commands/str_ends-with.md b/docs/commands/str_ends-with.md index 2624a53cb8..3b30bc6967 100644 --- a/docs/commands/str_ends-with.md +++ b/docs/commands/str_ends-with.md @@ -26,4 +26,3 @@ Checks if string ends with '.txt' pattern ```shell > 'my_library.rb' | str ends-with '.txt' ``` - diff --git a/docs/commands/str_find-replace.md b/docs/commands/str_find-replace.md index 5ec8de2f12..15784fea49 100644 --- a/docs/commands/str_find-replace.md +++ b/docs/commands/str_find-replace.md @@ -33,4 +33,3 @@ Find and replace all occurrences of find string in table ```shell > [[ColA ColB ColC]; [abc abc ads]] | str find-replace -a 'b' 'z' ColA ColC ``` - diff --git a/docs/commands/str_index-of.md b/docs/commands/str_index-of.md index 4a359d60b4..4358bf825a 100644 --- a/docs/commands/str_index-of.md +++ b/docs/commands/str_index-of.md @@ -48,4 +48,3 @@ Returns index of pattern in string ```shell > '/this/is/some/path/file.txt' | str index-of '/' -e ``` - diff --git a/docs/commands/str_kebab-case.md b/docs/commands/str_kebab-case.md index 10bb15fdda..9a29f97a50 100644 --- a/docs/commands/str_kebab-case.md +++ b/docs/commands/str_kebab-case.md @@ -35,4 +35,3 @@ convert a column from a table to kebab-case ```shell > [[lang, gems]; [nuTest, 100]] | str kebab-case lang ``` - diff --git a/docs/commands/str_length.md b/docs/commands/str_length.md index eed64053e5..d0ff21e1a6 100644 --- a/docs/commands/str_length.md +++ b/docs/commands/str_length.md @@ -25,4 +25,3 @@ Return the lengths of multiple strings ```shell > ['hi' 'there'] | str length ``` - diff --git a/docs/commands/str_lpad.md b/docs/commands/str_lpad.md index 179a6d6bfe..367b6c7434 100644 --- a/docs/commands/str_lpad.md +++ b/docs/commands/str_lpad.md @@ -37,4 +37,3 @@ Use lpad to pad Unicode ```shell > '▉' | str lpad -l 10 -c '▉' ``` - diff --git a/docs/commands/str_pascal-case.md b/docs/commands/str_pascal-case.md index 0d4f63c99b..4d7909c555 100644 --- a/docs/commands/str_pascal-case.md +++ b/docs/commands/str_pascal-case.md @@ -35,4 +35,3 @@ convert a column from a table to PascalCase ```shell > [[lang, gems]; [nu_test, 100]] | str pascal-case lang ``` - diff --git a/docs/commands/str_reverse.md b/docs/commands/str_reverse.md index 1f0233d972..09a322e57b 100644 --- a/docs/commands/str_reverse.md +++ b/docs/commands/str_reverse.md @@ -20,4 +20,3 @@ Return the reversals of multiple strings ```shell > 'Nushell' | str reverse ``` - diff --git a/docs/commands/str_rpad.md b/docs/commands/str_rpad.md index 4e63eb93e0..baefe1a1b4 100644 --- a/docs/commands/str_rpad.md +++ b/docs/commands/str_rpad.md @@ -37,4 +37,3 @@ Use rpad to pad Unicode ```shell > '▉' | str rpad -l 10 -c '▉' ``` - diff --git a/docs/commands/str_screaming-snake-case.md b/docs/commands/str_screaming-snake-case.md index 9b76d51950..2a1b1d7247 100644 --- a/docs/commands/str_screaming-snake-case.md +++ b/docs/commands/str_screaming-snake-case.md @@ -35,4 +35,3 @@ convert a column from a table to SCREAMING_SNAKE_CASE ```shell > [[lang, gems]; [nu_test, 100]] | str screaming-snake-case lang ``` - diff --git a/docs/commands/str_snake-case.md b/docs/commands/str_snake-case.md index 18ffe134c0..6af782bc89 100644 --- a/docs/commands/str_snake-case.md +++ b/docs/commands/str_snake-case.md @@ -35,4 +35,3 @@ convert a column from a table to snake-case ```shell > [[lang, gems]; [nuTest, 100]] | str snake-case lang ``` - diff --git a/docs/commands/str_starts-with.md b/docs/commands/str_starts-with.md index a8a1c06886..08796c3a6f 100644 --- a/docs/commands/str_starts-with.md +++ b/docs/commands/str_starts-with.md @@ -31,4 +31,3 @@ Checks if string starts with 'my' pattern ```shell > 'Cargo.toml' | str starts-with '.toml' ``` - diff --git a/docs/commands/str_substring.md b/docs/commands/str_substring.md index 7535244179..aa1d777af5 100644 --- a/docs/commands/str_substring.md +++ b/docs/commands/str_substring.md @@ -41,4 +41,3 @@ Get the characters from the beginning until ending index ```shell > 'good nushell' | str substring ',7' ``` - diff --git a/docs/commands/str_to-datetime.md b/docs/commands/str_to-datetime.md index 0299d76acd..f178576d05 100644 --- a/docs/commands/str_to-datetime.md +++ b/docs/commands/str_to-datetime.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> str to-datetime ``` - diff --git a/docs/commands/str_to-decimal.md b/docs/commands/str_to-decimal.md index d923d0ca71..b8bf13c0ec 100644 --- a/docs/commands/str_to-decimal.md +++ b/docs/commands/str_to-decimal.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> str to-decimal ``` - diff --git a/docs/commands/str_to-int.md b/docs/commands/str_to-int.md index a5087b60ba..71351a983e 100644 --- a/docs/commands/str_to-int.md +++ b/docs/commands/str_to-int.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> str to-int ``` - diff --git a/docs/commands/str_trim.md b/docs/commands/str_trim.md index 5d27068195..aae19a5c1f 100644 --- a/docs/commands/str_trim.md +++ b/docs/commands/str_trim.md @@ -56,4 +56,3 @@ Trim a specific character ```shell > '=== Nu shell ===' | str trim -r -c '=' ``` - diff --git a/docs/commands/str_upcase.md b/docs/commands/str_upcase.md index 6f61dc24d3..59981dab83 100644 --- a/docs/commands/str_upcase.md +++ b/docs/commands/str_upcase.md @@ -20,4 +20,3 @@ Upcase contents ```shell > 'nu' | str upcase ``` - diff --git a/docs/commands/sys.md b/docs/commands/sys.md index 22cb930d42..775836eec5 100644 --- a/docs/commands/sys.md +++ b/docs/commands/sys.md @@ -26,4 +26,3 @@ Show the os system name ```shell > (sys).host.name ``` - diff --git a/docs/commands/table.md b/docs/commands/table.md index f9ff3c48e7..cb7d952d45 100644 --- a/docs/commands/table.md +++ b/docs/commands/table.md @@ -14,3 +14,14 @@ Render the table. - `--start-number {int}`: row number to start viewing from +## Examples + +List the files in current directory with index number start from 1. +```shell +> ls | table -n 1 +``` + +Render data in table view +```shell +> echo [[a b]; [1 2] [3 4]] | table +``` diff --git a/docs/commands/term_size.md b/docs/commands/term_size.md index 7ae038971d..0cd746bd94 100644 --- a/docs/commands/term_size.md +++ b/docs/commands/term_size.md @@ -31,4 +31,3 @@ Return the height (rows) of the terminal ```shell > term size -r ``` - diff --git a/docs/commands/to.md b/docs/commands/to.md index 5bd21bc0e6..e6cf0f4660 100644 --- a/docs/commands/to.md +++ b/docs/commands/to.md @@ -9,4 +9,3 @@ Translate structured data to a format ## Signature ```> to ``` - diff --git a/docs/commands/to_csv.md b/docs/commands/to_csv.md index 6b8330cbf4..964d4ca4c8 100644 --- a/docs/commands/to_csv.md +++ b/docs/commands/to_csv.md @@ -4,7 +4,7 @@ layout: command version: 0.59.0 --- -Convert table into .csv text +Convert table into .csv text ## Signature @@ -24,6 +24,5 @@ Outputs an CSV string representing the contents of this table Outputs an CSV string representing the contents of this table ```shell -> [[foo bar]; [1 2]] | to csv -s ';' +> [[foo bar]; [1 2]] | to csv -s ';' ``` - diff --git a/docs/commands/to_html.md b/docs/commands/to_html.md index bdb2adc328..fce7360eed 100644 --- a/docs/commands/to_html.md +++ b/docs/commands/to_html.md @@ -35,4 +35,3 @@ Optionally, output the string with a dark background ```shell > [[foo bar]; [1 2]] | to html --dark ``` - diff --git a/docs/commands/to_json.md b/docs/commands/to_json.md index 00467a3d79..1ac5a1df5d 100644 --- a/docs/commands/to_json.md +++ b/docs/commands/to_json.md @@ -8,16 +8,26 @@ Converts table data into JSON text. ## Signature -```> to json --raw``` +```> to json --raw --indent``` ## Parameters - `--raw`: remove all of the whitespace + - `--indent {number}`: specify indentation width ## Examples -Outputs an unformatted JSON string representing the contents of this table +Outputs a JSON string, with default indentation, representing the contents of this table ```shell -> [1 2 3] | to json +> [a b c] | to json ``` +Outputs a JSON string, with 4-space indentation, representing the contents of this table +```shell +> [Joe Bob Sam] | to json -i 4 +``` + +Outputs an unformatted JSON string representing the contents of this table +```shell +> [1 2 3] | to json -r +``` diff --git a/docs/commands/to_md.md b/docs/commands/to_md.md index 1541c1a68c..efcb3aebf1 100644 --- a/docs/commands/to_md.md +++ b/docs/commands/to_md.md @@ -31,4 +31,3 @@ Treat each row as a markdown element ```shell > [{"H1": "Welcome to Nushell" } [[foo bar]; [1 2]]] | to md --per-element --pretty ``` - diff --git a/docs/commands/to_nuon.md b/docs/commands/to_nuon.md new file mode 100644 index 0000000000..f5ed6198d0 --- /dev/null +++ b/docs/commands/to_nuon.md @@ -0,0 +1,18 @@ +--- +title: to nuon +layout: command +version: 0.59.0 +--- + +Converts table data into Nuon (Nushell Object Notation) text. + +## Signature + +```> to nuon ``` + +## Examples + +Outputs a nuon string representing the contents of this table +```shell +> [1 2 3] | to nuon +``` diff --git a/docs/commands/to_toml.md b/docs/commands/to_toml.md index aeef432b29..4bf86bf8f9 100644 --- a/docs/commands/to_toml.md +++ b/docs/commands/to_toml.md @@ -16,4 +16,3 @@ Outputs an TOML string representing the contents of this table ```shell > [[foo bar]; ["1" "2"]] | to toml ``` - diff --git a/docs/commands/to_tsv.md b/docs/commands/to_tsv.md index 49dcc73c00..32deab8122 100644 --- a/docs/commands/to_tsv.md +++ b/docs/commands/to_tsv.md @@ -20,4 +20,3 @@ Outputs an TSV string representing the contents of this table ```shell > [[foo bar]; [1 2]] | to tsv ``` - diff --git a/docs/commands/to_url.md b/docs/commands/to_url.md index 087be8c379..2f4bca1d7f 100644 --- a/docs/commands/to_url.md +++ b/docs/commands/to_url.md @@ -16,4 +16,3 @@ Outputs an URL string representing the contents of this table ```shell > [[foo bar]; ["1" "2"]] | to url ``` - diff --git a/docs/commands/to_xml.md b/docs/commands/to_xml.md index 797ed0c478..bc9fe586b2 100644 --- a/docs/commands/to_xml.md +++ b/docs/commands/to_xml.md @@ -25,4 +25,3 @@ Optionally, formats the text with a custom indentation setting ```shell > { "note": { "children": [{ "remember": {"attributes" : {}, "children": [Event]}}], "attributes": {} } } | to xml -p 3 ``` - diff --git a/docs/commands/to_yaml.md b/docs/commands/to_yaml.md index 76d6c7ad70..c5bb0b79f2 100644 --- a/docs/commands/to_yaml.md +++ b/docs/commands/to_yaml.md @@ -16,4 +16,3 @@ Outputs an YAML string representing the contents of this table ```shell > [[foo bar]; ["1" "2"]] | to yaml ``` - diff --git a/docs/commands/touch.md b/docs/commands/touch.md index 4cbe398607..65371bd731 100644 --- a/docs/commands/touch.md +++ b/docs/commands/touch.md @@ -26,4 +26,3 @@ Creates files a, b and c ```shell > touch a b c ``` - diff --git a/docs/commands/transpose.md b/docs/commands/transpose.md index 14073f69c1..0885c73be1 100644 --- a/docs/commands/transpose.md +++ b/docs/commands/transpose.md @@ -32,4 +32,3 @@ Transposes the table without column names and specify a new column name ```shell > echo [[c1 c2]; [1 2]] | transpose -i val ``` - diff --git a/docs/commands/tutor.md b/docs/commands/tutor.md index a08ebdb4d8..938c13b0aa 100644 --- a/docs/commands/tutor.md +++ b/docs/commands/tutor.md @@ -26,4 +26,3 @@ Search a tutorial by phrase ```shell > tutor -f "$in" ``` - diff --git a/docs/commands/unalias.md b/docs/commands/unalias.md index 8c4d975fd0..27db2630d5 100644 --- a/docs/commands/unalias.md +++ b/docs/commands/unalias.md @@ -9,4 +9,3 @@ Deprecated command ## Signature ```> unalias ``` - diff --git a/docs/commands/uniq.md b/docs/commands/uniq.md index 8f847fa0cc..988aad0550 100644 --- a/docs/commands/uniq.md +++ b/docs/commands/uniq.md @@ -43,4 +43,3 @@ Remove duplicate rows and show counts of a list/table ```shell > [1 2 2] | uniq -c ``` - diff --git a/docs/commands/update.md b/docs/commands/update.md index 3d2117465b..961a8285da 100644 --- a/docs/commands/update.md +++ b/docs/commands/update.md @@ -31,4 +31,3 @@ Use in block form for more involved updating logic ```shell > echo [[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors { get authors | str collect ',' } ``` - diff --git a/docs/commands/update_cells.md b/docs/commands/update_cells.md index 54fd086119..3dd946d8f8 100644 --- a/docs/commands/update_cells.md +++ b/docs/commands/update_cells.md @@ -44,4 +44,3 @@ Update the zero value cells to empty strings in 2 last columns. } } ``` - diff --git a/docs/commands/url.md b/docs/commands/url.md index 4e2d26afff..c915c92515 100644 --- a/docs/commands/url.md +++ b/docs/commands/url.md @@ -9,4 +9,3 @@ Apply url function. ## Signature ```> url ``` - diff --git a/docs/commands/url_host.md b/docs/commands/url_host.md index 11fc3e0eec..b40cb3a352 100644 --- a/docs/commands/url_host.md +++ b/docs/commands/url_host.md @@ -20,4 +20,3 @@ Get host of a url ```shell > echo 'http://www.example.com/foo/bar' | url host ``` - diff --git a/docs/commands/url_path.md b/docs/commands/url_path.md index 3e0a031c51..a8889b5a53 100644 --- a/docs/commands/url_path.md +++ b/docs/commands/url_path.md @@ -25,4 +25,3 @@ A trailing slash will be reflected in the path ```shell > echo 'http://www.example.com' | url path ``` - diff --git a/docs/commands/url_query.md b/docs/commands/url_query.md index c10da296ca..dbeb3216fa 100644 --- a/docs/commands/url_query.md +++ b/docs/commands/url_query.md @@ -25,4 +25,3 @@ No query gives the empty string ```shell > echo 'http://www.example.com/' | url query ``` - diff --git a/docs/commands/url_scheme.md b/docs/commands/url_scheme.md index 27f04cfb23..6210c04026 100644 --- a/docs/commands/url_scheme.md +++ b/docs/commands/url_scheme.md @@ -25,4 +25,3 @@ You get an empty string if there is no scheme ```shell > echo 'test' | url scheme ``` - diff --git a/docs/commands/use.md b/docs/commands/use.md index 922d6fe881..5106877e2b 100644 --- a/docs/commands/use.md +++ b/docs/commands/use.md @@ -14,3 +14,19 @@ Use definitions from a module - `pattern`: import pattern +## Examples + +Define a custom command in a module and call it +```shell +> module spam { export def foo [] { "foo" } }; use spam foo; foo +``` + +Define an environment variable in a module and evaluate it +```shell +> module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV +``` + +Define a custom command that participates in the environment in a module and call it +```shell +> module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR +``` diff --git a/docs/commands/version.md b/docs/commands/version.md index e74b2f618f..d508caad91 100644 --- a/docs/commands/version.md +++ b/docs/commands/version.md @@ -16,4 +16,3 @@ Display Nu version ```shell > version ``` - diff --git a/docs/commands/view-source.md b/docs/commands/view-source.md index b4facc8b70..431adbc59e 100644 --- a/docs/commands/view-source.md +++ b/docs/commands/view-source.md @@ -13,4 +13,3 @@ View a block, module, or a definition ## Parameters - `item`: name or block to view - diff --git a/docs/commands/where.md b/docs/commands/where.md index b3aece414b..a7f3bf4b17 100644 --- a/docs/commands/where.md +++ b/docs/commands/where.md @@ -35,4 +35,3 @@ List all files that were modified in the last two weeks ```shell > ls | where modified <= 2wk ``` - diff --git a/docs/commands/which.md b/docs/commands/which.md index af1ff377c7..152ecb7f6f 100644 --- a/docs/commands/which.md +++ b/docs/commands/which.md @@ -22,4 +22,3 @@ Find if the 'myapp' application is available ```shell > which myapp ``` - diff --git a/docs/commands/with-env.md b/docs/commands/with-env.md index 183ac42308..65d7b64baa 100644 --- a/docs/commands/with-env.md +++ b/docs/commands/with-env.md @@ -36,4 +36,3 @@ Set by row(e.g. `open x.json` or `from json`) ```shell > echo '{"X":"Y","W":"Z"}'|from json|with-env $in { echo $env.X $env.W } ``` - diff --git a/docs/commands/wrap.md b/docs/commands/wrap.md index c2d02c0c3a..77d4b1523a 100644 --- a/docs/commands/wrap.md +++ b/docs/commands/wrap.md @@ -20,4 +20,3 @@ Wrap a list into a table with a given column name ```shell > echo [1 2 3] | wrap num ``` - diff --git a/docs/commands/zip.md b/docs/commands/zip.md index f47b727898..17aab3a1c5 100644 --- a/docs/commands/zip.md +++ b/docs/commands/zip.md @@ -20,4 +20,3 @@ Zip multiple streams and get one of the results ```shell > 1..3 | zip 4..6 ``` - diff --git a/docs/make_docs.nu b/docs/make_docs.nu index e4a7066eb1..3fb5bd8459 100644 --- a/docs/make_docs.nu +++ b/docs/make_docs.nu @@ -1,6 +1,6 @@ let vers = (version).version -for command in ($scope.commands | where is_custom == $false && is_external == $false) { +for command in ($scope.commands | where is_custom == $false && is_extern == $false) { let top = $"--- title: ($command.command) layout: command @@ -57,7 +57,9 @@ $"($example.description) $example_top + $examples } else { "" } - let doc = ($top + $signature + $parameters + $examples) + let doc = (($top + $signature + $parameters + $examples) | + each {|it| ($it | str trim -r)} | + str collect (char nl)) + (char nl) let safe_name = ($command.command | str find-replace '\?' '' | str find-replace ' ' '_') $doc | save --raw $"./docs/commands/($safe_name).md"