Crate rad

source · []
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", "evalk" macro
- chrono    : "date", "time" macro
- lipsum    : "lipsum" macro
- csv       : "from", "table" macro
- 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
- storage   : Enable storage feature

Simple usage

Binary

rad input_file.txt
printf '...text...' | rad -o out_file.txt

Library

use rad::{Processor, RadResult};
use std::path::Path;

let mut processor = Processor::new()
    .purge(true)
    .write_to_file(Some(Path::new("cache.txt")))?

processor.from_file(Path::new("input.txt"))?;
processor.print_result()?;

Detailed r4d usage is illustrated in github page or in processor module

Re-exports

pub use processor::Processor;

Modules

processor

Enums

Authorization type

Comment type

R4d’s error type

Type variant or warning

State enum value about direction of processed text

Type Definitions