diff --git a/README.md b/README.md index 2e033c1..a46d1ea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Terminal in React -![version](https://img.shields.io/badge/terminal--in--react-2.2.1-brightgreen.svg) -![size](https://img.shields.io/badge/size-35.5%20KB-brightgreen.svg) +![version](https://img.shields.io/badge/terminal--in--react-3.0.0-brightgreen.svg) +![size](https://img.shields.io/badge/size-33.4%20KB-brightgreen.svg) +![size](https://img.shields.io/badge/gzip-9.85%20KB-brightgreen.svg)
@@ -42,7 +43,7 @@ class App extends Component {
showmsg: this.showMsg,
popup: () => alert("Terminal in React")
}}
- description={{
+ descriptions={{
'open-google': 'opens google.com',
showmsg: 'shows a message',
alert: 'alert', popup: 'alert'
@@ -63,6 +64,8 @@ class App extends Component {
## Working
+### Adding commands
+
To add your own command, use prop `commands` which accepts an object. This objects then maps `command name -> command function`.
Let's take an example. You want to open a website with a command `open-google`
@@ -71,13 +74,17 @@ Let's take an example. You want to open a website with a command `open-google`
-## Advanced commands +### Hide the default options + +```jsx +
- -
- + The command Api has three parameters `arguments`, `print`, and `runCommand`. @@ -145,8 +163,68 @@ The command Api has three parameters `arguments`, `print`, and `runCommand`. as a result of a command will also be printed. - `runCommand` is a method to call other commands it takes a string and will attempt to run the command given - - Check [this](./starter/App.js) example for more information. + +Let's take an another example - + +```jsx ++ +
+ +Awesome! Right? Let us know if you make something interesting 😃 + +### Tab autocomplete + ++ +
+ +### Multiline input + +via `shift + enter` + ++ +
+ +### Check history of your commands + ++ +
## Customization @@ -157,13 +235,6 @@ Use * prop `barColor` to change the color of bar. * prop `prompt` to change the prompt (`>`) color. -## What's more ? - -* will support images, gifs -* plugins -* tab autocomplete -* multiline input - Follow me on Twitter [@NTulswani](https://twitter.com/NTulswani) for new updates and progress 😄 ## API @@ -179,7 +250,8 @@ Follow me on Twitter [@NTulswani](https://twitter.com/NTulswani) for new updates | **msg** | string | - | | **watchConsoleLogging** | bool | false | | **commandPassThrough** | function | null | - +| **promptSymbol** | string | > | +| **plugins** | array | [ { name: '', load: new Plugin(), commands: {} descriptions: {} } ] | ## Built-in commands @@ -189,10 +261,6 @@ Follow me on Twitter [@NTulswani](https://twitter.com/NTulswani) for new updates * `echo` - Outputs anything given * `edit-line` - Edits the last line or a given line using the `-l` argument -## Built-in functionality - -Check the history of your commands by pressing key up and key down. - ## Where to use ? * Embed it as a toy on your website