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.
Add this to your Cargo.toml
dependencies section:
toml
crowbook-text-processing = "0.1"
```rust extern crate crowbooktextprocessing;
use crowbooktextprocessing::escape::; use crowbook_text_processing::clean::; use crowbooktextprocessing::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)));
} ```
See the documentation on docs.rs.
See the ChangeLog file.
Élisabeth Henry liz.henry@ouvaton.org.
This is free software, published under the Mozilla Public License, version 2.0.
While not yet at version 1.0
, this crates tries to follows semantic versioning in the following way:
x
in 0.x.y
means breaking changes.y
in 0.x.y
means non-breaking changes.