update #4455, regenerate commands' docs and update make_docs script (#4586)

* feat: update #4455, regenerate commands' docs

* chore: update make_docs script
This commit is contained in:
Justin Ma 2022-02-22 01:26:00 +08:00 committed by GitHub
parent 2e167ea0c6
commit c0a1d18e3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
331 changed files with 234 additions and 328 deletions

View file

@ -21,4 +21,3 @@ Alias ll to ls -l
```shell
> alias ll = ls -l
```

View file

@ -25,4 +25,3 @@ Check that all values are even
```shell
> echo [2 4 6 8] | all? ($it mod 2) == 0
```

View file

@ -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)"
```

View file

@ -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
```

View file

@ -20,4 +20,3 @@ strip ansi escape sequences from string
```shell
> echo [ (ansi green) (ansi cursor_on) "hello" ] | str collect | ansi strip
```

View file

@ -25,4 +25,3 @@ Check if any of the values is odd
```shell
> echo [2 4 1 6 8] | any? ($it mod 2) == 1
```

View file

@ -30,4 +30,3 @@ Append Ints and Strings
```shell
> [0,1] | append [2,nu,4,shell]
```

View file

@ -20,4 +20,3 @@ Benchmarks a command within a block
```shell
> benchmark { sleep 500ms }
```

View file

@ -25,4 +25,3 @@ Builds a string from letters a b c
```shell
> build-string (1 + 2) = one ' ' plus ' ' two
```

View file

@ -35,4 +35,3 @@ This month's calendar with the week starting on monday
```shell
> cal --week-start monday
```

View file

@ -20,4 +20,3 @@ Change to your home directory
```shell
> cd ~
```

View file

@ -38,4 +38,3 @@ Output multi-byte Unicode character
```shell
> char -u 1F468 200D 1F466 200D 1F466
```

View file

@ -16,4 +16,3 @@ Clear the terminal
```shell
> clear
```

View file

@ -20,4 +20,3 @@ Use the second value in the stream
```shell
> echo 1 2 3 | collect { |x| echo $x.1 }
```

View file

@ -26,4 +26,3 @@ Get the second column from the table
```shell
> [[name,age,grade]; [bill,20,a]] | columns | select 1
```

View file

