crowbook-text-processing 0.1.1

Some text processing functions written for Crowbook and moved in a separate library. Include html/tex escaping, unnecessary whitespace cleaning, and french typographic formatting.
Documentation

crowbook-text-processing

Some text processing functions initially written for Crowbook and moved in a separate library (and a more permissive license) so they can be used in other projects.

Usage

Add this to your Cargo.toml dependencies section:

crowbook-text-processing = "0.1"

Example

extern crate crowbook_text_processing;

use crowbook_text_processing::escape::*;
use crowbook_text_processing::clean::*;
use crowbook_text_processing::french::FrenchFormatter;

fn main() {

    let s = " Some  string with  too much   whitespaces & around 1% characters that might cause trouble to HTML or LaTeX.";
    let new_s = remove_whitespaces(s);
    println!("for HTML: {}", escape_html(new_s.clone()));
    println!("for LaTeX: {}", escape_tex(new_s));
    
    let s = " Une chaîne en français ! On voudrait un résultat « typographiquement correct ».";
    let new_s = FrenchFormatter::new().format(s);
    println!("for HTML: {}", escape_nb_spaces(escape_html(new_s.clone())));
    println!("for LaTeX: {}", escape_nb_spaces_tex(escape_tex(new_s)));
}

Documentation

See the documentation on docs.rs.

ChangeLog

See the ChangeLog file.

Author

Élisabeth Henry liz.henry@ouvaton.org.

License

This is free software, published under the Mozilla Public License, version 2.0.

Semantic versioning

While not yet at version 1.0, this crates tries to follows semantic versioning in the following way:

  • an increase of x in 0.x.y means breaking changes.
  • an increase of y in 0.x.y means non-breaking changes.