Skip to content

Commit 1395157

Browse files
committed
update README
1 parent cc6cc9b commit 1395157

2 files changed

Lines changed: 67 additions & 71 deletions

File tree

README.md

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<picture>
22
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-transparent.png">
33
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
4-
<img alt="Fallback image description" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
4+
<img alt="NarraLeaf Logo" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
55
</picture>
66

77
<h1 align="center">NarraLeaf-React</h1>
@@ -31,49 +31,36 @@ NarraLeaf-React uses TypeScript for all scripting, so you don't have to learn a
3131
It also has a highly abstracted and easy-to-use API, for example:
3232

3333
```typescript
34-
import {Character, Menu, Scene, Word, c, b} from "narraleaf-react";
34+
import {Character, Menu, Scene, c, b} from "narraleaf-react";
3535
```
3636

3737
```typescript
38-
const scene1 = new Scene("scene1_hello_world", {
39-
background: "/background/scene1_hello_world.jpg",
38+
const scene1 = new Scene("Scene1: Hello World", {
39+
background: "/link/to/background.jpg",
4040
});
4141

42-
const johnSmith = new Character("John Smith");
43-
const johnDoe = new Character("John Doe");
42+
const jS = new Character("John Smith");
43+
const jD = new Character("John Doe");
4444

4545
scene1.action([
46-
/**
47-
* John Smith: Hello, world!
48-
* John Smith: This is my first **NarraLeaf** story.
49-
* John Smith: Start editing src/story.js and enjoy the journey!
50-
*/
51-
johnSmith
52-
.say("Hello, world!")
53-
.say`This is my first ${b("NarraLeaf")} story.`
54-
.say`Start editing ${c("src/story.js", "#00f")} and enjoy the journey!`,
55-
56-
/**
57-
* John Doe: Also, don't forget to check out the documentation!
58-
*/
59-
johnDoe.say("Also, don't forget to check out the documentation!"),
60-
61-
/**
62-
* Menu: Start the journey
63-
* > Yes I will!
64-
* - John Smith: Great! Let's start the journey!
65-
* - John Smith: You can open issues on GitHub if you have any questions.
66-
* > No, I'm going to check the documentation
67-
* - John Smith: Sure! Take your time!
68-
*/
46+
jS`Hello, world!`,
47+
jS`This is my first ${b("NarraLeaf")} story.`,
48+
jS`Start editing ${c("src/story.js", "#00f")} and enjoy the journey!`,
49+
50+
jD`Also, don't forget to check out the ${c("documentation", "#00f")}!`,
51+
52+
"By the way, the documentation is available on https://react.narraleaf.com/documentation",
53+
"You can also visit the website for demo and more information.",
54+
6955
Menu.prompt("Start the journey")
56+
7057
.choose("Yes I will!", [
71-
johnSmith
72-
.say("Great! Let's start the journey!")
73-
.say("You can open issues on GitHub if you have any questions.")
58+
jS`Great! Let's start the journey!`,
59+
jS`You can open issues on GitHub if you have any questions.`
7460
])
61+
7562
.choose("No, I'm going to check the documentation", [
76-
johnSmith.say("Sure! Take your time!")
63+
jS`Sure! Take your time!`
7764
])
7865
]);
7966
```
@@ -133,6 +120,17 @@ npm install narraleaf-react
133120
- [Plugin](https://react.narraleaf.com/documentation/core/plugin)
134121
- [Utils](https://react.narraleaf.com/documentation/core/utils)
135122
- [Player](https://react.narraleaf.com/documentation/player)
123+
- [Player](https://react.narraleaf.com/documentation/player/player)
124+
- [GameProviders](https://react.narraleaf.com/documentation/player/game-providers)
125+
- Hooks
126+
- [useGame](https://react.narraleaf.com/documentation/player/hooks/useGame)
127+
- [usePreferences](https://react.narraleaf.com/documentation/player/hooks/usePreferences)
128+
- [useRouter](https://react.narraleaf.com/documentation/player/hooks/useRouter)
129+
- [useDialog](https://react.narraleaf.com/documentation/player/hooks/useDialog)
130+
- [Page Router](https://react.narraleaf.com/documentation/player/page-router)
131+
- [Dialog](https://react.narraleaf.com/documentation/player/dialog)
132+
- [Notification](https://react.narraleaf.com/documentation/player/notification)
133+
- [Menu](https://react.narraleaf.com/documentation/player/menu)
136134
- About
137135
- [License](https://react.narraleaf.com/documentation/info/license)
138136
- [Incompatible Changes](https://react.narraleaf.com/documentation/info/incompatible-changes)

docs/README.zh-CN.md

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<picture>
22
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-transparent.png">
33
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
4-
<img alt="Fallback image description" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
4+
<img alt="NarraLeaf Logo" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
55
</picture>
66

77
<h1 align="center">NarraLeaf-React</h1>
@@ -35,46 +35,33 @@ import {Character, Menu, Scene, Word, c, b} from "narraleaf-react";
3535
```
3636

