Skip to content

Commit

Permalink
Add function links to all transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
Atreyagaurav committed Oct 17, 2023
1 parent 98d4712 commit 9755cc2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,20 @@ To apply a tranformer to a variable provide it after [`VAR_TRANSFORM_SEP_CHAR`]

There are a few transformers available:

| Transformer | Arguments | Function | Example |
|----------------------|-----------|--------------------------|--------------------------|
| f [`format_float`] | [.]N | only N number of decimal | {"1.12":f(.1)} ⇒ 1.1 |
| case [`string_case`] | up | UPCASE a string | {"na":case(up)} ⇒ NA |
| case [`string_case`] | down | downcase a string | {"nA":case(down)} ⇒ na |
| case [`string_case`] | proper | Upcase the first letter | {"nA":case(proper)} ⇒ Na |
| case [`string_case`] | title | Title Case the string | {"na":case(title)} ⇒ Na |
| calc | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1*2^2)} ⇒ 16 |
| calc | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1,-1)} ⇒ 2,0 |
| count | str | count str occurance | {"nata":count(a)} ⇒ 2 |
| repl [`replace`] | str1,str2 | replace str1 by str2 | {"nata":rep(a,o)} ⇒ noto |
| q [`quote`] | [str1] | quote with str1, or "" | {"nata":q()} ⇒ "noto" |
| take | str,N | take Nth group sep by str| {"nata":take(a,2)} ⇒ "t" |
| trim | str | trim the string with str | {"nata":trim(a)} ⇒ "nat" |
| Transformer | Funtion | Arguments | Function | Example |
|-------------|--------------------------------|-----------|---------------------------|--------------------------|
| f | [`transformers::float_format`] | [.]N | only N number of decimal | {"1.12":f(.1)} ⇒ 1.1 |
| case | [`transformers::string_case`] | up | UPCASE a string | {"na":case(up)} ⇒ NA |
| case | [`transformers::string_case`] | down | downcase a string | {"nA":case(down)} ⇒ na |
| case | [`transformers::string_case`] | proper | Upcase the first letter | {"nA":case(proper)} ⇒ Na |
| case | [`transformers::string_case`] | title | Title Case the string | {"na":case(title)} ⇒ Na |
| calc | [`transformers::calc`] | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1*2^2)} ⇒ 16 |
| calc | [`transformers::calc`] | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1,-1)} ⇒ 2,0 |
| count | [`transformers::count`] | str | count str occurance | {"nata":count(a)} ⇒ 2 |
| repl | [`transformers::replace`] | str1,str2 | replace str1 by str2 | {"nata":rep(a,o)} ⇒ noto |
| q | [`transformers::quote`] | [str1] | quote with str1, or "" | {"nata":q()} ⇒ "noto" |
| take | [`transformers::take`] | str,N | take Nth group sep by str | {"nata":take(a,2)} ⇒ "t" |
| trim | [`transformers::trim`] | str | trim the string with str | {"nata":trim(a)} ⇒ "nat" |

You can chain transformers ones after another for combined actions. For example, `count( ):calc(+1)` will give you total number of words in a sentence.

Expand Down
28 changes: 14 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,20 @@ To apply a tranformer to a variable provide it after [`VAR_TRANSFORM_SEP_CHAR`]
There are a few transformers available:
| Transformer | Arguments | Function | Example |
|----------------------|-----------|--------------------------|--------------------------|
| f [`format_float`] | [.]N | only N number of decimal | {"1.12":f(.1)} ⇒ 1.1 |
| case [`string_case`] | up | UPCASE a string | {"na":case(up)} ⇒ NA |
| case [`string_case`] | down | downcase a string | {"nA":case(down)} ⇒ na |
| case [`string_case`] | proper | Upcase the first letter | {"nA":case(proper)} ⇒ Na |
| case [`string_case`] | title | Title Case the string | {"na":case(title)} ⇒ Na |
| calc | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1*2^2)} ⇒ 16 |
| calc | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1,-1)} ⇒ 2,0 |
| count | str | count str occurance | {"nata":count(a)} ⇒ 2 |
| repl [`replace`] | str1,str2 | replace str1 by str2 | {"nata":rep(a,o)} ⇒ noto |
| q [`quote`] | [str1] | quote with str1, or "" | {"nata":q()} ⇒ "noto" |
| take | str,N | take Nth group sep by str| {"nata":take(a,2)} ⇒ "t" |
| trim | str | trim the string with str | {"nata":trim(a)} ⇒ "nat" |
| Transformer | Funtion | Arguments | Function | Example |
|-------------|--------------------------------|-----------|---------------------------|--------------------------|
| f | [`transformers::float_format`] | [.]N | only N number of decimal | {"1.12":f(.1)} ⇒ 1.1 |
| case | [`transformers::string_case`] | up | UPCASE a string | {"na":case(up)} ⇒ NA |
| case | [`transformers::string_case`] | down | downcase a string | {"nA":case(down)} ⇒ na |
| case | [`transformers::string_case`] | proper | Upcase the first letter | {"nA":case(proper)} ⇒ Na |
| case | [`transformers::string_case`] | title | Title Case the string | {"na":case(title)} ⇒ Na |
| calc | [`transformers::calc`] | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1*2^2)} ⇒ 16 |
| calc | [`transformers::calc`] | [+-*\/^]N | Airthmatic calculation | {"1":calc(+1,-1)} ⇒ 2,0 |
| count | [`transformers::count`] | str | count str occurance | {"nata":count(a)} ⇒ 2 |
| repl | [`transformers::replace`] | str1,str2 | replace str1 by str2 | {"nata":rep(a,o)} ⇒ noto |
| q | [`transformers::quote`] | [str1] | quote with str1, or "" | {"nata":q()} ⇒ "noto" |
| take | [`transformers::take`] | str,N | take Nth group sep by str | {"nata":take(a,2)} ⇒ "t" |
| trim | [`transformers::trim`] | str | trim the string with str | {"nata":trim(a)} ⇒ "nat" |
You can chain transformers ones after another for combined actions. For example, `count( ):calc(+1)` will give you total number of words in a sentence.
Expand Down

0 comments on commit 9755cc2

Please sign in to comment.