chore: add .cargo and assets for rustdoc build

This commit is contained in:
Jesús Pérez 2024-10-21 03:21:48 +01:00
parent 0e347bb70b
commit c105422f91
No known key found for this signature in database
4 changed files with 72 additions and 0 deletions

2
.cargo/config.toml Normal file
View File

@ -0,0 +1,2 @@
[build]
rustdocflags = ["--html-in-header", "assets/header.html", "--default-theme", "light", "--extend-css","assets/doc.css"]

3
assets/doc.css Normal file
View File

@ -0,0 +1,3 @@
.logo-container img {
width: 100% !important;
}

0
assets/header.html Normal file
View File

67
assets/howto.md Normal file
View File

@ -0,0 +1,67 @@
## How to used
**cargo run --** can be replaced for generated binaries with
- target/debug/be-technical-interview-rust (for debug build)
- target/release/be-technical-interview-rust (for release build)
### For help
```bash
cargo run -- -h
```
### For input file **input.txt**
```bash
cargo run -- -i input.txt
```
### In quiet mode
```bash
cargo run -- -i input.txt -q
```
if **output path** is provided, results will be saved in provided path,<br>
without **quiet mode** info is printed to terminal
```bash
cargo run -- -i input.txt -o /tmp/output.txt
```
### Use config path. **Batch processing in parallel** (one thread for each target)
```bash
cargo run -- -c config.toml
```
### Config file content
```toml
be_quiet = false
[[targets]]
input = "input.txt"
[[targets]]
input = "input_2.txt"
```
If **output** path is provided, **out_overwrite** can be used (true or false) to append conten or rewrite.
By default:
- **out_overwrite** is **true**
- *reg_exp** is set as
```rust
pub const DEFAULT_REG_EXP: &str = r"(\d+) (\w+) (\d+)";
```
**reg_exp** can be provided but as a **regex** expresion from **string**, if it can not be converted parser exit.
#### CAUTION
Command line options have precedence over **config path** settings. <br>
Be careful with the combinations