@ -30,4 +30,3 @@ Filter out all instances of nothing from a list (Returns [1,2]
```shell
> echo [1, $nothing, 2] | compact
```

View file

@ -27,4 +27,3 @@ Recursively copy dir_a to dir_b
```shell
> cp -r dir_a dir_b
```

View file

@ -9,4 +9,3 @@ Deprecated command
## Signature
```> dataframe ```

View file

@ -9,4 +9,3 @@ date
## Signature
```> date ```

View file

@ -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"
```

View file

@ -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
```

View file

@ -16,4 +16,3 @@ Show timezone(s) that contains 'Shanghai'
```shell
> date list-timezone | where timezone =~ Shanghai
```

View file

@ -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"
```

View file

@ -26,4 +26,3 @@ Print the date in a structured table.
```shell
> '2020-04-12 22:10:57 +0200' | date to-table
```

View file

@ -35,4 +35,3 @@ Get the current date in Hawaii
```shell
> "2020-10-10 10:00:00 +02:00" | date to-timezone "+0500"
```

View file

@ -20,4 +20,3 @@ Describe the type of a string
```shell
> 'hello' | debug
```

View file

@ -20,4 +20,3 @@ Decode the output of an external command
```shell
> cat myfile.q | decode utf-8
```

View file

@ -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
```

View file

@ -27,4 +27,3 @@ Define a command and run it with parameter(s)
```shell
> def say-sth [sth: string] { echo $sth }; say-sth hi
```

View file

@ -21,4 +21,3 @@ Give a default 'target' to all file entries
```shell
> ls -la | default target 'nothing'
```

View file

@ -16,4 +16,3 @@ Describe the type of a string
```shell
> 'hello' | describe
```

View file

@ -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
```

View file

@ -9,4 +9,3 @@ Dataframe commands
## Signature
```> dfr ```

View file

@ -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
```

View file

@ -23,4 +23,3 @@ Checks the result from a comparison
let res = ($s > 9);
$res | dfr all-false
```

View file

@ -23,4 +23,3 @@ Checks the result from a comparison
let res = ($s > 9);
$res | dfr all-true
```

View file

@ -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
```

View file

@ -16,4 +16,3 @@ Returns index for max value
```shell
> [1 3 2] | dfr to-df | dfr arg-max
```

View file

@ -16,4 +16,3 @@ Returns index for min value
```shell
> [1 3 2] | dfr to-df | dfr arg-min
```

View file

@ -25,4 +25,3 @@ Returns indexes for a sorted series
```shell
> [1 2 2 3 3] | dfr to-df | dfr arg-sort -r
```

View file

@ -16,4 +16,3 @@ Returns indexes where values are true
```shell
> [$false $true $false] | dfr to-df | dfr arg-true
```

View file

@ -16,4 +16,3 @@ Returns indexes for unique values
```shell
> [1 2 2 3 3] | dfr to-df | dfr arg-unique
```

View file

@ -20,4 +20,3 @@ Returns the selected column as series
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr column a
```

View file

@ -21,4 +21,3 @@ Concatenate string
> let other = ([za xs cd] | dfr to-df);
[abc abc abc] | dfr to-df | dfr concatenate $other
```

View file

@ -20,4 +20,3 @@ Returns boolean indicating if pattern was found
```shell
> [abc acb acb] | dfr to-df | dfr contains ab
```

View file

@ -17,4 +17,3 @@ Counts null values
> let s = ([1 1 0 0 3 3 4] | dfr to-df);
($s / $s) | dfr count-null
```

View file

@ -16,4 +16,3 @@ Counts unique values
```shell
> [1 1 2 2 3 3 4] | dfr to-df | dfr count-unique
```

View file

@ -21,4 +21,3 @@ Cumulative sum for a series
```shell
> [1 2 3 4 5] | dfr to-df | dfr cumulative sum
```

View file

@ -16,4 +16,3 @@ dataframe description
```shell
> [[a b]; [1 1] [1 1]] | dfr to-df | dfr describe
```

View file

@ -21,4 +21,3 @@ drop duplicates
```shell
> [[a b]; [1 2] [3 4] [1 2]] | dfr to-df | dfr drop-duplicates
```

View file

@ -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
```

View file

@ -20,4 +20,3 @@ drop column a
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr drop a
```

View file

@ -16,4 +16,3 @@ Dataframe dtypes
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr dtypes
```

View file

@ -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
```

View file

@ -20,4 +20,3 @@ Create new dataframe with head rows
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr first 1
```

View file

@ -18,4 +18,3 @@ Returns day from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-day
```

View file

@ -18,4 +18,3 @@ Returns hour from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-hour
```

View file

@ -18,4 +18,3 @@ Returns minute from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-minute
```

View file

@ -18,4 +18,3 @@ Returns month from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-month
```

View file

@ -18,4 +18,3 @@ Returns nanosecond from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-nanosecond
```

View file

@ -18,4 +18,3 @@ Returns ordinal from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-ordinal
```

View file

@ -18,4 +18,3 @@ Returns second from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-second
```

View file

@ -18,4 +18,3 @@ Returns week from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-week
```

View file

@ -18,4 +18,3 @@ Returns weekday from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-weekday
```

View file

@ -18,4 +18,3 @@ Returns year from a date
let df = ([$dt $dt] | dfr to-df);
$df | dfr get-year
```

View file

@ -20,4 +20,3 @@ Creates dataframe with selected columns
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr get a
```

View file

@ -20,4 +20,3 @@ Grouping by column a
```shell
> [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a
```

View file

@ -16,4 +16,3 @@ Create mask indicating duplicated values
```shell
> [5 6 6 6 8 8 8] | dfr to-df | dfr is-duplicated
```

View file

@ -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
```

View file

@ -18,4 +18,3 @@ Create mask where values are not null
let res = ($s / $s);
$res | dfr is-not-null
```

View file

@ -18,4 +18,3 @@ Create mask where values are null
let res = ($s / $s);
$res | dfr is-null
```

View file

@ -16,4 +16,3 @@ Create mask indicating unique values
```shell
> [5 6 6 6 8 8 8] | dfr to-df | dfr is-unique
```

View file

@ -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]
```

View file

@ -20,4 +20,3 @@ Create new dataframe with last rows
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr last 1
```

View file

@ -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]
```

View file

@ -16,4 +16,3 @@ Inverts boolean mask
```shell
> [$true $false $true] | dfr to-df | dfr not
```

View file

@ -25,4 +25,3 @@ Takes a file name and creates a dataframe
```shell
> dfr open test.csv
```

View file

@ -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
```

View file

@ -21,4 +21,3 @@ Renames a dataframe column
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr rename-col a a_new
```

View file

@ -20,4 +20,3 @@ Renames a series
```shell
> [5 6 7 8] | dfr to-df | dfr rename new_name
```

View file

@ -21,4 +21,3 @@ Replaces string
```shell
> [abac abac abac] | dfr to-df | dfr replace-all -p a -r A
```

View file

@ -21,4 +21,3 @@ Replaces string
```shell
> [abc abc abc] | dfr to-df | dfr replace -p ab -r AB
```

View file

@ -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
```

View file

@ -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
```

View file

@ -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
```

View file

@ -23,4 +23,3 @@ Shifts the values by a given period
let mask = ($s | dfr is-null);
$s | dfr set 0 --mask $mask
```

View file

@ -16,4 +16,3 @@ Shows row and column shape
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr shape
```

View file

@ -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
```

View file

@ -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
```

View file

@ -26,4 +26,3 @@ Create new sorted series
```shell
> [3 4 1 2] | dfr to-df | dfr sort
```

View file

@ -16,4 +16,3 @@ Returns string lengths
```shell
> [a ab abc] | dfr to-df | dfr str-lengths
```

View file

@ -21,4 +21,3 @@ Creates slices from the strings
```shell
> [abcded abc321 abc123] | dfr to-df | dfr str-slice 1 -l 2
```

View file

@ -22,4 +22,3 @@ Formats date
let df = ([$dt $dt] | dfr to-df);
$df | dfr strftime "%Y/%m/%d"
```

View file

@ -29,4 +29,3 @@ Takes selected rows from series
let indices = ([0 2] | dfr to-df);
$series | dfr take $indices
```

View file

@ -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 '|'
```

View file

@ -31,4 +31,3 @@ Takes a list of booleans and creates a dataframe
```shell
> [$true $true $false] | dfr to-df
```

View file

@ -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
```

View file

@ -16,4 +16,3 @@ Modifies strings to lowercase
```shell
> [Abc aBc abC] | dfr to-df | dfr to-lowercase
```

View file

@ -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
```

View file

@ -20,4 +20,3 @@ Saves dataframe to csv file
```shell
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-parquet test.parquet
```

Some files were not shown because too many files have changed in this diff Show more