Skip to content

Commit 829d79d

Browse files
committed
docs: Update docs for beta.29
1 parent d16385a commit 829d79d

File tree

9 files changed

+129
-9
lines changed

9 files changed

+129
-9
lines changed

docs/concepts/conversations.md

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Not to be confused with `message` from the section on [**Attributes**](/docs/con
160160

161161
- id (required) - an auto-generated uuidv4 `string`, uniquely identifying a message
162162
- content (required) - a `string` or `JSX.Element`, representing the content of the message
163+
- contentWrapper (optional) - a react component that wraps the message content (received via children) to enable custom styling or layout (niche use-case)
163164
- sender (required) - a `string` representing message sender (can be `user`, `bot` or `system`)
164165
- type (required) - a `string` that specifies "string" (for plain text) or "object" (for JSX elements)
165166
- timestamp (required) - a `string` representing the time the message was sent in UTC

docs/concepts/plugins.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A newly added feature in **v2** of the chatbot, the `plugins` prop provides user
1414
There is a small group of official plugins maintained, which provide useful functionalities in common use cases. As of the last update, the list of official plugins are as below:
1515

1616
- [**Input Validator**](https://github.com/react-chatbotify-plugins/input-validator)
17-
- [**Markdown Parser**](https://github.com/react-chatbotify-plugins/markdown-parser)
17+
- [**Markdown Renderer**](https://github.com/react-chatbotify-plugins/markdown-renderer)
1818
- [**LLM Connector**](https://github.com/react-chatbotify-plugins/llm-connector) (WIP)
1919
- [**Discord Live Chat**](https://github.com/react-chatbotify-plugins/discord-live-chat) (WIP)
2020

docs/examples/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Examples",
3-
"position": 5
3+
"position": 6
44
}

docs/examples/input_validation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: input validation chatbot example
55
keywords: [react, chat, chatbot, chatbotify]
66
---
77

8-
# Custom Icon
8+
# Input Validation
99

1010
The following is an example for performing user input validation. It leverages on the [**Input Validator Plugin**](https://www.npmjs.com/package/@rcb-plugins/input-validator), which is maintained separately on the [**React ChatBotify Plugins**](https://github.com/orgs/React-ChatBotify-Plugins) organization. If you require support with the plugin, please reach out to support on the [**plugins discord**](https://discord.gg/J6pA4v3AMW) instead.
1111

docs/examples/markdown_render.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
sidebar_position: 23
3+
title: Markdown Render
4+
description: markdown render chatbot example
5+
keywords: [react, chat, chatbot, chatbotify]
6+
---
7+
8+
# Markdown Render
9+
10+
The following is an example for rendering markdown messages. It leverages on the [**Markdown Renderer Plugin**](https://www.npmjs.com/package/@rcb-plugins/markdown-renderer), which is maintained separately on the [**React ChatBotify Plugins**](https://github.com/orgs/React-ChatBotify-Plugins) organization. If you require support with the plugin, please reach out to support on the [**plugins discord**](https://discord.gg/J6pA4v3AMW) instead.
11+
12+
```jsx live noInline title=MyChatBot.js
13+
const MyChatBot = () => {
14+
// loads markdown renderer plugin to be passed into chatbot
15+
const plugins = [MarkdownRenderer()];
16+
17+
// example flow for rendering markdown
18+
const flow: Flow = {
19+
start: {
20+
message: "### Hey there, feel free to send me a markdown message!",
21+
path: "try_again",
22+
renderMarkdown: ["BOT", "USER"],
23+
} as MarkdownRendererBlock,
24+
try_again : {
25+
message: "Interesting, **give it a try again**!",
26+
path: "try_again",
27+
renderMarkdown: ["BOT", "USER"],
28+
} as MarkdownRendererBlock,
29+
}
30+
31+
const settings = {
32+
general: {
33+
embedded: true
34+
},
35+
chatHistory: {
36+
storageKey: "example_markdown_render"
37+
}
38+
}
39+
40+
return (
41+
<ChatBot plugins={plugins} settings={settings} flow={flow}/>
42+
);
43+
};
44+
45+
render(<MyChatBot/>)
46+
```

docs/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 6
2+
sidebar_position: 5
33
title: FAQ
44
description: content describing chatbot faq
55
keywords: [react, chat, chatbot, chatbotify]

package-lock.json

+71-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
"@google/generative-ai": "^0.2.1",
2424
"@mdx-js/react": "^3.0.1",
2525
"@rcb-plugins/input-validator": "^0.1.1",
26+
"@rcb-plugins/markdown-renderer": "^0.1.0",
2627
"clsx": "^1.2.1",
2728
"openai": "^4.47.1",
2829
"prism-react-renderer": "^2.3.1",
2930
"react": "^18.2.0",
30-
"react-chatbotify": "^2.0.0-beta.26",
31+
"react-chatbotify": "^2.0.0-beta.29",
3132
"react-dom": "^18.2.0",
3233
"react-github-btn": "^1.4.0"
3334
},

src/theme/ReactLiveScope/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
55

66
let ChatBot = null;
77
let InputValidator = null;
8+
let MarkdownRenderer = null;
89
let reactChatbotify = {};
910

1011
if (ExecutionEnvironment.canUseDOM) {
@@ -16,13 +17,17 @@ if (ExecutionEnvironment.canUseDOM) {
1617

1718
// imports rcb plugin - input validator
1819
InputValidator = require("@rcb-plugins/input-validator");
20+
21+
// imports rcb plugin - markdown renderer
22+
MarkdownRenderer = require("@rcb-plugins/markdown-renderer");
1923
}
2024

2125
const ReactLiveScope = {
2226
React,
2327
ChatBot,
2428
...reactChatbotify,
2529
InputValidator,
30+
MarkdownRenderer,
2631
GoogleGenerativeAI,
2732
OpenAI,
2833
};

0 commit comments

Comments
 (0)