trueban-processor
my first-rate project
如何使用
首先,我们需要有一个library对象:
const library = {
'sentence': [
"Hi! I'm Lily.",
"Hi! I'm Michael."
],
'word': ["a", "b"]
}
接下来,初始化tsl
const tsl = new Processor(library)
lyric格式
假如有一个lyric文本
const lyric = `knock knock hello
====
Hello! (Hello!) 你好,你好!**2
Come in. 请进
Let’s sing. 让我们一起歌唱
Let’s play. 让我们一起游戏`
则输入
const { parsed , processed } = tsl.compile(lyric,{processor:'lyric'})
list格式
假如我们有一个list文本
const list = `{{library:word}}
^^a
b
===
Hi! I'm Lily.
Hi! I'm Michael.
`
则输入
const { parsed , processed } = tsl.compile(list)
默认processor为list.
Contributing
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
Author
trueban-processor © wanthering, Released under the MIT License.
GitHub @wanthering