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

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