kneath / kss

A methodology for documenting CSS and generating styleguides.
warpspire.com/kss
MIT License
4.04k stars 277 forks source link

.sass files throwing parser exception #14

Closed mattsly closed 12 years ago

mattsly commented 12 years ago

first, this looks amazing(!)

I have a project w/ a bunch of .sass formatted in "traditional" (non scss) format...I tried adding some kss docs w/ a subset to test, but was geting a parser exception.

I then just did a bare simple test w/ a trivial .sass file, but got the same issue - an exception from the parser call (pasted below)

It looks like you are using the scss parser directly rather than the wrapper? http://sass-lang.com/docs/yardoc/Sass/Engine.html

(.scss works like a charm, so I maybe this is the impetus to go through a conversion...though I'm still not sure why .scss seems to have emerged as more common since .sass seems so much more readable to me)

styleguide = Kss::Parser.new(".") Sass::SyntaxError: Invalid CSS after "$margin": expected selector or at-rule, was ": 16px" from (sass):13 from /Library/Ruby/Gems/1.8/gems/sass-3.1.11/lib/sass/../sass/scss/parser.rb:926:in expected' from /Library/Ruby/Gems/1.8/gems/sass-3.1.11/lib/sass/../sass/scss/parser.rb:872:inexpected' from /Library/Ruby/Gems/1.8/gems/sass-3.1.11/lib/sass/../sass/scss/parser.rb:29:in parse' from /Library/Ruby/Gems/1.8/gems/kss-0.1.1/lib/kss/parser.rb:15:ininitialize' from /Library/Ruby/Gems/1.8/gems/kss-0.1.1/lib/kss/parser.rb:14:in each' from /Library/Ruby/Gems/1.8/gems/kss-0.1.1/lib/kss/parser.rb:14:ininitialize' from (irb):3:in `new' from (irb):3

pincheira commented 12 years ago

Same issue here. Would love to see sass support added. All of the projects here in our office are coded with sass, not scss.

Love the idea of the app.

heikki commented 12 years ago

Having the same issue.

heikki commented 12 years ago

Seems to work with this change:

https://github.com/kneath/kss/blob/6e5cc964f9db945a8d04b77bbaa342741124245b/lib/kss/parser.rb#L15

root_node = Sass::Engine.for_file(filename, {}).to_tree

--edit

Breaks all other stuff though.. :)

carljm commented 12 years ago

Hmm, perhaps until there's a fix for this the README should be edited to make it clear that SASS is not actually supported, only SCSS?

heikki commented 12 years ago

https://github.com/kneath/kss/pull/18

kneath commented 12 years ago

SASS support should be merged in for now (see @heikki's pull request). I'll get around to a 0.2 release once I've done some more testing.