From e391ba3ea724204aea03a95d82c3e7cd1c00de9e Mon Sep 17 00:00:00 2001 From: RiN Date: Mon, 6 Sep 2021 17:48:59 +0800 Subject: [PATCH] docs(CLI): update README.md (#2) * docs: update section of CLI in README.md * docs: add options for prefix in README.md --- README.md | 66 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 05f63fd..2988c1a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- -
+ +


creater-chakra-icons @@ -13,30 +13,50 @@ ## Usage -### CLI +### Command Line Arguments +```console +create-chakra-icons [FLAGS] [OPTIONS] [INPUT] +``` +### Flags ```console -npx create-chakra-icons -n "MyIcon" -i ./myicon.svg -o ./MyIcon.js +-h, --help Prints help information +-V, --version Prints version information ``` ### Options +```console +-i, --input This option for read the input from PATH from FILE or DIRECTORIES. + [e.g.: -i some/path , -i file.svg] +-o, --output Writes the output. [default: stdout] +-n, --name Sets value for `displayName` properties + (*ONLY for pipelines command). [default: Unamed] [e.g. -n "MyIcon"] +-C, --case + Sets for case [snake|camel|constant|pascal] in export named declaration + output. [default: pascal] +-S, --suffix Sets for suffix in export named declaration. +-P, --prefix Sets for prefix in export named declaration. + [e.g.: -S "Icon"] +--ts, --typescript Sets output as TypeScript code. +``` +### Examples -* `-n/--name`: it will be `displayName` in Component Properties. -* `-i/--input`: where your put the `SVG` file - can be `file` or `directories`. -* `-o/--output`: where your want to save your file. - -### Pipe (stdout) +#### Pipelines command: +* **input** in pipe ```console -$> echo " +echo " -" | create-chakra-icons -n "Rin" -// output +" | create-chakra-icons -n "KodingNinjaIcon" +``` +* **output** in stdout + +```jsx import { createIcon } from "@chakra-ui/react"; export const Rin = createIcon({ displayName: "Rin", @@ -45,20 +65,7 @@ export const Rin = createIcon({ }); ``` -### Pipe (output file) - -```console -$> echo " - - - -" | create-chakra-icons -n "Rin" > RinIcon.js -``` - -## Readmap +## Roadmap * [ ] TypeScript Support (Type Annotation or Type Definition). * [ ] ReScript Support. @@ -68,6 +75,8 @@ $> echo " ## API +

+ Click here, for more details about API of create-chakra-icons #### Table of Contents @@ -359,6 +368,11 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** +
+ +## Maintainer +* **Rin** ([@ri7nz](//github.com/ri7nz)) + ## Contribution Feel free for making an issue, pull request, or give any feedback. 🙌