3 releases
new 0.1.4 | Feb 16, 2025 |
---|---|
0.1.3 | Feb 15, 2025 |
0.1.2 | Feb 15, 2025 |
0.1.1 |
|
0.1.0 |
|
#205 in Cargo plugins
471 downloads per month
8KB
75 lines
cargo-prompt
Collapse a rust project into a single minified markdown document for prompting. Optionally remove comments / documentation. Items in .gitignore are automatically excluded.
install
cargo install cargo-prompt
run
cd my_cargo_project/
cargo prompt
remove comments / documentation
cd my_cargo_project/
cargo prompt -r
redirect to a file
cd my_cargo_project/
cargo prompt > saved_prompt.txt
target specific directory
cargo prompt /path/to/src/
example input
fizzbuzz/fizzbuzz.rs:
// Functions that "don't" return a value, actually return the unit type `()`
fn fizzbuzz(n: u32) -> () {
if is_divisible_by(n, 15) {
println!("fizzbuzz");
} else if is_divisible_by(n, 3) {
println!("fizz");
} else if is_divisible_by(n, 5) {
println!("buzz");
} else {
println!("{}", n);
}
}
example output
# fizzbuzz
## ./fizzbuzz.rs
```rust
fn fizzbuzz(n:u32)->(){if is_divisible_by(n,15){println!("fizzbuzz");}else if is_divisible_by(n,3){println!("fizz");}else if is_divisible_by(n,5){println!("buzz");}else{println!("{}",n);}}
```
Dependencies
~6–14MB
~180K SLoC