Skip to content

Commit

Permalink
README formatting broke at some point
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean Hetherington authored Sep 4, 2017
1 parent 8755565 commit 2c41a18
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Terminal Type
-------
####About
#### About
Terminal Type is a project born from my development of [deanhet.com](http://www.deanhet.com). It's a novel way for the user to interact with the site and get information by emulating a terminal/command line/chat interface. This plugin is designed to provide the framework and essentials to get started. It presumes you will deal with the styling/how it looks.

All interaction happens within a textbox where the user can also input commands (and submit then with return). If a command is recognised then a canned response is given. If it isn't, a random error message is chosen.

Likely to leave further development but I'll definitely consider addtional features if there's enough demand for them.

####Demo
#### Demo
A tricked out super angularfied version of this plugin can be found at [deanhet.com](http://www.deanhet.com). This plugin is more recent (and better) than the code on the site so I would only use what's there as an example of the cool applications it can be used for.

####Installation
#### Installation
Include jQuery then before closing your ```<body>``` tag, add:
````
<script type="text/javascript" src="jquery.terminalType.js"></script>
````

####Quick Example
#### Quick Example
You can quickly get Terminal Type up and running but it's only really useful with some configuration. Start by defining the textarea where all the magic happens:
```
<textarea class="example-terminal"></textarea>
Expand All @@ -39,7 +39,7 @@ $(".example-terminal").terminalType({
]
});
```
####Callbacks
#### Callbacks
You can listen for and attach functions for when commands fail and succeed. To trigger a function for when a command is recognised:
```
$(".example-terminal").terminalType().onTerminalSuccess(function(){
Expand All @@ -58,7 +58,7 @@ $(".example-terminal").terminalType().onTerminalSuccess(function(userInput){
console.log("The user typed " + userInput);
});
```
####Settings
#### Settings
Option | Type | Default | Description
------ | ---- | ------- | -----------
introText | string | "Hello, I'm some introduction test"| Text first displayed to the user when the plugin is initialised
Expand All @@ -69,4 +69,4 @@ prependUserText | string | "> " | Text shown at the beginning of each line of us
prependTerminalText | string | "$ " | Text shown at the beginning of each line of terminal output
focusOnFinish | boolean | true | Focus on the textarea after a command has been shown.
validCommands | object | { hello: "Hi there buddy! You checked the docs?" } | Object containing a list of valid commands to the terminal and the response that should be given when a command is matched.
error | array (strings) | ["I AM AN ERROR"] | Array containing errors to be shown if a command isn't matched. If there are multiple errors, the terminal will choose one at random to show.
error | array (strings) | ["I AM AN ERROR"] | Array containing errors to be shown if a command isn't matched. If there are multiple errors, the terminal will choose one at random to show.

0 comments on commit 2c41a18

Please sign in to comment.