Move rhai-repl and rhai-doc to bin.

This commit is contained in:
Stephen Chung 2020-12-29 15:36:42 +08:00
parent 2858aa3b2f
commit 049ad3b6fd
8 changed files with 46 additions and 13 deletions

View File

@ -33,6 +33,7 @@ Enhancements
* `Engine::register_static_module` now supports sub-module paths (e.g. `foo::bar::baz`).
* `Engine::register_custom_operator` now accepts reserved symbols.
* `Engine::register_custom_operator` now returns an error if given a precedence of zero.
* The examples `repl` and `rhai_runner` are moved into `bin` and renamed `rhai-repl` and `rhai-run` respectively.
Version 0.19.8

View File

@ -16,7 +16,8 @@ The Rhai Scripting Language
2. [Minimal](start/builds/minimal.md)
3. [no-std](start/builds/no-std.md)
4. [WebAssembly (WASM)](start/builds/wasm.md)
5. [Examples](start/examples/index.md)
5. [Tools](start/bin.md)
6. [Examples](start/examples/index.md)
1. [Rust](start/examples/rust.md)
2. [Scripts](start/examples/scripts.md)
3. [Using the `Engine`](engine/index.md)
@ -34,22 +35,22 @@ The Rhai Scripting Language
1. [String Parameters in Rust Functions](rust/strings.md)
3. [Register a Generic Rust Function](rust/generic.md)
4. [Register a Fallible Rust Function](rust/fallible.md)
6. [Override a Built-in Function](rust/override.md)
7. [Operator Overloading](rust/operators.md)
8. [Register any Rust Type and its Methods](rust/custom.md)
5. [Override a Built-in Function](rust/override.md)
6. [Operator Overloading](rust/operators.md)
7. [Register any Rust Type and its Methods](rust/custom.md)
1. [Property Getters and Setters](rust/getters-setters.md)
2. [Indexers](rust/indexers.md)
3. [Disable Custom Types](rust/disable-custom.md)
4. [Printing Custom Types](rust/print-custom.md)
9. [Modules](rust/modules/index.md)
8. [Modules](rust/modules/index.md)
1. [Create from Rust](rust/modules/create.md)
2. [Create from AST](rust/modules/ast.md)
3. [Module Resolvers](rust/modules/resolvers.md)
1. [Custom Module Resolvers](rust/modules/imp-resolver.md)
10. [Plugins](plugins/index.md)
9. [Plugins](plugins/index.md)
1. [Export a Rust Module](plugins/module.md)
2. [Export a Rust Function](plugins/function.md)
11. [Packages](rust/packages/index.md)
10. [Packages](rust/packages/index.md)
1. [Built-in Packages](rust/packages/builtin.md)
2. [Custom Packages](rust/packages/create.md)
5. [Rhai Language Reference](language/index.md)

24
doc/src/start/bin.md Normal file
View File

@ -0,0 +1,24 @@
Rhai Tools
==========
{{#include ../links.md}}
A number of Rhai tools can be found in the `src/bin` directory:
| Tool | Description |
| ------------------------------------------------- | ----------------------------------------------------------- |
| [`rhai-repl`]({{repoTree}}/examples/rhai-repl.rs) | a simple REPL, interactively evaluate statements from stdin |
| [`rhai-run`]({{repoTree}}/examples/rhai-run.rs) | runs each filename passed to it as a Rhai script |
`rhai-repl` is particularly useful - it allows one to interactively try out Rhai's
language features in a standard REPL (**R**ead-**E**val-**P**rint **L**oop).
Running a Tool
--------------
Tools can be run with the following command:
```bash
cargo run --bin {tool_name}
```

View File

@ -11,15 +11,10 @@ A number of examples can be found in the `examples` directory:
| [`custom_types_and_methods`]({{repoTree}}/examples/custom_types_and_methods.rs) | shows how to register a custom Rust type and methods for it |
| [`hello`]({{repoTree}}/examples/hello.rs) | simple example that evaluates an expression and prints the result |
| [`reuse_scope`]({{repoTree}}/examples/reuse_scope.rs) | evaluates two pieces of code in separate runs, but using a common [`Scope`] |
| [`rhai-repl`]({{repoTree}}/examples/rhai-repl.rs) | a simple REPL, interactively evaluate statements from stdin |
| [`rhai-run`]({{repoTree}}/examples/rhai-run.rs) | runs each filename passed to it as a Rhai script |
| [`serde`]({{repoTree}}/examples/serde.rs) | example to serialize and deserialize Rust types with [`serde`](https://crates.io/crates/serde).<br/>The [`serde`] feature is required to run |
| [`simple_fn`]({{repoTree}}/examples/simple_fn.rs) | shows how to register a simple function |
| [`strings`]({{repoTree}}/examples/strings.rs) | shows different ways to register functions taking string arguments |
The `rhai-repl` example is a particularly good one as it allows one to interactively try out Rhai's
language features in a standard REPL (**R**ead-**E**val-**P**rint **L**oop).
Running Examples
----------------

View File

@ -1,7 +1,7 @@
Sample Applications
===================
Sample applications written in Rhai.
Sample applications that use the Rhai scripting engine.
How to Run

12
src/bin/README.md Normal file
View File

@ -0,0 +1,12 @@
Rhai Tools
==========
Tools written in Rhai.
How to Run
----------
```bash
cargo run --bin sample_app_to_run
```