Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTML/CSS language support #68

Merged
merged 1 commit into from
Oct 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions resources/css.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{1} #### #### ####
{1} ## ## ## ##
{1} ## #### ####
{1} ## ## ## ##
{1} #### #### ####

{0} ##########################
{0} ##########################
{0} ##########################
{0} ##### #####
{0} ############# #####
{0} ########## #########
{0} ##### ###########
{0} ##### #####
{0} ############### #####
{0} ##### ###### #####
{0} ##### ####
{0} ##### #####
{0} ######################
{0} ####################
{0} ##############
21 changes: 21 additions & 0 deletions resources/html.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{1} ## ## ###### ## ## ##
{1} ## ## ## ### ### ##
{1} ###### ## ## # ## ##
{1} ## ## ## ## ## ##
{1} ## ## ## ## ## ######

{0} ############################
{0} ##########################
{0} ##### #####
{0} ##### #####
{0} ##### #################
{0} ##### #################
{0} #### ####
{0} #### ####
{0} ################ ####
{0} ##### ###### ####
{0} #### ####
{0} ##### #####
{0} ######################
{0} ######################
{0} ##########
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,13 @@ enum Language {
Clojure,
Cpp,
Csharp,
CSS,
Dart,
Erlang,
Forth,
Go,
Haskell,
HTML,
Idris,
Java,
Kotlin,
Expand Down Expand Up @@ -311,11 +313,13 @@ impl fmt::Display for Language {
Language::Clojure => write!(f, "Clojure"),
Language::Cpp => write!(f, "C++"),
Language::Csharp => write!(f, "C#"),
Language::CSS => write!(f, "CSS"),
Language::Dart => write!(f, "Dart"),
Language::Erlang => write!(f, "Erlang"),
Language::Forth => write!(f, "Forth"),
Language::Go => write!(f, "Go"),
Language::Haskell => write!(f, "Haskell"),
Language::HTML => write!(f, "HTML"),
Language::Idris => write!(f, "Idris"),
Language::Java => write!(f, "Java"),
Language::Kotlin => write!(f, "Kotlin"),
Expand Down Expand Up @@ -710,11 +714,13 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Clojure => Language::Clojure,
tokei::LanguageType::Cpp => Language::Cpp,
tokei::LanguageType::CSharp => Language::Csharp,
tokei::LanguageType::Css => Language::CSS,
tokei::LanguageType::Dart => Language::Dart,
tokei::LanguageType::Erlang => Language::Erlang,
tokei::LanguageType::Forth => Language::Forth,
tokei::LanguageType::Go => Language::Go,
tokei::LanguageType::Haskell => Language::Haskell,
tokei::LanguageType::Html => Language::HTML,
tokei::LanguageType::Idris => Language::Idris,
tokei::LanguageType::Java => Language::Java,
tokei::LanguageType::Kotlin => Language::Kotlin,
Expand Down Expand Up @@ -748,11 +754,13 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Clojure,
tokei::LanguageType::Cpp,
tokei::LanguageType::CSharp,
tokei::LanguageType::Css,
tokei::LanguageType::Dart,
tokei::LanguageType::Erlang,
tokei::LanguageType::Forth,
tokei::LanguageType::Go,
tokei::LanguageType::Haskell,
tokei::LanguageType::Html,
tokei::LanguageType::Idris,
tokei::LanguageType::Java,
tokei::LanguageType::Kotlin,
Expand Down Expand Up @@ -785,11 +793,13 @@ impl Info {
Language::Clojure => include_str!("../resources/clojure.ascii"),
Language::Cpp => include_str!("../resources/cpp.ascii"),
Language::Csharp => include_str!("../resources/csharp.ascii"),
Language::CSS => include_str!("../resources/css.ascii"),
Language::Dart => include_str!("../resources/dart.ascii"),
Language::Erlang => include_str!("../resources/erlang.ascii"),
Language::Forth => include_str!("../resources/forth.ascii"),
Language::Go => include_str!("../resources/go.ascii"),
Language::Haskell => include_str!("../resources/haskell.ascii"),
Language::HTML => include_str!("../resources/html.ascii"),
Language::Idris => include_str!("../resources/idris.ascii"),
Language::Java => include_str!("../resources/java.ascii"),
Language::Kotlin => include_str!("../resources/kotlin.ascii"),
Expand Down Expand Up @@ -822,11 +832,13 @@ impl Info {
Language::Clojure => vec![Color::BrightBlue, Color::BrightGreen],
Language::Cpp => vec![Color::Yellow, Color::Cyan],
Language::Csharp => vec![Color::White],
Language::CSS => vec![Color::Blue, Color::White],
Language::Dart => vec![Color::Blue, Color::Cyan],
Language::Erlang => vec![Color::BrightRed],
Language::Forth => vec![Color::BrightRed],
Language::Go => vec![Color::White],
Language::Haskell => vec![Color::BrightBlue, Color::BrightMagenta, Color::Blue],
Language::HTML => vec![Color::Red, Color::White],
Language::Idris => vec![Color::Red],
Language::Java => vec![Color::BrightBlue, Color::Red],
Language::Kotlin => vec![Color::Blue, Color::Yellow, Color::Magenta],
Expand Down