docs.rs failed to build r4d-0.11.5
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
r4d-3.1.0
R4d (Rad)
R4d is a text oriented macro prosessor made with rust.
Demo
Raw texts
$define(author=Simon Creek)
$define(title=R4d demo)
---
title : $title()
author : $author()
---
My name is $author() and I made r4d to make macros can be used within various
forms of texts. This article was written in $date() $time().
$ifdef(test, This should be only printed when I'm testing not in release)
This is some important table automatically formatted according to environment
variable.
$table($env(TABLE_FORM),\*H1,H2,H3
a,b,c
d,e,f*\)
I'm out of idea and I need some texts, $lipsum(15)
Processed texts
---
title : R4d demo
author : Simon Creek
---
My name is Simon Creek and I made r4d to make macros can be used within various
forms of texts. This article was written in 2021-09-26 21:36:59.
This is some important table automatically formatted according to environment
variable.
|H1|H2|H3|
|-|-|-|
|a|b|c|
|d|e|f|
I'm out of idea and I need some texts, Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.
Install
You can download binaries in release page
If your platform is not listed, mostly MacOS, directly install from cargo registry.
# Binary features is mandatory or else it is not an executable
# If you need color prompt, then use features "color"
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 RadError;
use Processor;
let processor = new
.greedy
.write_to_file?
.build;
processor.from_file?;
processor.print_result?;
Usage
Syntax
Basic macros (or macro-like functions)
Macro types
How to debug
NOTE
0.11 has breaking changes
Though there were several minor breaking changes, this version has several breaking changes over command line arguments, how processing works by default, how macros worrk by default.
Changes are illustrated in release page.
Windows path bug was fixed in 0.11.5
Because windows also accept Slash (/) as path delimiter, I didn't find
any problem until I found windows's default path delimiter is Reverse slash (\). This was fixed in 0.11.5
Goal
R4d aims to be a modern alternative to m4 processor, which means
- No trivial m4 quotes for macro definition
- An explicit rule for macro definition and usage so that de facto underscore rule is not necessary
- Easier binding with other programming languages(Rust's c binding)
- Enable combination of file stream and stdout
- As expressive as current m4 macro processor