tegen

Crates.iotegen
lib.rstegen
version0.1.4
sourcesrc
created_at2022-03-05 06:51:37.044668
updated_at2022-03-06 06:19:07.616791
descriptiontegen is a Rust library designed to generate text from a given template.
homepagehttps://github.com/vs-123/tegen
repositoryhttps://github.com/vs-123/tegen
max_upload_size
id543884
size9,656
vs-123 (vs-123)

documentation

https://docs.rs/tegen/0.1.3/tegen/

README

tegen

tegen is a Rust library designed to generate fast text from a template. (heavily inspired from liderman's text generator)

Usage

use tegen::tegen::TextGenerator;

fn main() {
    let tg = TextGenerator::new();

    // Generate text from a given template
    println!("{}", tg.generate("{Hello|Greetings|Salutations}, {World|Reality}!"));

    // You can even nest templates!
    println!("{}", tg.generate("{Good {night|morning|evening|day}|Hello|Greetings|Howdy|What's up}, {friend|mate}! {How are you|How's it going}?"));
}

Features

  • Faster than cup noodles
  • Does not use regular expressions
  • Very user friendly
  • Included examples which can be run by using `cargo run --example [example_name]`

Goals

The main goal of this library is to generate text from a given template as fast as possible. Other than that, the other goals of this library are:

  • Easy to use
  • Easy to extend
  • Easy to understand
  • Easy to maintain

How to contribute

  • Create an issue for bug reports or feature suggestions
  • Create a pull request of a new feature or a bug fix describing the changes it will make
Commit count: 25

cargo fmt