docs.rs failed to build detect-lang-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
detect-lang-0.1.5
detect-lang
This crate is a utility for identifying names of programming languages (and related files) from paths and file extensions.
This is not a crate for detecting natural languages.
Paths and Extensions
Languages can be identified from paths using from_path
or directly from extensions using from_extension
.
use from_path;
assert_eq!;
assert_eq!;
use from_extension;
assert_eq!;
assert_eq!;
// The case is ignored
assert_eq!;
assert_eq!;
Language ID
In short, the language id
is a lowercase version of name
.
However, it also replaces symbols making it usable as a URL slug.
For instance foo.hpp
is identified as language name C++
and
language ID cpp
.
use from_path;
assert_eq!;
assert_eq!;
assert_eq!;
use from_extension;
assert_eq!;
assert_eq!;
assert_eq!;
// The case is ignored
assert_eq!;
assert_eq!;
Match Example
use Path;
use ;
let path = new;
match from_path