diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 04562dc2..cb0ea174 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -32,7 +32,7 @@ module Linguist # # Returns an array def self.detectable_markup - ["CSS", "Less", "Sass", "TeX"] + ["CSS", "Less", "Sass", "Stylus", "TeX"] end # Detect languages by a specific type diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 4838d2e2..7ecea3f1 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1519,6 +1519,11 @@ Standard ML: - sml primary_extension: .sml +Stylus: + type: markup + group: CSS + primary_extension: .styl + SuperCollider: type: programming color: "#46390b" diff --git a/lib/linguist/samples.json b/lib/linguist/samples.json index 83f5d00d..18c9c268 100644 --- a/lib/linguist/samples.json +++ b/lib/linguist/samples.json @@ -363,6 +363,9 @@ ".sig", ".sml" ], + "Stylus": [ + ".styl" + ], "SuperCollider": [ ".sc", ".scd" diff --git a/samples/Ruby/sinatra.rb b/samples/Ruby/sinatra.rb index 36ec2a2f..2909883c 100644 --- a/samples/Ruby/sinatra.rb +++ b/samples/Ruby/sinatra.rb @@ -598,6 +598,11 @@ module Sinatra render :less, template, options, locals end + def stylus(template, options={}, locals={}) + options.merge! :layout => false, :default_content_type => :css + render :stylus, template, options, locals + end + def builder(template=nil, options={}, locals={}, &block) options[:default_content_type] = :xml render_ruby(:builder, template, options, locals, &block) diff --git a/samples/Stylus/demo.styl b/samples/Stylus/demo.styl new file mode 100644 index 00000000..eb34f824 --- /dev/null +++ b/samples/Stylus/demo.styl @@ -0,0 +1,14 @@ +border-radius() + -webkit-border-radius arguments + -moz-border-radius arguments + border-radius arguments + +a.button + border-radius 5px + +fonts = helvetica, arial, sans-serif + +body { + padding: 50px; + font: 14px/1.4 fonts; +} \ No newline at end of file