https://github.com/dart-community/linguist_lang_info
A collection of language information tracked by the linguist project.
https://github.com/dart-community/linguist_lang_info
dart language-data linguist
Last synced: 7 months ago
JSON representation
A collection of language information tracked by the linguist project.
- Host: GitHub
- URL: https://github.com/dart-community/linguist_lang_info
- Owner: dart-community
- License: mit
- Created: 2023-11-12T02:34:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T11:14:36.000Z (over 1 year ago)
- Last Synced: 2024-04-22T12:31:25.888Z (over 1 year ago)
- Topics: dart, language-data, linguist
- Language: Dart
- Homepage: https://pub.dev/packages/linguist_lang_info
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
A collection of information about various
programming languages and content types
tracked by GitHub's [linguist project][].This information includes basic information, including,
but not limited to, the following:- Language name
- Type of language or content
- Common extensions
- Common aliases
- Color used on GitHub
- Language group or family
- TextMate grammar scope## Usage
To access the information exposed by this project,
first add the package as a dependency:```shell
dart pub add linguist_lang_info
```Then import its library and either
access the language(s) you're interested in or
the list of all languages.```dart
import 'package:linguist_lang_info/linguist_lang_info.dart';void main() {
const targetExtension = '.dart';final languagesWithExtension =
allLanguages.where((lang) => lang.extensions.contains(targetExtension));for (final lang in languagesWithExtension) {
print('The ${lang.name} language uses the `$targetExtension` extension!');
if (targetExtension != lang.primaryExtension) {
print('It is however, not its primary extension.');
}
}
}
```[linguist project]: https://github.com/github-linguist/linguist