Crates.io | typographic_linter |
lib.rs | typographic_linter |
version | |
source | src |
created_at | 2017-03-12 18:59:36.791456 |
updated_at | 2017-05-23 14:57:13.605522 |
description | Library that checks for common typographic rules in several languages: English, French, German, Italian and Spanish. |
homepage | |
repository | https://github.com/rlustin/typographic-linter |
max_upload_size | |
id | 8948 |
Cargo.toml error: | TOML parse error at line 9, column 1 | 9 | travis-ci = { repository = "https://github.com/rlustin/typographic-linter", branch = "master" } | ^^^^^^^^^ unknown field `travis-ci`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Typographic linter – because we do care very much about typography.
typographic-linter
is Rust library that checks for common typographic rules in several languages:
English, French, German, Italian and Spanish.
Add the dependency in your Cargo.toml
:
typographic_linter = { git = "https://github.com/rlustin/typograhic-linter" }
extern crate typographic_linter;
use typographic_linter::Linter;
fn main() {
let linter = Linter::new("en".to_string()).unwrap();
let content = "It's me...";
let result = linter.check(content);
if result.is_err() {
let warnings = result.err().unwrap();
println!("There are {} typographic warnings in “{}”:", warnings.len(), content);
for warning in &warnings {
println!("- At {}, {}: {}", warning.start, warning.end, warning.message);
}
} else {
println!("There’s no typographic warning.");
}
}
This library is a work in progress. For now, it only checks for the rules bellow.