3737
```typescript
38-
const scene1 = new Scene("场景1_你好_世界", {
39-
background: "/background/scene1_hello_world.jpg",
38+
const scene1 = new Scene("场景1: 你好,世界", {
39+
background: "/link/to/background.jpg",
4040
});
4141

42-
const johnSmith = new Character("约翰·史密斯");
43-
const johnDoe = new Character("约翰·多");
42+
const jS = new Character("John Smith");
43+
const jD = new Character("John Doe");
4444

4545
scene1.action([
46-
/**
47-
* 约翰·史密斯: 你好世界!
48-
* 约翰·史密斯: 这是我的第一个 **NarraLeaf** 视觉小说
49-
* 约翰·史密斯: 开始编辑 src/story.js 并享受旅程!
50-
*/
51-
johnSmith
52-
.say("你好世界!")
53-
.say`这是我的第一个 ${b("NarraLeaf")} 视觉小说`
54-
.say`开始编辑 ${c("src/story.js", "#00f")} 并享受旅程!`,
55-
56-
/**
57-
* 约翰·多: 对了,别忘了查看文档!
58-
*/
59-
johnDoe.say("对了,别忘了查看文档!"),
60-
61-
/**
62-
* Menu: 开始旅程
63-
* > 是的,我会!
64-
* - 约翰·史密斯: 太好了!让我们开始旅程!
65-
* - 约翰·史密斯: 如果您有任何问题,可以在GitHub上提出问题。
66-
* > 不,我要查看文档
67-
* - 约翰·史密斯: 当然!慢慢来!
68-
*/
69-
Menu.promp("开始旅程")
70-
.choose("是的,我会!", [
71-
johnSmith
72-
.say("太好了!让我们开始旅程!")
73-
.say("如果您有任何问题,可以在GitHub上提出问题。")
74-
])
75-
.choose("不,我要查看文档", [
76-
johnSmith.say("当然!慢慢来!")
77-
])
46+
jS`你好,世界!`,
47+
jS`这是我的第一个 ${b("NarraLeaf")} 故事。`,
48+
jS`开始编辑 ${c("src/story.js", "#00f")} 并享受旅程!`,
49+
50+
jD`别忘了检查 ${c("文档", "#00f")}!`,
51+
52+
"顺便说一句,文档在 https://react.narraleaf.com/documentation",
53+
"你也可以访问网站获取更多信息。",
54+
55+
Menu.prompt("开始旅程")
56+
57+
.choose("是的,我愿意!", [
58+
jS`太好了!让我们开始旅程!`,
59+
jS`如果你有任何问题,可以在 GitHub 上提出问题。`
60+
])
61+
62+
.choose("不,我要检查文档", [
63+
jS`好的,请慢慢来!`
64+
])
7865
]);
7966
```
8067

@@ -124,7 +111,7 @@ npm install narraleaf-react
124111
- [文本](https://react.narraleaf.com/documentation/core/elements/text)
125112
- [持久化](https://react.narraleaf.com/documentation/core/elements/persistent)
126113
- [故事](https://react.narraleaf.com/documentation/core/elements/story)
127-
- [Displayable](https://react.narraleaf.com/documentation/core/elements/displayable)
114+
- [可视化组件](https://react.narraleaf.com/documentation/core/elements/displayable)
128115
- [图层](https://react.narraleaf.com/documentation/core/elements/layer)
129116
- [服务](https://react.narraleaf.com/documentation/core/elements/service)
130117
- [视频](https://react.narraleaf.com/documentation/core/elements/video)
@@ -133,6 +120,17 @@ npm install narraleaf-react
133120
- [插件](https://react.narraleaf.com/documentation/core/plugin)
134121
- [实用工具](https://react.narraleaf.com/documentation/core/utils)
135122
- [播放器](https://react.narraleaf.com/documentation/player)
123+
- [Player](https://react.narraleaf.com/documentation/player/player)
124+
- [GameProviders](https://react.narraleaf.com/documentation/player/game-providers)
125+
- 钩子
126+
- [useGame](https://react.narraleaf.com/documentation/player/hooks/useGame)
127+
- [usePreferences](https://react.narraleaf.com/documentation/player/hooks/usePreferences)
128+
- [useRouter](https://react.narraleaf.com/documentation/player/hooks/useRouter)
129+
- [useDialog](https://react.narraleaf.com/documentation/player/hooks/useDialog)
130+
- [页面路由](https://react.narraleaf.com/documentation/player/page-router)
131+
- [对话框](https://react.narraleaf.com/documentation/player/dialog)
132+
- [通知](https://react.narraleaf.com/documentation/player/notification)
133+
- [选项框](https://react.narraleaf.com/documentation/player/menu)
136134
- 关于
137135
- [许可](https://react.narraleaf.com/documentation/info/license)
138136
- [不兼容的更改](https://react.narraleaf.com/documentation/info/incompatible-changes)

0 commit comments

Comments
 (0)