Expand description
§R4d(rad)
R4d is a text oriented macro processor that tries to solve inconveniences of well-known m4 macro processor.
R4d is provided as both binary and library. Binary includes all features of optional dependencies. Library doesn’t provide any features by default so you can set them manually.
§Features
- evalexpr : eval related macros
- chrono : time related macros
- textwrap : "wrap" macro
- cindex : Query related macros
- full : all features above
- debug : Enable debug method
- color : Enable color prompt
- hook : Enable hook macro
- signature : Enable signature option
§Simple usage
Binary
# Read from file and print to stdout
rad input_file.txt
# Read from standard input and print to file
printf '...text...' | rad -o out_file.txt
Library
use r4d::{Processor, RadResult};
use std::path::Path;
let mut processor = Processor::new()
.purge(true)
.write_to_file(Path::new("cache.txt"))
.expect("Failed to open a file");
processor.process_file(Path::new("input.txt"))
.expect("Failed to process file");
processor.print_result().expect("Failed to print result");
Detailed r4d usage is illustrated in github page or in Processor
Macros§
- trim
- Trim macro to trim a text
Structs§
- ExtMacro
Builder - Builder struct for extension macros
- Processor
- Central macro logic processor
Enums§
- Auth
Type - Authorization type
- Comment
Type - Comment type
- Diff
Option - Diffing behaviour
- Hygiene
- Hygiene variant
- Macro
Type - Types of a macros
- RadError
- R4d’s error type
- Storage
Output - Output that storage creates
- Warning
Type - Type variant or warning
- Write
Option - State enum value about direction of processed text
Traits§
- RadStorage
- Triat for storage interaction
Type Aliases§
- RadResult
- Genenric result type for every rad operations
- Storage
Result - Result alias for storage operation