typographic_linter

Crates.iotypographic_linter
lib.rstypographic_linter
version
sourcesrc
created_at2017-03-12 18:59:36.791456
updated_at2017-05-23 14:57:13.605522
descriptionLibrary that checks for common typographic rules in several languages: English, French, German, Italian and Spanish.
homepage
repositoryhttps://github.com/rlustin/typographic-linter
max_upload_size
id8948
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`
size0
Raphaël Lustin (rlustin)

documentation

README

typographic-linter

Build Status

Typographic linter – because we do care very much about typography.

Overview

typographic-linter is Rust library that checks for common typographic rules in several languages: English, French, German, Italian and Spanish.

Library in action

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.");
    }
}

Implemented rules

This library is a work in progress. For now, it only checks for the rules bellow.

All languages

  • curly apostrophes;
  • ellipsis symbol;
  • no space before comma;
  • prices;
  • typographic quotation marks.

French

  • spaces before double punctuation marks.
Commit count: 33

cargo fmt