eoneill / sassdoc

Documentation generator for Sass source code
Other
47 stars 3 forks source link

Document classes? #1

Closed joeldrapper closed 8 years ago

joeldrapper commented 12 years ago

Hi,

My sass file contains several classes that can be extended that I'd like to document. Is this possible?

Thanks!

eoneill commented 12 years ago

Currently, it only supports documenting methods (functions/mixins). But this could definitely be useful. Do you have any syntax in mind?

My first thought would be:

// a base model for an animal...
// @model     %animal
%animal {
  ...
}

// a dog is an awesome kind of animal...
// @model     %dog
// @extend    %animal
%dog {
  ...
  @extend %animal;
}

// ducks are cool too...
// @model     .duck
// @extend    %animal
.duck {
  ...
  @extend %animal;
}

So the new tags would be model and extend, where model defines the name (selector/placeholder) to be extended, and extend defines any other models this one is derived from.

Thoughts?

joeldrapper commented 12 years ago

That sounds pretty good. And if you're extending two models, you could just separate them by commas.

// Chiwawa
// @model     .chiwawa
// @extend    %animal, %dog
.chiwawa {
  ...
  @extend %animal, %dog;
}
eoneill commented 12 years ago

Cool! I'll tackle this one when I get some down time. This should be a relatively minor change.

joeldrapper commented 12 years ago

Awesome! I'd tackle it myself, but I'm not much of a ruby developer.