Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonba committed Mar 8, 2018
1 parent 14e52a3 commit a9b5810
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
9 changes: 5 additions & 4 deletions docs/docs/choosing-the-bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ title: Choosing the Bundle

YveBot have two bundles. Make your choice:

| Bundle | Description | Browser | Node |
|--------|-------------|---------|------|
| UI | A pre-defined wrapper over the *Core* that implements a basic UI chat conversation. You will only have to create a stylesheet file. | X
| Core | Minimal code to configure your bot. | X | X
| Bundle | Description | Browser | Node | Webpack |
|--------|-------------|---------|------|---------|
| Core | Bot engine. | X | X | X
| UI | A pre-defined wrapper over the *Core* that implements a basic Chat UI conversation. | X | | X
| Web | Bundle for browser. It's union of *Core* and *UI*. | X | | X


[Next: UI API]({{ site.baseurl }}/docs/ui){:.btn}
18 changes: 8 additions & 10 deletions docs/docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ Enhance your chat with custom extensions and load just what you're going to use.
Autocomplete-like for chat conversation.


### How to import?
### How do I use?

##### Node / React
```javascript
import YveBot from 'yve-bot';
import 'yve-bot/ext/types/TypeName';
```

##### Browser with UI bundle
##### Using on Browser
```html
<script src="//cdn.jsdelivr.net/npm/yve-bot@latest/ui.js"></script>
<script src="//cdn.jsdelivr.net/npm/yve-bot@latest/web.js"></script>
<script src="//cdn.jsdelivr.net/npm/yve-bot@latest/ext/types/TypeName"></script>
```


##### Node / React
```javascript
import YveBot from 'yve-bot/ui';
import 'yve-bot/ext/types/TypeName';
```

[Next: Examples]({{ site.baseurl }}/docs/examples){:.btn}
10 changes: 5 additions & 5 deletions docs/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ The simplest way to build a smart and customized rule-based bot conversation. Yv
Check the available bundles bellow.


### UI - A ready Chat UI
A simple component to be used in your website. (browser-only)
### UI - Simple Chat Component
A extensible component to be used in your website. (browser-only)

```html
<script src="//cdn.jsdelivr.net/npm/yve-bot/ui.js"></script>
<script src="//cdn.jsdelivr.net/npm/yve-bot/web.js"></script>
<script>
new YveBot(rules, { target: '.Chat' }).start();
</script>
```

### Core - Bot engine
Integrate with server-side (eg: websocket, facebook, etc...) or create your own UI. (node/browser)
Integrate with server-side (eg: websocket, facebook, etc...) or create your own chat component over the engine.

```bash
npm install yve-bot
yarn add yve-bot
```

```javascript
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Playground
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.31.0/lib/codemirror.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.31.0/mode/yaml/yaml.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.9.1/js-yaml.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/yve-bot/ui.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/yve-bot/web.min.js"></script>

<script>
var editor = CodeMirror.fromTextArea(document.getElementById('editor'), {
Expand Down
10 changes: 7 additions & 3 deletions docs/docs/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ title: UI API

Create bots without re-implement the chat conversation UI components. This browser lib is a wrapper over the Core bundle.

## Initializing
## Using on Browser
```html
<script src="//cdn.jsdelivr.net/npm/yve-bot/ui.js"></script>
<script src="//cdn.jsdelivr.net/npm/yve-bot/web.js"></script>

<script>
var rules = [...];
Expand All @@ -20,11 +20,15 @@ Create bots without re-implement the chat conversation UI components. This brows
</script>
```

or using React
## Using with Bundlers
(eg: compiling React app with webpack)

```javascript
import YveBotUI from 'yve-bot/ui';
```

## API

| Argument | Default | Type | Description |
|----------|---------|------|-------------|
| rules | - | array[Rule] | Array of Rule
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ include_index_menu: false
</div>
</div>

<script src="//cdn.jsdelivr.net/npm/yve-bot@latest/ui.js"></script>
<script src="//cdn.jsdelivr.net/npm/yve-bot@latest/web.js"></script>
<script src="assets/js/chat.js"></script>

0 comments on commit a9b5810

Please sign in to comment.