Crates.io | choco |
lib.rs | choco |
version | 0.2.2 |
source | src |
created_at | 2024-02-02 11:16:15.894878 |
updated_at | 2024-02-24 13:42:53.274838 |
description | markup language for dialogue systems |
homepage | |
repository | https://github.com/30bit/choco |
max_upload_size | |
id | 1124243 |
size | 52,933 |
Choco is a markup language for dialogue systems. It works by emitting signals from text into rust via special @
-syntax.
Every signal is prefixed with @
-character. Signals may contain
@wave
)@{ My important param }
)@bookmark{into}
)Pay attention! @
).Three signal prompts are taken by Choco. These are bookmark
, choice
and style
.
Branching is easy in Choco. @bookmark{bookmark-name}
registers a graph node, and @choice{chosen-bookmark-name}
creates an edge between bookmark this choice belongs to and chosen bookmark. For example:
@bookmark{greet}
– Hello, you!
@choice{greet}– Come again?
@choice{bye}– Hi!
@bookmark{bye}
– Well, farewell..
Styling text is done with @style
signal. It accepts a mix of shortened to one character style names and prefixes promptless parameter, containing text.
For example,
@style{qbp}@{- Hello, you!}
Style names are slightly opinionated, but you decide how to display a mix of them:
Char | Style | Note |
---|---|---|
p | Panel | i.e. block |
c | Code |
|
q | > Quote | doesn't have to be block-quote |
b | Bold | |
i | Italic | |
s | i.e. strike-through |
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.