See the rs docs and the usage guide Look at progress and contribute on github.
papyrus
depends on proc-macro2
and syn
which contains features that are only available on a nightly compiler. Further to this, the features are underneath a config flag, so compiling requires the RUSTFLAGS
environment variable to include --cfg procmacro2_semver_exempt
.
Switch to a nightly compiler.
sh
rustup default nightly
Linux, Mac
bash
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install papyrus
Windows
bash
$env:RUSTFLAGS="--cfg procmacro2_semver_exempt"
cargo install papyrus
papyrus run
will start the repl!
Add right click context menu. (May need admin rights)
bash
papyrus rc-add
Remove right click context menu. (May need admin rights)
bash
papyrus rc-remove
Run papyrus from command line.
bash
papyrus run path_to_src_file.rs
papyrus run path_to_script_file.rscript
.rs
or .rscript
file and choose Run with Papyrus
to compile and run code!cargo
. For now the directory is created under a .papyrus
directory in the users home directory.env::current_dir()
will return the directory of the .rs
or .rscript
file.File hello.rs
.
```sh extern crate some_crate;
fn main() { println!("Hello, world!"); } ```
Use papyrus to execute code.
bash
papyrus run hello.rs
The src/main.rs
will be populated with the same contents as hello.rs
. A Cargo.toml
file will be created, where some_crate
will be added as a dependency some-crate = "*"
.
File hello.rscript
.
```sh extern crate some_crate;
println!("Hello, world!"); ```
Use papyrus to execute code.
bash
papyrus run hello.rscript
The src/main.rs
will be populated with a main function encapsulating the code, and crate references placed above it. A similar Cargo.toml
will be created as before.