mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Merge remote branch 'upstream/master' into lasso
This commit is contained in:
11
README.md
11
README.md
@@ -24,7 +24,7 @@ See [lib/linguist/language.rb](https://github.com/github/linguist/blob/master/li
|
|||||||
|
|
||||||
The actual syntax highlighting is handled by our Pygments wrapper, [pygments.rb](https://github.com/tmm1/pygments.rb). It also provides a [Lexer abstraction](https://github.com/tmm1/pygments.rb/blob/master/lib/pygments/lexer.rb) that determines which highlighter should be used on a file.
|
The actual syntax highlighting is handled by our Pygments wrapper, [pygments.rb](https://github.com/tmm1/pygments.rb). It also provides a [Lexer abstraction](https://github.com/tmm1/pygments.rb/blob/master/lib/pygments/lexer.rb) that determines which highlighter should be used on a file.
|
||||||
|
|
||||||
We typically run on a prerelease version of Pygments, [pygments.rb](https://github.com/tmm1/pygments.rb), to get early access to new lexers. The [lexers.yml](https://github.com/github/linguist/blob/master/lib/linguist/lexers.yml) file is a dump of the lexers we have available on our server.
|
We typically run on a prerelease version of Pygments, [pygments.rb](https://github.com/tmm1/pygments.rb), to get early access to new lexers. The [languages.yml](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml) file is a dump of the lexers we have available on our server.
|
||||||
|
|
||||||
### Stats
|
### Stats
|
||||||
|
|
||||||
@@ -32,10 +32,11 @@ The Language Graph you see on every repository is built by aggregating the langu
|
|||||||
|
|
||||||
The repository stats API can be used on a directory:
|
The repository stats API can be used on a directory:
|
||||||
|
|
||||||
project = Linguist::Repository.from_directory(".")
|
```ruby
|
||||||
project.language.name #=> "Ruby"
|
project = Linguist::Repository.from_directory(".")
|
||||||
project.languages #=> { "Ruby" => 0.98,
|
project.language.name #=> "Ruby"
|
||||||
"Shell" => 0.02 }
|
project.languages #=> { "Ruby" => 0.98, "Shell" => 0.02 }
|
||||||
|
```
|
||||||
|
|
||||||
These stats are also printed out by the binary. Try running `linguist` on itself:
|
These stats are also printed out by the binary. Try running `linguist` on itself:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user